-
Notifications
You must be signed in to change notification settings - Fork 8
/
wdio.conf.js
74 lines (68 loc) · 2.33 KB
/
wdio.conf.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
const { join } = require('path')
const allure = require('allure-commandline')
const video = require('wdio-video-reporter');
exports.config = {
hostname: 'localhost',
port: 4723,
path: '/wd/hub',
// user: "lojaebac_gBJk0x",
// key: "dQfHqx13fxpsVg1Ns1Yc",
services: ['appium'],
// services: ['browserstack'],
specs: [
'./test/specs/**/*.spec.js'
],
framework: 'mocha',
capabilities: [{
"platformName": "Android",
"platformVersion": "8.1",
"deviceName": "ebac-qe",
"automationName": "UiAutomator2",
"app": join(process.cwd(), './app/android/loja-ebac.apk'),
"appWaitActivity": 'com.woocommerce.android.ui.login.LoginActivity',
'newCommandTimeout': 240
// 'app' : 'bs://8450f0ceb7140a7d8772c1ccdfb9d6c496e9a702',
// 'device' : 'Samsung Galaxy Note 20',
// 'os_version' : '10.0',
// 'project' : 'Meu primeiro projeto em Device Farm',
// 'build' : '1',
// 'name': 'teste_login'
}],
waitforTimeout: 20000,
mochaOpts: {
timeout: 300000
},
reporters: ['spec',
['allure', {
outputDir: 'allure-results',
disableWebdriverStepsReporting: true,
disableWebdriverScreenshotsReporting: true,
}],
[video, {
saveAllVideos: true, // If true, also saves videos for successful test cases
videoSlowdownMultiplier: 50, // Higher to get slower videos, lower for faster videos [Value 1-100]
}]
],
onComplete: function () {
const reportError = new Error('Could not generate Allure report')
const generation = allure(['generate', 'allure-results', '--clean'])
return new Promise((resolve, reject) => {
const generationTimeout = setTimeout(
() => reject(reportError),
5000)
generation.on('exit', function (exitCode) {
clearTimeout(generationTimeout)
if (exitCode !== 0) {
return reject(reportError)
}
console.log('Allure report successfully generated')
resolve()
})
})
},
afterStep: function (test, scenario, { error, duration, passed }) {
if(error) {
driver.takeScreenshot()
}
}
}