forked from webdriverio/cucumber-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
wdio.BUILD.conf.ts
56 lines (51 loc) · 1.37 KB
/
wdio.BUILD.conf.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
import path from 'path';
import { config as buildConfig } from './wdio.conf';
buildConfig.capabilities = [{
browserName: 'chrome',
'goog:chromeOptions': {
args: [
'--disable-infobars',
'--window-size=1280,800',
'--headless',
'--no-sandbox',
'--disable-gpu',
'--disable-setuid-sandbox',
'--disable-dev-shm-usage',
],
},
}];
buildConfig.port = 9516;
buildConfig.services = [
[
'chromedriver',
{
chromeDriverArgs: ['--port=9516', '--url-base=\'/\''],
},
],
[
'static-server',
{
port: 8080,
folders: [
{ mount: '/', path: path.join(__dirname, 'demo-app') },
],
},
],
];
buildConfig.path = '/';
buildConfig.beforeFeature = async () => {
/**
* check if static website is up and cancel if not
*/
await (browser as WebdriverIO.Browser).url('/');
const pageTitle = await (browser as WebdriverIO.Browser).getTitle();
if (pageTitle !== 'DEMO APP') {
console.error(`Demo app is not up, found ${pageTitle}`);
console.log(await (browser as WebdriverIO.Browser).getPageSource());
process.exit(1);
}
};
if (process.env.CI) {
buildConfig.outputDir = path.join(__dirname, 'logs');
}
export const config = buildConfig;