-
-
Notifications
You must be signed in to change notification settings - Fork 317
/
wdio.BUILD.conf.ts
53 lines (47 loc) · 1.35 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
/* eslint-disable no-console */
import url from 'node:url';
import path from 'node:path';
import { config as buildConfig } from './wdio.conf.js';
const dirname = url.fileURLToPath(new URL('.', import.meta.url));
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.services = [
[
'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;