-
Notifications
You must be signed in to change notification settings - Fork 0
/
codecept.conf.js
51 lines (48 loc) · 1.33 KB
/
codecept.conf.js
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
const http = require('http');
const { setHeadlessWhen } = require('@codeceptjs/configure');
const { devices } = require('playwright');
const handler = require('serve-handler');
const server = http.createServer((request, response) => {
// You pass two more arguments for config and middleware
// More details here: https://github.com/vercel/serve-handler#options
return handler(request, response, { public: 'dist' });
});
// turn on headless mode when running with HEADLESS=true environment variable
// export HEADLESS=true && npx codeceptjs run
setHeadlessWhen(true);
exports.config = {
tests: './tests/e2e/*_test.js',
output: './tests/e2e/screenshots/base/',
helpers: {
Playwright: {
url: 'http://localhost:3001',
show: true,
waitForNavigation: 'networkidle0',
emulate: devices['iPhone 7'],
},
ResembleHelper: {
require: 'codeceptjs-resemblehelper',
baseFolder: './tests/e2e/screenshots/base/',
diffFolder: './tests/e2e/screenshots/diff/',
prepareBaseImage: true,
},
},
bootstrap() {
server.listen(3001, () => {
console.log('Running at http://localhost:3001');
});
},
teardown() {
server.close();
},
mocha: {},
name: 'barry',
plugins: {
retryFailedStep: {
enabled: true,
},
screenshotOnFail: {
enabled: false,
},
},
};