-
Notifications
You must be signed in to change notification settings - Fork 0
/
wdio.browser.config.js
95 lines (79 loc) · 2.19 KB
/
wdio.browser.config.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
/**
* WebdriverIO config file to run tests on native mobile apps.
* Config file helps us configure all the settings and setup environments
* to run our tests.
*/
const host = '127.0.0.1'; // default appium host
const port = 4730; // default appium port
const waitforTimeout = 30 * 60000;
const commandTimeout = 30 * 60000;
exports.config = {
debug: false,
specs: [
'./features/appium.feature',
],
reporters: ['allure','spec'],
reporterOptions: {
allure: {
outputDir: 'allure-results'
}
},
host: host,
port: port,
maxInstances: 1,
baseUrl: 'http://www.google.com',
capabilities: [
{
appiumVersion: '1.8.1',
browserName: 'chrome', // browser name should be specified
platformName: 'Android',
platformVersion: '7.1.1',
deviceName: 'A0001', // device name is mandatory
waitforTimeout: waitforTimeout,
commandTimeout: commandTimeout,
newCommandTimeout: 30 * 60000,
}
],
services: ['appium'],
appium: {
waitStartTime: 6000,
waitforTimeout: waitforTimeout,
command: 'appium',
logFileName: 'appium.log',
args: {
address: host,
port: port,
commandTimeout: commandTimeout,
sessionOverride: true,
debugLogSpacing: true
}
},
/**
* test configurations
*/
logLevel: 'silent',
coloredLogs: true,
framework: 'cucumber', // cucumber framework specified
cucumberOpts: {
compiler: ['ts:ts-node/register'],
backtrace: true,
failFast: false,
timeout: 5 * 60 * 60000,
require: ['./stepDefinitions/appiumSteps.ts'] // importing/requiring step definition files
},
/**
* hooks
*/
onPrepare: function () {
console.log('<<< BROWSER TESTS STARTED >>>');
},
before: function (capabilities, specs) {
browser.url(this.baseUrl);
},
afterScenario: function (scenario) {
browser.screenshot();
},
onComplete: function () {
console.log('<<< TESTING FINISHED >>>');
}
};