Skip to content

Commit 9af9fc6

Browse files
tomholubacladima
andauthored
issue #1052 #1073 added wdio-video-reporter for failed spec video recording + fixed tests (#1065)
* added wdio-video-reporter for failed spec video recording * debug for video-reporter * added fixes for createEmailButton, added scroll down for checking email subject, added fixes for video-reporter Co-authored-by: Dmitry Sotnikov <dmytro.s@accel-labs.com>
1 parent 4191cba commit 9af9fc6

7 files changed

Lines changed: 28 additions & 9 deletions

File tree

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,5 @@ appium/package-lock.json
4949
appium/tmp
5050
appium/.env
5151
appium/FlowCrypt.app
52+
appium/video
53+

.semaphore/semaphore.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ blocks:
4747
on_fail:
4848
commands:
4949
- artifact push job ~/Library/Logs/DiagnosticReports/FlowCrypt_*
50+
- artifact push job ~/git/flowcrypt-ios/appium/video/*.mp4
5051
- name: TypeScript + Swift tests
5152
dependencies: []
5253
run: # don't run if the only thing that changed is Appium test deps

appium/config/wdio.shared.conf.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
const { join } = require('path');
2+
const video = require('wdio-video-reporter');
23

34
exports.config = {
45

@@ -16,11 +17,13 @@ exports.config = {
1617
connectionRetryTimeout: 90000,
1718
connectionRetryCount: 3,
1819
maxInstancesPerCapability: 1,
19-
reporters: ['spec',
20-
['allure', {
21-
outputDir: './tmp',
22-
disableWebdriverStepsReporting: true,
23-
disableWebdriverScreenshotsReporting: false,
20+
reporters: [
21+
'spec',
22+
[video, {
23+
saveAllVideos: false, // If true, also saves videos for successful test cases
24+
videoSlowdownMultiplier: 3, // Higher to get slower videos, lower for faster videos [Value 1-100]
25+
videoRenderTimeout: 10, // Max seconds to wait for a video to finish rendering
26+
outputDir: './video',
2427
}]
2528
],
2629
services: [

appium/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
"request": "^2.88.2",
5151
"ts-node": "^10.4.0",
5252
"typescript": "^4.4.4",
53+
"wdio-video-reporter": "^3.1.3",
5354
"webdriverio": "7.16.4"
5455
}
5556
}

appium/tests/screenobjects/inbox.screen.ts

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import BaseScreen from './base.screen';
22
import ElementHelper from "../helpers/ElementHelper";
3+
import TouchHelper from "../helpers/TouchHelper";
34

45
const SELECTORS = {
56
ENTER_YOUR_PASS_PHRASE_FIELD: '-ios class chain:**/XCUIElementTypeSecureTextField[`value == "Enter your pass phrase"`]',
@@ -19,7 +20,7 @@ class InboxScreen extends BaseScreen {
1920
}
2021

2122
get inboxHeader() {
22-
return $(SELECTORS.INBOX_HEADER)
23+
return $(SELECTORS.INBOX_HEADER)
2324
}
2425

2526
clickOnUserEmail = async (email: string) => {
@@ -28,16 +29,27 @@ class InboxScreen extends BaseScreen {
2829
}
2930

3031
clickOnEmailBySubject = async (subject: string) => {
31-
await ElementHelper.waitAndClick(await $(`~${subject}`), 500);
32+
const selector = `~${subject}`;
33+
if (await (await $(selector)).isDisplayed() !== true) {
34+
await TouchHelper.scrollDown();
35+
}
36+
await ElementHelper.waitAndClick(await $(selector), 500);
3237
}
3338

3439
clickCreateEmail = async () => {
40+
if (await (await this.createEmailButton).isDisplayed() !== true ) {
41+
await TouchHelper.scrollDown();
42+
await (await this.createEmailButton).waitForDisplayed();
43+
}
3544
await ElementHelper.waitAndClick(await this.createEmailButton);
3645
}
3746

3847
checkInboxScreen = async () => {
3948
await (await this.inboxHeader).waitForDisplayed();
40-
await (await this.createEmailButton).waitForDisplayed();
49+
if (await (await this.createEmailButton).isDisplayed() !== true) {
50+
await TouchHelper.scrollDown();
51+
await (await this.createEmailButton).waitForDisplayed();
52+
}
4153
}
4254
}
4355

appium/tests/specs/composeEmail/SelectRecipientByName.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ describe('COMPOSE EMAIL: ', () => {
4141

4242
await MenuBarScreen.clickMenuIcon();
4343
await MenuBarScreen.clickInboxButton();
44+
await InboxScreen.checkInboxScreen();
4445

4546
// Add first contact
4647
await InboxScreen.clickCreateEmail();

appium/tests/specs/login/GmailLogin.spec.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ describe('LOGIN: ', () => {
2727

2828
await MenuBarScreen.clickLogout();
2929
await SplashScreen.checkLoginPage();
30-
3130
});
3231
});
3332
});

0 commit comments

Comments
 (0)