-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
karma.conf.js
113 lines (104 loc) · 2.63 KB
/
karma.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
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
const config = {
browsers: [ "ChromeHeadless" ],
frameworks: [ "qunit" ],
files: [
{ pattern: "dist/test.js", watched: false },
{ pattern: "src/test_helpers/fixtures/*.png", watched: false, included: false, served: true }
],
proxies: {
"/test_helpers/fixtures/": "/base/src/test_helpers/fixtures/"
},
client: {
clearContext: false,
qunit: {
showUI: true
}
},
hostname: "0.0.0.0",
singleRun: true,
autoWatch: false,
concurrency: 4,
captureTimeout: 240000,
browserDisconnectTimeout: 240000,
browserDisconnectTolerance: 3,
browserNoActivityTimeout: 300000,
}
/* eslint camelcase: "off", */
if (process.env.SAUCE_ACCESS_KEY) {
config.customLaunchers = {
sl_chrome_latest: {
base: "SauceLabs",
browserName: "chrome",
version: "latest"
},
sl_chrome_latest_i8n: {
base: "SauceLabs",
browserName: "chrome",
version: "latest",
chromeOptions: {
args: [ "--lang=tr" ]
}
},
// Context:
// https://github.com/karma-runner/karma-sauce-launcher/issues/275
// https://saucelabs.com/blog/update-firefox-tests-before-oct-4-2022
sl_firefox_latest: {
base: "SauceLabs",
browserName: "firefox",
browserVersion: "latest",
"moz:debuggerAddress": true
},
sl_safari_12_1: {
base: "SauceLabs",
browserName: "safari",
platform: "macOS 10.13",
version: "12.1"
},
sl_edge_latest: {
base: "SauceLabs",
browserName: "microsoftedge",
platform: "Windows 10",
version: "latest"
},
sl_ios_latest: {
base: "SauceLabs",
browserName: "safari",
platform: "ios",
device: "iPhone X Simulator",
version: "13.0"
},
sl_android_9: {
base: "SauceLabs",
browserName: "chrome",
platform: "android",
device: "Android GoogleAPI Emulator",
version: "9.0"
},
sl_android_latest: {
base: "SauceLabs",
browserName: "chrome",
platform: "android",
device: "Android GoogleAPI Emulator",
version: "12.0"
}
}
config.browsers = Object.keys(config.customLaunchers)
config.reporters = [ "dots", "saucelabs" ]
config.sauceLabs = {
testName: "Trix",
retryLimit: 3,
idleTimeout: 600,
commandTimeout: 600,
maxDuration: 900,
build: buildId(),
}
}
function buildId() {
const { GITHUB_WORKFLOW, GITHUB_RUN_NUMBER, GITHUB_RUN_ID } = process.env
return GITHUB_WORKFLOW && GITHUB_RUN_NUMBER && GITHUB_RUN_ID
? `${GITHUB_WORKFLOW} #${GITHUB_RUN_NUMBER} (${GITHUB_RUN_ID})`
: ""
}
module.exports = function(karmaConfig) {
karmaConfig.set(config)
}