github.com/henvic/wedeploycli@v1.7.6-0.20200319005353-3630f582f284/functional/tests/domain.exp (about)

     1  #!/usr/bin/expect
     2  
     3  spawn $env(SHELL)
     4  
     5  Feature: "Domain"
     6  
     7  Scenario: "Add and delete a custom domain" {
     8    set domain1 [prefixed_project domain1]
     9    set domain qadomain1.$::_service_domain
    10  
    11    create_project $domain1
    12    create_service $domain1 hosting1
    13  
    14    send "$::bin domain show\r"
    15    expect {
    16      timeout { handle_timeout; break }
    17      "Please*select*a service from the list below."
    18    }
    19    send "1\r"
    20    expect {
    21      timeout { handle_timeout; break }
    22      "No custom domains found."
    23    }
    24    send "$::bin domain add $domain\r"
    25    expect {
    26      timeout { handle_timeout; break }
    27      "Type service ID or #"
    28    }
    29    send "hosting1\r"
    30    expect {
    31      timeout { handle_timeout; break }
    32      "Custom domain \"$domain\" added."
    33    }
    34    send "$::bin domain show -p $domain1 -s hosting1\r"
    35    expect {
    36      timeout { handle_timeout; break }
    37      -gl "1*$domain"
    38    }
    39    send "$::bin curl /projects/$domain1/services/hosting1\r"
    40    expect {
    41      timeout { handle_timeout; break }
    42      -gl "\"customDomains\"*:*\[*\"qadomain1.wedeploy.*\""
    43    }
    44    send "$::bin domain delete -p $domain1 -s hosting1\r"
    45    expect {
    46      timeout { handle_timeout; break }
    47      "Select a custom domain # or address to delete"
    48    }
    49    send "$domain\r"
    50    expect {
    51      timeout { handle_timeout; break }
    52      "Custom domain \"$domain\" deleted."
    53    }
    54    send "$::bin domain show -p $domain1 -s hosting1\r"
    55    expect {
    56      timeout {}
    57      $domain {
    58        expectation_not_met "Should not have custom domain $domain"
    59        break
    60      }
    61    }
    62    send "$::bin curl /projects/$domain1/services/hosting1\r"
    63    expect {
    64      timeout {}
    65      $domain {
    66        expectation_not_met "Should not have custom domain $domain"
    67        break
    68      }
    69    }
    70  } { delete_project $domain1 }