@@ -20,7 +20,38 @@ Feature:
2020 When I press "Generate project archive"
2121 Then the response code should be 200
2222 And I should receive a zip file named "phpdocker.zip"
23- # And show last response
23+
24+ Scenario : Default zip contains all expected files
25+ Given I am on "/"
26+ When I press "Generate project archive"
27+ Then I should receive a zip file named "phpdocker.zip"
28+ And the zip should contain the file "docker-compose.yml"
29+ And the zip should contain the file "phpdocker/php-fpm/Dockerfile"
30+ And the zip should contain the file "phpdocker/php-fpm/php-ini-overrides.ini"
31+ And the zip should contain the file "phpdocker/nginx/nginx.conf"
32+ And the zip should contain the file "phpdocker/README.md"
33+ And the zip should contain the file "phpdocker/README.html"
34+
35+ Scenario : Webserver and php-fpm are always present in docker-compose.yml
36+ Given I am on "/"
37+ When I press "Generate project archive"
38+ Then I should receive a zip file named "phpdocker.zip"
39+ And the zip file "docker-compose.yml" should contain "webserver:"
40+ And the zip file "docker-compose.yml" should contain "php-fpm:"
41+
42+ Scenario : PHP 8.2 is reflected in Dockerfile
43+ Given I am on "/"
44+ When I select "8.2" from "project_phpOptions_version"
45+ And I press "Generate project archive"
46+ Then I should receive a zip file named "phpdocker.zip"
47+ And the zip file "phpdocker/php-fpm/Dockerfile" should contain "phpdockerio/php:8.2-fpm"
48+
49+ Scenario : PHP 8.5 is reflected in Dockerfile
50+ Given I am on "/"
51+ When I select "8.5" from "project_phpOptions_version"
52+ And I press "Generate project archive"
53+ Then I should receive a zip file named "phpdocker.zip"
54+ And the zip file "phpdocker/php-fpm/Dockerfile" should contain "phpdockerio/php:8.5-fpm"
2455
2556 Scenario : Check MySQL validation works
2657 Given I am on "/"
@@ -31,6 +62,23 @@ Feature:
3162 And the "#container_for_mysql_username" element should contain "This value should not be blank."
3263 And the "#container_for_mysql_password" element should contain "This value should not be blank."
3364
65+ Scenario : Check MariaDB validation works
66+ Given I am on "/"
67+ When I check "MariaDB"
68+ And I press "Generate project archive"
69+ Then the "#container_for_mariadb_rootPassword" element should contain "This value should not be blank."
70+ And the "#container_for_mariadb_databaseName" element should contain "This value should not be blank."
71+ And the "#container_for_mariadb_username" element should contain "This value should not be blank."
72+ And the "#container_for_mariadb_password" element should contain "This value should not be blank."
73+
74+ Scenario : Check PostgreSQL validation works
75+ Given I am on "/"
76+ When I check "Postgres"
77+ And I press "Generate project archive"
78+ Then the "#container_for_postgres_rootUser" element should contain "This value should not be blank."
79+ And the "#container_for_postgres_rootPassword" element should contain "This value should not be blank."
80+ And the "#container_for_postgres_databaseName" element should contain "This value should not be blank."
81+
3482 Scenario : MySQL config works correctly
3583 Given I am on "/"
3684 When I check "MySQL"
@@ -41,3 +89,116 @@ Feature:
4189 When I press "Generate project archive"
4290 Then the response code should be 200
4391 And I should receive a zip file named "phpdocker.zip"
92+ And the zip file "docker-compose.yml" should contain "mysql:"
93+ And the zip file "docker-compose.yml" should contain "MYSQL_ROOT_PASSWORD=root pass"
94+ And the zip file "docker-compose.yml" should contain "MYSQL_DATABASE=db name"
95+ And the zip file "docker-compose.yml" should contain "MYSQL_USER=user"
96+ And the zip file "docker-compose.yml" should contain "MYSQL_PASSWORD=pass"
97+
98+ Scenario : MariaDB config works correctly
99+ Given I am on "/"
100+ When I check "MariaDB"
101+ And I fill in "project_mariadbOptions_rootPassword" with "root pass"
102+ And I fill in "project_mariadbOptions_databaseName" with "db name"
103+ And I fill in "project_mariadbOptions_username" with "user"
104+ And I fill in "project_mariadbOptions_password" with "pass"
105+ When I press "Generate project archive"
106+ Then the response code should be 200
107+ And I should receive a zip file named "phpdocker.zip"
108+ And the zip file "docker-compose.yml" should contain "mariadb:"
109+ And the zip file "docker-compose.yml" should contain "MYSQL_ROOT_PASSWORD=root pass"
110+ And the zip file "docker-compose.yml" should contain "MYSQL_DATABASE=db name"
111+ And the zip file "docker-compose.yml" should contain "MYSQL_USER=user"
112+ And the zip file "docker-compose.yml" should contain "MYSQL_PASSWORD=pass"
113+
114+ Scenario : PostgreSQL config works correctly
115+ Given I am on "/"
116+ When I check "Postgres"
117+ And I fill in "project_postgresOptions_rootUser" with "root user"
118+ And I fill in "project_postgresOptions_rootPassword" with "root pass"
119+ And I fill in "project_postgresOptions_databaseName" with "db name"
120+ When I press "Generate project archive"
121+ Then the response code should be 200
122+ And I should receive a zip file named "phpdocker.zip"
123+ And the zip file "docker-compose.yml" should contain "postgres:"
124+ And the zip file "docker-compose.yml" should contain "POSTGRES_USER=root user"
125+ And the zip file "docker-compose.yml" should contain "POSTGRES_PASSWORD=root pass"
126+ And the zip file "docker-compose.yml" should contain "POSTGRES_DB=db name"
127+
128+ Scenario : Redis is included when enabled
129+ Given I am on "/"
130+ When I check "Redis"
131+ And I press "Generate project archive"
132+ Then I should receive a zip file named "phpdocker.zip"
133+ And the zip file "docker-compose.yml" should contain "redis:"
134+
135+ Scenario : Memcached is included when enabled
136+ Given I am on "/"
137+ When I check "Memcached"
138+ And I press "Generate project archive"
139+ Then I should receive a zip file named "phpdocker.zip"
140+ And the zip file "docker-compose.yml" should contain "memcached:"
141+
142+ Scenario : Mailhog is included when enabled
143+ Given I am on "/"
144+ When I check "Mailhog"
145+ And I press "Generate project archive"
146+ Then I should receive a zip file named "phpdocker.zip"
147+ And the zip file "docker-compose.yml" should contain "mailhog:"
148+
149+ Scenario : Clickhouse is included when enabled
150+ Given I am on "/"
151+ When I check "Clickhouse"
152+ And I press "Generate project archive"
153+ Then I should receive a zip file named "phpdocker.zip"
154+ And the zip file "docker-compose.yml" should contain "clickhouse:"
155+
156+ Scenario : Optional services are absent by default
157+ Given I am on "/"
158+ When I press "Generate project archive"
159+ Then I should receive a zip file named "phpdocker.zip"
160+ And the zip file "docker-compose.yml" should not contain "redis:"
161+ And the zip file "docker-compose.yml" should not contain "memcached:"
162+ And the zip file "docker-compose.yml" should not contain "mailhog:"
163+ And the zip file "docker-compose.yml" should not contain "clickhouse:"
164+ And the zip file "docker-compose.yml" should not contain "mysql:"
165+ And the zip file "docker-compose.yml" should not contain "mariadb:"
166+ And the zip file "docker-compose.yml" should not contain "postgres:"
167+ And the zip file "docker-compose.yml" should not contain "elasticsearch:"
168+
169+ Scenario : All optional services enabled simultaneously
170+ Given I am on "/"
171+ When I check "Redis"
172+ And I check "Memcached"
173+ And I check "Mailhog"
174+ And I check "Clickhouse"
175+ And I check "MySQL"
176+ And I fill in "project_mysqlOptions_rootPassword" with "root pass"
177+ And I fill in "project_mysqlOptions_databaseName" with "db name"
178+ And I fill in "project_mysqlOptions_username" with "user"
179+ And I fill in "project_mysqlOptions_password" with "pass"
180+ And I check "MariaDB"
181+ And I fill in "project_mariadbOptions_rootPassword" with "root pass"
182+ And I fill in "project_mariadbOptions_databaseName" with "db name"
183+ And I fill in "project_mariadbOptions_username" with "user"
184+ And I fill in "project_mariadbOptions_password" with "pass"
185+ And I check "Postgres"
186+ And I fill in "project_postgresOptions_rootUser" with "root user"
187+ And I fill in "project_postgresOptions_rootPassword" with "root pass"
188+ And I fill in "project_postgresOptions_databaseName" with "db name"
189+ And I press "Generate project archive"
190+ Then I should receive a zip file named "phpdocker.zip"
191+ And the zip file "docker-compose.yml" should contain "redis:"
192+ And the zip file "docker-compose.yml" should contain "memcached:"
193+ And the zip file "docker-compose.yml" should contain "mailhog:"
194+ And the zip file "docker-compose.yml" should contain "clickhouse:"
195+ And the zip file "docker-compose.yml" should contain "mysql:"
196+ And the zip file "docker-compose.yml" should contain "MYSQL_ROOT_PASSWORD=root pass"
197+ And the zip file "docker-compose.yml" should contain "MYSQL_DATABASE=db name"
198+ And the zip file "docker-compose.yml" should contain "MYSQL_USER=user"
199+ And the zip file "docker-compose.yml" should contain "MYSQL_PASSWORD=pass"
200+ And the zip file "docker-compose.yml" should contain "mariadb:"
201+ And the zip file "docker-compose.yml" should contain "postgres:"
202+ And the zip file "docker-compose.yml" should contain "POSTGRES_USER=root user"
203+ And the zip file "docker-compose.yml" should contain "POSTGRES_PASSWORD=root pass"
204+ And the zip file "docker-compose.yml" should contain "POSTGRES_DB=db name"
0 commit comments