-
Notifications
You must be signed in to change notification settings - Fork 0
/
wdio.app.config.js
92 lines (79 loc) · 2.54 KB
/
wdio.app.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
/**
* 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/calculator.feature',
],
reporters: ['allure','spec'],
reporterOptions: {
allure: {
outputDir: './allure-results/'
}
},
host: host,
port: port,
maxInstances: 1,
capabilities: [
{
appiumVersion: '1.8.1', // Appium module version
browserName: '', // browser name is empty for native apps
platformName: 'Android',
app: './app/LGCalculator.apk', // Path to your native app
appPackage: 'com.android.calculator2', // Package name of your app
appActivity: 'com.android.calculator2.Calculator', // App activity of the app
platformVersion: '7.1.1', // Android platform version of the device
deviceName: 'THF755e0384', // device name of the mobile device
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/calcSteps.ts'] // importing/requiring step definition files
},
/**
* hooks help us execute the repeatitive and common utilities
* of the project.
*/
onPrepare: function () {
console.log('<<< NATIVE APP TESTS STARTED >>>');
},
afterScenario: function (scenario) {
browser.screenshot();
},
onComplete: function () {
console.log('<<< TESTING FINISHED >>>');
}
};