@@ -58,6 +58,13 @@ enum Environment: string
5858 */
5959 case TESTING = 'testing ' ;
6060
61+ /**
62+ * E2E Testing environment.
63+ * Separate from testing as it commit data to the database which may interfere
64+ * with regular tests that expect a static database.
65+ */
66+ case E2E_TESTING = 'e2e_testing ' ;
67+
6168 /**
6269 * Development environment.
6370 * Suitable for developer machines and development servers.
@@ -151,6 +158,16 @@ public function getConstantsOverride(string $root_dir): array
151158 $ root_dir . '/tests/fixtures/plugins ' ,
152159 ],
153160 ],
161+ self ::E2E_TESTING => [
162+ 'GLPI_CONFIG_DIR ' => $ root_dir . '/tests/playwright/glpi_config ' ,
163+ 'GLPI_VAR_DIR ' => $ root_dir . '/tests/playwright/glpi_files ' ,
164+ 'GLPI_LOG_LVL ' => LogLevel::DEBUG ,
165+ 'GLPI_STRICT_ENV ' => true ,
166+ 'GLPI_PLUGINS_DIRECTORIES ' => [
167+ $ root_dir . '/tests/fixtures/plugins ' ,
168+ ],
169+
170+ ],
154171 self ::DEVELOPMENT => [
155172 'GLPI_LOG_LVL ' => LogLevel::DEBUG ,
156173 'GLPI_STRICT_ENV ' => true ,
@@ -169,7 +186,11 @@ public function shouldExpectResourcesToChange(string $root_dir = GLPI_ROOT): boo
169186 // Only production/staging environment are considered as environments
170187 // where resources are not supposed to change.
171188 // In others environments, we must match for changes.
172- if ($ this === self ::TESTING || $ this === self ::DEVELOPMENT ) {
189+ if (
190+ $ this === self ::TESTING
191+ || $ this === self ::DEVELOPMENT
192+ || $ this === self ::E2E_TESTING
193+ ) {
173194 return true ;
174195 }
175196
@@ -212,7 +233,7 @@ public function shouldEnableExtraDevAndDebugTools(): bool
212233 };
213234 }
214235
215- public function shouldAddExtraE2EDataDuringInstallation (): bool
236+ public function shouldAddExtraCypressDataDuringInstallation (): bool
216237 {
217238 // Note: this will be removed when we switch to playwright.
218239 return match ($ this ) {
0 commit comments