github.com/henvic/wedeploycli@v1.7.6-0.20200319005353-3630f582f284/functional/tests/new.exp (about) 1 #!/usr/bin/expect 2 3 spawn $env(SHELL) 4 5 Feature: "New" 6 7 Scenario: "Create a project and service" { 8 set new1 [prefixed_project new1] 9 send "$::bin new\r" 10 expect { 11 timeout { handle_timeout; break } 12 "Do you want to*create*a new project or install a new service?" 13 } 14 send "1\r" 15 expect { 16 timeout { handle_timeout; break } 17 "Choose a project ID" 18 } 19 send "$new1\r" 20 expect { 21 timeout { handle_timeout; break } 22 -gl "Project*$new1*created" 23 } 24 send "$::bin new\r" 25 expect { 26 timeout { handle_timeout; break } 27 "Do you want to*create*a new project or install a new service?" 28 } 29 send "2\r" 30 expect { 31 timeout { handle_timeout; break } 32 "Please*select*a project from the list below." 33 } 34 expect { 35 timeout { handle_timeout; break } 36 "Type project ID or #" 37 } 38 send "$new1\r" 39 expect { 40 timeout { handle_timeout; break } 41 "Choose a Service ID" 42 } 43 send "hosting1\r" 44 expect { 45 timeout { handle_timeout; break } 46 "Select a Service Type" 47 } 48 send "4\r" 49 expect { 50 timeout { handle_timeout; break } 51 "Service*hosting1-$new1.$::_service_domain*created" 52 } 53 assert_service_exists $new1 hosting1 54 } { delete_project $new1 } 55 56 Scenario: "Create a project with `$::bin new project`" { 57 set new2 [prefixed_project new2] 58 send "$::bin new project\r" 59 expect { 60 timeout { handle_timeout; break } 61 "Choose a project ID" 62 } 63 send "$new2\r" 64 expect { 65 timeout { handle_timeout; break } 66 "Project*$new2*created" 67 } 68 } { delete_project $new2 } 69 70 Scenario: "Create a service with `$::bin new service`" { 71 set new3 [prefixed_project new3] 72 create_project $new3 73 74 send "$::bin new service\r" 75 expect { 76 timeout { handle_timeout; break } 77 "Please*select*a project from the list below." 78 } 79 send "1\r" 80 expect { 81 timeout { handle_timeout; break } 82 "Choose a Service ID" 83 } 84 send "hosting1\r" 85 expect { 86 timeout { handle_timeout; break } 87 "Select a Service Type" 88 } 89 send "4\r" 90 expect { 91 timeout { handle_timeout; break } 92 "Service*hosting1-$new3.$::_service_domain*created" 93 } 94 assert_service_exists $new3 hosting1 95 } { delete_project $new3 }