-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathcodecept.conf.js
More file actions
142 lines (135 loc) · 4.24 KB
/
codecept.conf.js
File metadata and controls
142 lines (135 loc) · 4.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
const { testFilesHelper } = require('./e2e/plugins/failedAndNotExecutedTestFilesPlugin');
const functional = process.env.FUNCTIONAL;
const ccdPipelineTests = [
'./e2e/tests/ui_tests/{*,**/*}_test.js',
'./e2e/tests/api_tests/lrspec_cui/*_test.js',
];
const civilServiceAndCamundaTests = [
'./e2e/tests/api_tests/{*,**/*}_test.js',
'./e2e/tests/api_tests/*_test.js',
];
const getTests = () => {
let prevFailedTestFiles = process.env.PREV_FAILED_TEST_FILES;
let prevNotExecutedTestFiles = process.env.PREV_NOT_EXECUTED_TEST_FILES;
if (prevFailedTestFiles !== undefined || prevNotExecutedTestFiles !== undefined) {
prevFailedTestFiles = prevFailedTestFiles ? prevFailedTestFiles.split(',') : [];
prevNotExecutedTestFiles = prevNotExecutedTestFiles ? prevNotExecutedTestFiles.split(',') : [];
return [...prevFailedTestFiles, ...prevNotExecutedTestFiles];
}
if(process.env.WA_TESTS === 'true')
return [...ccdPipelineTests, ...civilServiceAndCamundaTests]
if(process.env.CCD_UI_TESTS === 'true')
return ccdPipelineTests;
else
return civilServiceAndCamundaTests;
};
exports.config = {
bootstrapAll: async () => {
if (functional) {
await testFilesHelper.createTempFailedTestsFile();
await testFilesHelper.createTempPassedTestsFile();
await testFilesHelper.createTempToBeExecutedTestsFile();
}
},
teardownAll: async () => {
if (functional) {
await testFilesHelper.createTestFilesReport();
await testFilesHelper.deleteTempFailedTestsFile();
await testFilesHelper.deleteTempPassedTestsFile();
await testFilesHelper.deleteTempToBeExecutedTestFiles();
}
},
tests: getTests(),
output: process.env.REPORT_DIR || 'test-results/functional',
helpers: {
Playwright: {
url: process.env.URL || 'http://localhost:3333',
show: process.env.SHOW_BROWSER_WINDOW === 'true' || false,
waitForTimeout: parseInt(process.env.WAIT_FOR_TIMEOUT_MS || 60000), // 60 seconds (reduced from 90 seconds)
windowSize: '1280x960',
browser: 'chromium',
timeout: 20000,
waitForAction: 500,
bypassCSP: true,
ignoreHTTPSErrors: true,
video: true,
contextOptions: {
recordVideo: {
dir: 'failed-videos',
},
},
},
BrowserHelpers: {
require: './e2e/helpers/browser_helper.js',
},
PlaywrightHelper: {
require: "./e2e/helpers/PlaywrightHelper.js",
},
GenerateReportHelper: {
require: './e2e/helpers/generate_report_helper.js',
},
},
include: {
I: './e2e/steps_file.js',
LRspec: './e2e/steps_file_LRspec.js',
WA: './e2e/steps_file_WA.js',
api: './e2e/api/steps.js',
api_spec: './e2e/api/steps_LRspec.js',
api_spec_fast: './e2e/api/steps_LRspecFast.js',
api_spec_small: './e2e/api/steps_LRspecSmall.js',
api_spec_cui: './e2e/api/steps_LRspecCui.js',
noc: './e2e/api/steps_noc.js',
hearings: './e2e/api/steps_hearings.js',
bulks: './e2e/api/steps_Bulk.js',
qmSteps: './e2e/api/steps_qm.js',
},
plugins: {
autoDelay: {
enabled: true,
methods: ['click', 'fillField', 'checkOption', 'selectOption', 'attach'],
},
retryFailedStep: {
enabled: true,
},
screenshotOnFail: {
enabled: true,
fullPageScreenshots: true,
},
failedAndNotExecutedTestFilesPlugin: {
enabled: functional,
require: './e2e/plugins/failedAndNotExecutedTestFilesPlugin',
},
allure: {
enabled: true,
require: "allure-codeceptjs",
resultsDir: "test-results/functional/allure-results",
},
},
mocha: {
bail: true,
reporterOptions: {
'codeceptjs-cli-reporter': {
stdout: '-',
options: {
steps: false,
},
},
'mocha-junit-reporter': {
stdout: '-',
options: {
mochaFile: process.env.REPORT_FILE || 'test-results/functional/result.xml',
},
},
mochawesome: {
stdout: '-',
options: {
reportDir: process.env.REPORT_DIR || 'test-results/functional',
reportFilename: `${process.env.MOCHAWESOME_REPORTFILENAME + '-' + new Date().getTime()}`,
inlineAssets: true,
overwrite: false,
json: false,
},
},
},
},
};