|
1 | 1 | import { test, request as playwrightRequest, APIRequestContext } from '@playwright/test' |
2 | 2 | import { createParquetFromJson } from '../../parquet/parquet-multiplier'; |
3 | 3 | import { cleanupDatabaseFromAPI, getConsolidatedAllTestData, processFileViaStorage, validateSqlDatabaseFromAPI } from '../steps/steps'; |
4 | | -import { runnerBasedEpic123TestScenariosAddAmend } from '../e2e/epic123-smoke-tests/epic123-smoke-tests-migrated'; |
5 | | -import { runnerBasedEpic1TestScenariosAmend } from '../e2e/epic1-highpriority-tests/epic1-high-priority-testsuite-migrated'; |
6 | | -import { runnerBasedEpic2TestScenariosAmend } from '../e2e/epic2-highpriority-tests/epic2-high-priority-testsuite-migrated'; |
7 | | -import { runnerBasedEpic2MedTestScenariosAmend } from '../e2e/epic2-medpriority-tests/epic2-med-priority-testsuite-migrated'; |
8 | | -import { runnerBasedEpic3TestScenariosAmend } from '../e2e/epic3-highpriority-tests/epic3-high-priority-testsuite-migrated'; |
9 | | -import { runnerBasedEpic3MedTestScenariosAmend } from '../e2e/epic3-medpriority-tests/epic3-med-priority-testsuite-migrated'; |
10 | | -import { runnerBasedEpic4cTestScenariosAmend } from '../e2e/epic4c-add-participant-tests/epic4c-testsuite-migrated'; |
11 | | -import { runnerBasedEpic4dTestScenariosAmend } from '../e2e/epic4d-validation-tests/epic4d-6045-validation-testsuite-migrated'; |
12 | 4 | import { generateDynamicDateMap, replaceDynamicDatesInJson } from '../../../src/json/json-updater'; |
13 | 5 | import { fail } from 'assert'; |
14 | | -import { TIMEOUT } from 'dns'; |
| 6 | +import { TestTypePicker } from './TestTypePicker'; |
15 | 7 |
|
16 | 8 | // Tests to run based on TEST_TYPE environment variable |
17 | 9 |
|
18 | 10 |
|
19 | 11 | let scopedTestScenario = ""; |
20 | | - |
21 | 12 | const TEST_TYPE = process.env.TEST_TYPE ?? 'SMOKE'; |
22 | 13 |
|
23 | | -switch(TEST_TYPE) { |
24 | | - case 'RegressionEpic1': |
25 | | - scopedTestScenario = runnerBasedEpic1TestScenariosAmend; |
26 | | - break; |
27 | | - case 'RegressionEpic2': |
28 | | - scopedTestScenario = runnerBasedEpic2TestScenariosAmend; |
29 | | - break; |
30 | | - case 'RegressionEpic2Med': |
31 | | - scopedTestScenario = runnerBasedEpic2MedTestScenariosAmend; |
32 | | - case 'RegressionEpic3': |
33 | | - scopedTestScenario = runnerBasedEpic3TestScenariosAmend; |
34 | | - case 'RegressionEpic3Med': |
35 | | - scopedTestScenario = runnerBasedEpic3MedTestScenariosAmend; |
36 | | - case 'RegressionEpic4d': |
37 | | - scopedTestScenario = runnerBasedEpic4dTestScenariosAmend; |
38 | | - case 'RegressionEpic4c': |
39 | | - scopedTestScenario = runnerBasedEpic4cTestScenariosAmend; |
40 | | - default: |
41 | | - scopedTestScenario = runnerBasedEpic123TestScenariosAddAmend; |
| 14 | +scopedTestScenario = TestTypePicker(TEST_TYPE) |
42 | 15 |
|
| 16 | +if (!scopedTestScenario) { |
| 17 | + console.error("No test scenario tags defined for the current TEST_TYPE. Please check the environment variable."); |
| 18 | + fail; |
43 | 19 | } |
44 | | -/*if (TEST_TYPE == 'RegressionEpic1') { |
45 | | - scopedTestScenario = runnerBasedEpic1TestScenariosAmend; |
46 | | -} else if (TEST_TYPE == 'RegressionEpic2') { |
47 | | - scopedTestScenario = runnerBasedEpic2TestScenariosAmend; |
48 | | -} else if (TEST_TYPE == 'RegressionEpic2Med') { |
49 | | - scopedTestScenario = runnerBasedEpic2MedTestScenariosAmend; |
50 | | -} else if (TEST_TYPE == 'RegressionEpic3') { |
51 | | - scopedTestScenario = runnerBasedEpic3TestScenariosAmend; |
52 | | -} else if (TEST_TYPE == 'RegressionEpic3Med') { |
53 | | - scopedTestScenario = runnerBasedEpic3MedTestScenariosAmend; |
54 | | -} else if (TEST_TYPE == 'RegressionEpic4d') { |
55 | | - scopedTestScenario = runnerBasedEpic4dTestScenariosAmend; |
56 | | -} else if (TEST_TYPE == 'RegressionEpic4c') { |
57 | | - scopedTestScenario = runnerBasedEpic4cTestScenariosAmend; |
58 | | -} else { |
59 | | - scopedTestScenario = runnerBasedEpic123TestScenariosAddAmend; |
60 | | -}*/ |
61 | | - |
62 | 20 | if (!scopedTestScenario) { |
63 | 21 | console.error("No test scenario tags defined for the current TEST_TYPE. Please check the environment variable."); |
64 | 22 | fail; |
|
0 commit comments