Skip to content

Commit c796a11

Browse files
tests: add mochawesome reporter
1 parent 65aeb13 commit c796a11

17 files changed

+100
-75
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,5 @@ webpack.config.js
1717
instruments*
1818
e2e/reports
1919
test-results.xml
20-
.DS_Store
20+
.DS_Store
21+
mochawesome-report

e2e/config/appium.capabilities.json

Lines changed: 32 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"avd": "Emulator-Api19-Default",
77
"lt": 60000,
88
"newCommandTimeout": 720,
9-
"noReset": true,
9+
"noReset": false,
1010
"fullReset": false,
1111
"app": ""
1212
},
@@ -17,7 +17,7 @@
1717
"avd": "Emulator-Api21-Default",
1818
"lt": 60000,
1919
"newCommandTimeout": 720,
20-
"noReset": true,
20+
"noReset": false,
2121
"fullReset": false,
2222
"app": ""
2323
},
@@ -28,7 +28,7 @@
2828
"avd": "Emulator-Api23-Default",
2929
"lt": 60000,
3030
"newCommandTimeout": 720,
31-
"noReset": true,
31+
"noReset": false,
3232
"fullReset": false,
3333
"app": ""
3434
},
@@ -39,7 +39,7 @@
3939
"avd": "Emulator-Api24-Default",
4040
"lt": 60000,
4141
"newCommandTimeout": 720,
42-
"noReset": true,
42+
"noReset": false,
4343
"fullReset": false,
4444
"app": ""
4545
},
@@ -50,7 +50,7 @@
5050
"avd": "Emulator-Api25-Google",
5151
"lt": 60000,
5252
"newCommandTimeout": 720,
53-
"noReset": true,
53+
"noReset": false,
5454
"fullReset": false,
5555
"app": ""
5656
},
@@ -61,7 +61,7 @@
6161
"avd": "Emulator-Api26-Google",
6262
"lt": 60000,
6363
"newCommandTimeout": 720,
64-
"noReset": true,
64+
"noReset": false,
6565
"fullReset": false,
6666
"app": ""
6767
},
@@ -72,40 +72,51 @@
7272
"avd": "Emulator-Api27-Google",
7373
"lt": 60000,
7474
"newCommandTimeout": 720,
75-
"noReset": true,
75+
"noReset": false,
7676
"fullReset": false,
7777
"app": ""
7878
},
79-
"sim.iPhone7.100": {
80-
"platformName": "iOS",
81-
"platformVersion": "10.0",
82-
"deviceName": "iPhone 7",
83-
"noReset": true,
79+
"android28": {
80+
"platformName": "Android",
81+
"platformVersion": "28",
82+
"deviceName": "Emulator-Api28-Google",
83+
"avd": "Emulator-Api28-Google",
84+
"lt": 60000,
85+
"newCommandTimeout": 720,
86+
"noReset": false,
8487
"fullReset": false,
8588
"app": ""
8689
},
87-
"sim.iPhone7.110": {
90+
"sim.iPhone7": {
8891
"platformName": "iOS",
89-
"platformVersion": "11.0",
90-
"deviceName": "iPhone 7 110",
91-
"noReset": true,
92+
"platformVersion": "/12.*/",
93+
"deviceName": "iPhone 7",
94+
"noReset": false,
9295
"fullReset": false,
9396
"app": ""
9497
},
9598
"sim.iPhone8": {
9699
"platformName": "iOS",
97-
"platformVersion": "11.3",
100+
"platformVersion": "/12*/",
98101
"deviceName": "iPhone 8",
99-
"noReset": true,
102+
"noReset": false,
100103
"fullReset": false,
101104
"app": ""
102105
},
103106
"sim.iPhoneX": {
104107
"platformName": "iOS",
105-
"platformVersion": "11.3",
108+
"platformVersion": "/12*/",
106109
"deviceName": "iPhone X",
107-
"noReset": true,
110+
"noReset": false,
111+
"fullReset": false,
112+
"app": ""
113+
},
114+
"sim.iPhoneXS": {
115+
"platformName": "ios",
116+
"platformVersion": "/12*/",
117+
"deviceName": "iPhone XS",
118+
"noReset": false,
108119
"fullReset": false,
109120
"app": ""
110121
}
111-
}
122+
}

e2e/config/mocha.opts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
--timeout 999999
22
--recursive e2e
3-
--reporter mocha-multi
4-
--reporter-options spec=-,mocha-junit-reporter=test-results.xml
3+
--reporter mochawesome
4+
--reporter-options quiet=true,html=true,inline=true,autoOpen=true
55
--exit

e2e/pages/animations-with-default-options-page.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export class AnimationsWithDefaultOptionsPage extends BasePage {
4545
async awaitItemToAppear(item: string, wait: number = 3000) {
4646
const startTime = Date.now();
4747
let btn = await this.getItem(item);
48-
while (!btn && !(await btn.isDisplayed()) && Date.now() - startTime <= wait) {
48+
while (!btn && !(btn && !(await btn.isDisplayed())) && Date.now() - startTime <= wait) {
4949
btn = await this.getItem(item);
5050
}
5151

e2e/pages/base-page.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,11 @@ export class BasePage {
1919

2020
async isBtnDisplayed(element: UIElement) {
2121
let btn: UIElement = await element;
22-
const isBtnDisplayed = btn ? await btn.isDisplayed() : false;
22+
let isBtnDisplayed = false
23+
try {
24+
isBtnDisplayed = btn ? await btn.isDisplayed() : false;
25+
} catch (error) { }
26+
2327
return isBtnDisplayed;
2428
}
2529
}
43.8 KB
Loading
49.6 KB
Loading
43.6 KB
Loading
23.6 KB
Loading
272 KB
Loading

0 commit comments

Comments
 (0)