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
143
144
145
146
147
148
149
150
| // turn on headless mode when running with HEADLESS=true environment variable
| // HEADLESS=true npx codecept run
| const headless = process.env.HEADLESS;
| const port = process.env.LSF_PORT ?? 3000;
| const enableCoverage = process.env.COVERAGE === "true";
| const fs = require("fs");
| const FRAGMENTS_PATH = "./fragments/";
|
| module.exports.config = {
| timeout: 60 * 40, // Time out after 40 minutes
| tests: "./tests/**/*.test.js",
| output: "./output",
| helpers: {
| // Puppeteer: {
| // url: "http://localhost:3000",
| // show: !headless,
| // waitForAction: headless ? 100 : 1200,
| // windowSize: "1200x900",
| // },
| Playwright: {
| url: `http://localhost:${port}`,
| show: !headless,
| restart: "context",
| timeout: 30000,
| waitForAction: headless ? 0 : 500,
| windowSize: "1200x900",
| waitForNavigation: "domcontentloaded",
| waitForURL: "domcontentloaded",
| browser: "chromium",
| chromium: process.env.CHROMIUM_EXECUTABLE_PATH
| ? {
| executablePath: process.env.CHROMIUM_EXECUTABLE_PATH,
| args: ["--disable-dev-shm-usage", "--no-sandbox", "--disable-setuid-sandbox", "--disable-gpu"],
| }
| : {},
| // to test date shifts because of timezone. (see date-time.test.js)
| // Paris is in +1/+2 timezone, so date with midnight (00:00)
| // will be always in previous day in ISO
| timezoneId: "Europe/Paris",
| trace: false,
| keepTraceForPassedTests: false,
| },
| PlaywrightAddon: {
| require: "./helpers/PlaywrightAddon.js",
| },
| MouseActions: {
| require: "./helpers/MouseActions.js",
| },
| Selection: {
| require: "./helpers/Selection.js",
| },
| Annotations: {
| require: "./helpers/Annotations.ts",
| },
| Assertion: {
| require: "./helpers/Assertion.js",
| },
| },
| include: {
| I: "./steps_file.js",
| ...Object.fromEntries(
| fs.readdirSync(FRAGMENTS_PATH).map((path) => {
| const name = path.split(".")[0];
|
| return [name, `${FRAGMENTS_PATH}${path}`];
| }),
| ),
| },
| bootstrap: null,
| mocha: {
| bail: true,
| reporterOptions: {
| mochaFile: "output/result.xml",
| },
| },
| name: "label-studio-frontend",
| plugins: {
| retryFailedStep: {
| enabled: true,
| minTimeout: 100,
| defaultIgnoredSteps: [
| //'amOnPage',
| //'wait*',
| "send*",
| "execute*",
| "run*",
| "have*",
| ],
| },
| // coverage: {
| // enabled: enableCoverage,
| // coverageDir: 'output/coverage',
| // include: ["**/*.{js,jsx,ts,tsx}"],
| // exclude: ["**/*.d.ts", "**/node_modules/**", "**/examples/**"],
| // },
| disableDefaultInit: {
| require: "./plugins/disableDefaultInit.js",
| enabled: true,
| },
| featureFlags: {
| require: "./plugins/featureFlags.js",
| enabled: true,
| defaultFeatureFlags: require("./setup/feature-flags"),
| },
| istanbulCoverage: {
| require: "./plugins/istanbulСoverage.js",
| enabled: enableCoverage,
| uniqueFileName: true,
| coverageDir: "../coverage",
| include: ["**/*.{js,jsx,ts,tsx}"],
| exclude: ["**/*.d.ts", "**/node_modules/**", "**/examples/**"],
| actionCoverage: {
| enabled: false,
| include: ["**/src/**"],
| exclude: ["**/common/**", "**/components/**"],
| },
| },
| errorsCollector: {
| require: "./plugins/errorsCollector.js",
| enabled: true,
| uncaughtErrorFilter: {
| interrupt: true,
| ignore: [
| // @todo: solve the problems below
| /^TypeError: Cannot read properties of null \(reading 'getBoundingClientRect'\)/,
| /The play\(\) request was interrupted/,
| ],
| },
| consoleErrorFilter: {
| // @todo switch it on to feel the pain
| display: false,
| },
| },
| stepLogsModifier: {
| require: "./plugins/stepLogsModifier.js",
| enabled: true,
| modifyStepLogs: [
| {
| stepNameMatcher: "executeScript",
| rule: "hideFunction",
| },
| ],
| },
| screenshotOnFail: {
| enabled: true,
| },
| pauseOnFail: {},
| },
| require: ["ts-node/register"],
| };
|
|