-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathweb-test-runner.bs.config.mjs
75 lines (69 loc) · 2.39 KB
/
web-test-runner.bs.config.mjs
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
import { browserstackLauncher } from '@web/test-runner-browserstack';
import { defaultReporter } from '@web/test-runner';
import { junitReporter } from '@web/test-runner-junit-reporter';
import localConfig from './web-test-runner.config.mjs';
// options shared between all browsers
const sharedCapabilities = {
// your username and key for browserstack, you can get this from your browserstack account
// it's recommended to store these as environment variables
'browserstack.user': process.env.BROWSERSTACK_USERNAME,
'browserstack.key': process.env.BROWSERSTACK_ACCESS_KEY,
project: 'JS SDK',
name: 'JS SDK - API Tests',
// if you are running tests in a CI, the build id might be available as an
// environment variable. this is useful for identifying test runs
// this is for example the name for github actions
build: `build ${process.env.CI_JOB_ID || 'unknown'}`,
};
export default {
...localConfig,
name: 'browserstack',
watch: false,
protocol: 'https:',
http2: true,
hostname: 'local.baqend.com',
sslKey: process.env.SSL_KEY ?? 'certs/local-key.pem',
sslCert: process.env.SSL_CERT ?? 'certs/local-cert.pem',
reporters: [
// use the default reporter only for reporting test progress
defaultReporter({ reportTestResults: false, reportTestProgress: true }),
// use another reporter to report test results
junitReporter({
outputPath: './browserstack-result.xml',
reportLogs: true, // default `false`
}),
],
concurrentBrowsers: 1,
// amount of test files to execute concurrently in a browser. the default value is based
// on amount of available CPUs locally which is irrelevant when testing remotely
concurrency: 1,
localOptions: {
forceLocal: true,
},
browsers: [
// create a browser launcher per browser you want to test
// you can get the browser capabilities from the browserstack website
browserstackLauncher({
capabilities: {
...sharedCapabilities,
browser: 'Chrome',
os: 'Windows',
},
}),
browserstackLauncher({
capabilities: {
...sharedCapabilities,
browser: 'Safari',
browser_version: '16',
os: 'OS X',
},
}),
browserstackLauncher({
capabilities: {
...sharedCapabilities,
browser: 'Firefox',
os: 'Windows',
},
}),
].filter(b => !process.env.BROWSER || b.name.startsWith(process.env.BROWSER)),
};