-
Notifications
You must be signed in to change notification settings - Fork 7
/
test.conf.js
74 lines (63 loc) · 1.61 KB
/
test.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
let chai = require("chai");
const GRID_IP = process.env.GRID_IP;
const GRID_PORT = process.env.GRID_PORT;
const TESTING_URL = process.env.TESTING_URL;
exports.config = {
// Test Scripts
specs: [
"src/test-scripts/TC_001_LoginOK.js",
// "src/test-scripts/TC_002_Login_wrong_username.js",
// "src/test-scripts/TC_003_Login_wrong_password.js"
],
suites: {
api_learning: [
"src/api-learning/alertHandle.js",
"src/api-learning/click.js"
],
login_function: [
"src/test-scripts/TC_001_LoginOK.js",
"src/test-scripts/TC_002_Login_wrong_username.js",
"src/test-scripts/TC_003_Login_wrong_password.js"
]
},
maxInstances: 5,
capabilities: [
{
browserName: "chrome"
},
{
browserName: "firefox"
},
{
browserName: "MicrosoftEdge"
}
],
runner: 'local',
// Declare server info
hostname: GRID_IP,
port: parseInt(GRID_PORT, 10),
// path: '//',
baseUrl: TESTING_URL,
// Test Framework
framework: 'mocha',
mochaOpts: {
ui: 'bdd',
timeout: 600000
},
// Reporter config
reporters: [
['junit', {
outputDir: './reports'
}]
],
before: () => {
global.expect = chai.expect;
},
afterTest: (test) => {
// 1. I wanna save a PNG File when the test failed
if (test.passed === false) {
let fileName = test.fullTitle;
browser.saveScreenshot('./' + fileName + '.png')
}
},
}