-
Notifications
You must be signed in to change notification settings - Fork 2
/
codecept.conf.js
51 lines (48 loc) · 1.32 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 { devices } = require('playwright');
const { setHeadlessWhen } = require('@codeceptjs/configure');
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: './test/e2e/*_test.js',
output: './test/e2e/output',
helpers: {
Playwright: {
url: 'http://localhost:3001',
show: true,
waitForNavigation: 'networkidle0',
emulate: devices['iPhone 7'],
},
ResembleHelper: {
require: 'codeceptjs-resemblehelper',
baseFolder: './test/e2e/screenshots/base/',
diffFolder: './test/e2e/screenshots/diff/',
prepareBaseImage: true,
},
},
bootstrap() {
server.listen(3001, () => {
console.log('Running at http://localhost:3001');
});
},
teardown() {
server.close();
},
mocha: {},
name: 'pocketpasta',
plugins: {
retryFailedStep: {
enabled: true,
},
screenshotOnFail: {
enabled: true,
},
},
};