-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathallTests.ts
98 lines (89 loc) · 2.71 KB
/
allTests.ts
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
/**
* @file Pack file (file with configuration of pack).
* Do not import anything (from `utils`, etc) into this file other than
* the types and values from `../configurator`, `e2ed/configurator`
* or other packs (because the pack is compiled separately from the tests themselves
* and has separate TypeScript scope).
*/
import {isLocalRun} from 'e2ed/configurator';
import {
doAfterPack,
doBeforePack,
fullMocks,
mapBackendResponseErrorToLog,
mapBackendResponseToLog,
mapLogPayloadInConsole,
mapLogPayloadInLogFile,
mapLogPayloadInReport,
skipTests,
} from '../configurator';
import type {FilterTestsIntoPack, Pack} from 'autotests/configurator';
const browserFlags = [
'--disable-dev-shm-usage',
'--disable-web-security',
'--ignore-certificate-errors',
];
const filterTestsIntoPack: FilterTestsIntoPack = ({options}) => options.meta.testId !== '13';
const userAgent =
'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36';
const msInMinute = 60_000;
const packTimeoutInMinutes = 5;
const waitBeforeRetryTimeout = 1_000;
/**
* Pack of tests or tasks (pack configuration object).
*/
export const pack: Pack = {
addLogsWithTags: [],
assertionTimeout: 5_000,
browserFlags,
browserName: 'chromium',
concurrency: isLocalRun ? 1 : 2,
customPackProperties: {internalPackRunId: 0, name: 'allTests'},
deviceScaleFactor: 1,
doAfterPack,
doBeforePack,
enableCsp: true,
enableHeadlessMode: true,
enableMobileDeviceMode: false,
enableTouchEventEmulation: false,
filterTestsIntoPack,
fullMocks,
getTestNamePrefixInUiMode: (testOptions) => testOptions.meta.testId,
liteReportFileName: 'lite-report.json',
logFileName: 'pack-logs.log',
mapBackendResponseErrorToLog,
mapBackendResponseToLog,
mapLogPayloadInConsole,
mapLogPayloadInLogFile,
mapLogPayloadInReport,
maxRetriesCountInDocker: 3,
navigationTimeout: 6_000,
overriddenConfigFields: null,
packTimeout: packTimeoutInMinutes * msInMinute,
pathToScreenshotsDirectoryForReport: './screenshots',
port1: 1337,
port2: 1338,
reportFileName: 'report.html',
resourceUsageReadingInternal: 5_000,
selectorTimeout: 10_000,
skipTests,
takeFullPageScreenshotOnError: false,
takeViewportScreenshotOnError: true,
testFileGlobs: ['**/autotests/tests/**/*.ts'],
testIdleTimeout: 8_000,
testTimeout: 15_000,
userAgent,
viewportHeight: 1080,
viewportWidth: 1920,
waitBeforeRetry: () => waitBeforeRetryTimeout,
waitForAllRequestsComplete: {
maxIntervalBetweenRequestsInMs: 500,
timeout: 15_000,
},
waitForInterfaceStabilization: {
stabilizationInterval: 500,
timeout: 15_000,
},
waitForRequestTimeout: 15_000,
waitForResponseTimeout: 15_000,
};