-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathplaywright.config.ts
More file actions
67 lines (61 loc) · 2.12 KB
/
playwright.config.ts
File metadata and controls
67 lines (61 loc) · 2.12 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
import { defineConfig } from '@playwright/test';
import dotenv from 'dotenv';
import { toNumber } from 'lodash';
import { screenshotFolder } from './tests/automation/constants/variables';
dotenv.config({ quiet: true });
function repeatEach() {
return process.env.PLAYWRIGHT_REPEAT_COUNT
? toNumber(process.env.PLAYWRIGHT_REPEAT_COUNT)
: 0;
}
function retryEach() {
return process.env.PLAYWRIGHT_RETRIES_COUNT
? toNumber(process.env.PLAYWRIGHT_RETRIES_COUNT)
: 0;
}
function workersCount() {
return process.env.PLAYWRIGHT_WORKERS_COUNT
? toNumber(process.env.PLAYWRIGHT_WORKERS_COUNT)
: 1;
}
export default defineConfig({
timeout: 350000,
globalTimeout: 6000000,
reporter: [
[
process.stdout.isTTY && process.env.NO_TUI !== '1'
? './tuiReporter.ts'
: './sessionReporter.ts',
],
// ['allure-playwright'], // enabling starts generating reports to the allure-results folder
],
testDir: './tests/automation',
testIgnore: '*.js',
outputDir: './tests/automation/test-results',
retries: retryEach(),
repeatEach: repeatEach(),
reportSlowTests: null,
globalSetup: './global.setup', // clean leftovers of previous test runs on start, runs only once
snapshotPathTemplate: `${screenshotFolder}/{testName}/{arg}-{platform}{ext}`,
projects: [
/**
* The community tests relying on sending/receiving messages are unreliable when run in parallel.
* I think it comes down to the jump that happens when a new message is received, and also
* because receiving a new message closes an open context menu.
*/
{
name: 'Community tests',
// Those needs to be run sequentially as they are making each others unreliable
// (they all are using the same community)
testMatch: '**/*community*tests.spec.ts',
fullyParallel: false,
workers: 1, // those community tests need to be run sequentially
},
{
name: 'All other tests',
testMatch: '**/!(*community*tests).spec.ts',
fullyParallel: true, // set this to true so that tests in the same file are not run in parallel
workers: workersCount(),
},
],
});