From 9cb804dc18da63b38786d88f6c49fd26860128da Mon Sep 17 00:00:00 2001 From: Dmitry Sotnikov Date: Mon, 25 Oct 2021 21:53:03 +0300 Subject: [PATCH 01/17] element helper update + fix for passphrase --- appium/tests/helpers/ElementHelper.ts | 11 ++++++++ .../tests/screenobjects/create-key.screen.ts | 22 ++++++++-------- appium/tests/screenobjects/email.screen.ts | 7 ++--- appium/tests/screenobjects/inbox.screen.ts | 7 ++--- appium/tests/screenobjects/keys.screen.ts | 5 ++-- appium/tests/screenobjects/menu-bar.screen.ts | 8 +++--- .../tests/screenobjects/new-message.screen.ts | 5 ++-- appium/tests/screenobjects/settings.screen.ts | 3 ++- appium/tests/screenobjects/splash.screen.ts | 26 ++++++++++--------- 9 files changed, 55 insertions(+), 39 deletions(-) diff --git a/appium/tests/helpers/ElementHelper.ts b/appium/tests/helpers/ElementHelper.ts index 405e4b478..be7b37c24 100644 --- a/appium/tests/helpers/ElementHelper.ts +++ b/appium/tests/helpers/ElementHelper.ts @@ -44,6 +44,17 @@ class ElementHelper { this.waitElementVisible(element); element.doubleClick(); } + + static waitAndClick(element) { + element.waitForDisplayed(); + element.click(); + } + + static clickAndType(element, text: string) { + element.waitForDisplayed(); + element.click(); + element.setValue(text); + } } export default ElementHelper; diff --git a/appium/tests/screenobjects/create-key.screen.ts b/appium/tests/screenobjects/create-key.screen.ts index baebc04ab..e903cb7d1 100644 --- a/appium/tests/screenobjects/create-key.screen.ts +++ b/appium/tests/screenobjects/create-key.screen.ts @@ -1,5 +1,6 @@ import BaseScreen from './base.screen'; import {CommonData} from '../data'; +import ElementHelper from "../helpers/ElementHelper"; const SELECTORS = { SET_PASS_PHRASE_BUTTON: '~Set pass phrase', @@ -29,24 +30,23 @@ class CreateKeyScreen extends BaseScreen { return $(SELECTORS.CONFIRM_PASS_PHRASE_FIELD) } + setPassPhrase(text: string = CommonData.account.passPhrase) { + this.fillPassPhrase(text); + this.clickSetPassPhraseBtn(); + this.confirmPassPhrase(text); + } + fillPassPhrase (passPhrase: string) { - this.enterPassPhraseField.setValue(passPhrase); + ElementHelper.clickAndType(this.enterPassPhraseField, passPhrase); } clickSetPassPhraseBtn () { - this.setPassPhraseButton.click(); + ElementHelper.waitAndClick(this.setPassPhraseButton); } confirmPassPhrase (passPhrase: string) { - this.confirmPassPhraseField.click(); - this.confirmPassPhraseField.setValue(passPhrase); - this.okButton.click(); - } - - setPassPhrase(text: string = CommonData.account.passPhrase) { - this.fillPassPhrase(text); - this.clickSetPassPhraseBtn(); - this.confirmPassPhrase(text); + ElementHelper.clickAndType(this.confirmPassPhraseField, passPhrase); + ElementHelper.waitAndClick(this.okButton); } } diff --git a/appium/tests/screenobjects/email.screen.ts b/appium/tests/screenobjects/email.screen.ts index 9f89b2457..a2382351f 100644 --- a/appium/tests/screenobjects/email.screen.ts +++ b/appium/tests/screenobjects/email.screen.ts @@ -1,5 +1,6 @@ import BaseScreen from './base.screen'; import {CommonData} from "../data"; +import ElementHelper from "../helpers/ElementHelper"; const SELECTORS = { BACK_BTN: '~arrow left c', @@ -59,11 +60,11 @@ class EmailScreen extends BaseScreen { } clickBackButton () { - this.backButton.click(); + ElementHelper.waitAndClick(this.backButton); } clickOkButton() { - this.okButton.click(); + ElementHelper.waitAndClick(this.okButton); } enterPassPhrase (text: string = CommonData.account.passPhrase) { @@ -75,7 +76,7 @@ class EmailScreen extends BaseScreen { } clickSaveButton() { - this.saveButton.click(); + ElementHelper.waitAndClick(this.saveButton); } } diff --git a/appium/tests/screenobjects/inbox.screen.ts b/appium/tests/screenobjects/inbox.screen.ts index 81e17cb89..256bad424 100644 --- a/appium/tests/screenobjects/inbox.screen.ts +++ b/appium/tests/screenobjects/inbox.screen.ts @@ -1,4 +1,5 @@ import BaseScreen from './base.screen'; +import ElementHelper from "../helpers/ElementHelper"; const SELECTORS = { ENTER_YOUR_PASS_PHRASE_FIELD: '-ios class chain:**/XCUIElementTypeSecureTextField[`value == "Enter your pass phrase"`]', @@ -24,13 +25,13 @@ class InboxScreen extends BaseScreen { clickOnEmailBySubject (subject) { this.createEmailButton.waitForDisplayed(); + browser.pause(500); // stability fix const selector = `~${subject}`; - $(selector).waitForDisplayed(); - $(selector).click(); + ElementHelper.waitAndClick($(selector)); } clickCreateEmail () { - this.createEmailButton.click(); + ElementHelper.waitAndClick(this.createEmailButton); } } diff --git a/appium/tests/screenobjects/keys.screen.ts b/appium/tests/screenobjects/keys.screen.ts index 58439e4d1..fb2c9ce35 100644 --- a/appium/tests/screenobjects/keys.screen.ts +++ b/appium/tests/screenobjects/keys.screen.ts @@ -1,4 +1,5 @@ import BaseScreen from './base.screen'; +import ElementHelper from "../helpers/ElementHelper"; const SELECTORS = { KEYS_HEADER: '-ios class chain:**/XCUIElementTypeStaticText[`label == "Keys"`]', @@ -71,7 +72,7 @@ class KeysScreen extends BaseScreen { } clickOnKey() { - this.nameAndEmail.click(); + ElementHelper.waitAndClick(this.nameAndEmail); } checkSelectedKeyScreen() { @@ -83,7 +84,7 @@ class KeysScreen extends BaseScreen { } clickOnShowPublicKey() { - this.showPublicKeyButton.click(); + ElementHelper.waitAndClick(this.showPublicKeyButton); } } diff --git a/appium/tests/screenobjects/menu-bar.screen.ts b/appium/tests/screenobjects/menu-bar.screen.ts index b4fcc9786..6e53c6f57 100644 --- a/appium/tests/screenobjects/menu-bar.screen.ts +++ b/appium/tests/screenobjects/menu-bar.screen.ts @@ -1,5 +1,6 @@ import BaseScreen from './base.screen'; import {CommonData} from "../data"; +import ElementHelper from "../helpers/ElementHelper"; const SELECTORS = { MENU_ICON: '~menu icn', @@ -25,8 +26,7 @@ class MenuBarScreen extends BaseScreen { } clickMenuIcon () { - this.menuIcon.waitForDisplayed(); - this.menuIcon.click(); + ElementHelper.waitAndClick(this.menuIcon); } checkUserEmail (email: string = CommonData.account.email) { @@ -40,11 +40,11 @@ class MenuBarScreen extends BaseScreen { } clickLogout () { - this.logoutButton.click(); + ElementHelper.waitAndClick(this.logoutButton); } clickSettingsButton () { - this.settingsButton.click(); + ElementHelper.waitAndClick(this.settingsButton); } } diff --git a/appium/tests/screenobjects/new-message.screen.ts b/appium/tests/screenobjects/new-message.screen.ts index 9cde18d37..040d99ec6 100644 --- a/appium/tests/screenobjects/new-message.screen.ts +++ b/appium/tests/screenobjects/new-message.screen.ts @@ -1,4 +1,5 @@ import BaseScreen from './base.screen'; +import ElementHelper from "../helpers/ElementHelper"; const SELECTORS = { ADD_RECIPIENT_FIELD: '-ios class chain:**/XCUIElementTypeTextField[`value == "Add Recipient"`]', @@ -32,8 +33,7 @@ class NewMessageScreen extends BaseScreen { } setSubject(subject) { - this.subjectField.click(); - this.subjectField.setValue(subject); + ElementHelper.clickAndType(this.subjectField, subject); } setComposeSecurityMessage(message) { @@ -55,7 +55,6 @@ class NewMessageScreen extends BaseScreen { expect(this.composeSecurityMesage).toHaveText(message); this.filledSubject(subject).waitForDisplayed(); expect(this.addedRecipientEmail).toHaveAttribute('value', ` ${recipient} `); - } } diff --git a/appium/tests/screenobjects/settings.screen.ts b/appium/tests/screenobjects/settings.screen.ts index dcc1c6b96..82823c5e4 100644 --- a/appium/tests/screenobjects/settings.screen.ts +++ b/appium/tests/screenobjects/settings.screen.ts @@ -1,4 +1,5 @@ import BaseScreen from './base.screen'; +import ElementHelper from "../helpers/ElementHelper"; const SELECTORS = { MENU_ICON: '~menu icn', }; @@ -24,7 +25,7 @@ class SettingsScreen extends BaseScreen { } clickOnSettingItem(item) { - this.settingsItem(item).click(); + ElementHelper.waitAndClick(this.settingsItem(item)); } } diff --git a/appium/tests/screenobjects/splash.screen.ts b/appium/tests/screenobjects/splash.screen.ts index 999065e98..def61fb23 100644 --- a/appium/tests/screenobjects/splash.screen.ts +++ b/appium/tests/screenobjects/splash.screen.ts @@ -1,5 +1,6 @@ import BaseScreen from './base.screen'; import {CommonData} from "../data"; +import ElementHelper from "../helpers/ElementHelper"; const SELECTORS = { PRIVACY_TAB: '~privacy', @@ -89,7 +90,7 @@ class SplashScreen extends BaseScreen { } clickContinueWithGmail () { - this.continueWithGmailBtn.click(); + ElementHelper.waitAndClick(this.continueWithGmailBtn); } clickContinueBtn () { @@ -103,26 +104,27 @@ class SplashScreen extends BaseScreen { browser.pause(500); // stability sleep this.languageDropdown.click(); const selector = `~${language}`; - $(selector).waitForDisplayed(); - $(selector).click(); + ElementHelper.waitAndClick($(selector)); } fillEmail (email: string) { - this.loginField.click(); - this.loginField.setValue(email); - this.doneButton.click(); + ElementHelper.clickAndType(this.loginField, email); + this.clickDoneBtn(); + browser.pause(500); // stability sleep + } + + fillPassword(password: string) { + ElementHelper.clickAndType(this.passwordField, password); + this.clickDoneBtn(); browser.pause(500); // stability sleep } clickNextBtn () { - this.nextButton.click(); + ElementHelper.waitAndClick(this.nextButton); } - fillPassword(password: string) { - this.passwordField.click(); - this.passwordField.setValue(password); - this.doneButton.click(); - browser.pause(500); // stability sleep + clickDoneBtn () { + ElementHelper.waitAndClick(this.doneButton); } gmailLogin (email: string, password: string) { From fb9a99de7365c829d7350af376ea5ef8b06650cc Mon Sep 17 00:00:00 2001 From: Dmitry Sotnikov Date: Tue, 26 Oct 2021 14:08:56 +0300 Subject: [PATCH 02/17] check small sleep for passphrase --- appium/tests/screenobjects/create-key.screen.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/appium/tests/screenobjects/create-key.screen.ts b/appium/tests/screenobjects/create-key.screen.ts index e903cb7d1..7980faabb 100644 --- a/appium/tests/screenobjects/create-key.screen.ts +++ b/appium/tests/screenobjects/create-key.screen.ts @@ -37,6 +37,7 @@ class CreateKeyScreen extends BaseScreen { } fillPassPhrase (passPhrase: string) { + browser.pause(1000); ElementHelper.clickAndType(this.enterPassPhraseField, passPhrase); } From 6673e363f045f1782a08e36601efde302311799e Mon Sep 17 00:00:00 2001 From: Dmitry Sotnikov Date: Wed, 27 Oct 2021 14:09:02 +0300 Subject: [PATCH 03/17] fix for 769 --- appium/tests/screenobjects/create-key.screen.ts | 2 +- appium/tests/screenobjects/menu-bar.screen.ts | 1 + appium/tests/screenobjects/new-message.screen.ts | 5 ++++- .../specs/inbox/CheckEncryptedEmailAfterRestartApp.spec.ts | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/appium/tests/screenobjects/create-key.screen.ts b/appium/tests/screenobjects/create-key.screen.ts index 7980faabb..aa5a0c6ea 100644 --- a/appium/tests/screenobjects/create-key.screen.ts +++ b/appium/tests/screenobjects/create-key.screen.ts @@ -37,7 +37,7 @@ class CreateKeyScreen extends BaseScreen { } fillPassPhrase (passPhrase: string) { - browser.pause(1000); + browser.pause(3000);//just for test ElementHelper.clickAndType(this.enterPassPhraseField, passPhrase); } diff --git a/appium/tests/screenobjects/menu-bar.screen.ts b/appium/tests/screenobjects/menu-bar.screen.ts index 6e53c6f57..3c3c5ac5d 100644 --- a/appium/tests/screenobjects/menu-bar.screen.ts +++ b/appium/tests/screenobjects/menu-bar.screen.ts @@ -26,6 +26,7 @@ class MenuBarScreen extends BaseScreen { } clickMenuIcon () { + browser.pause(1000);//just for test ElementHelper.waitAndClick(this.menuIcon); } diff --git a/appium/tests/screenobjects/new-message.screen.ts b/appium/tests/screenobjects/new-message.screen.ts index 040d99ec6..e3405156d 100644 --- a/appium/tests/screenobjects/new-message.screen.ts +++ b/appium/tests/screenobjects/new-message.screen.ts @@ -8,7 +8,8 @@ const SELECTORS = { ADDED_RECIPIENT: '-ios class chain:**/XCUIElementTypeWindow[1]/XCUIElementTypeOther/XCUIElementTypeOther' + '/XCUIElementTypeOther/XCUIElementTypeOther[1]/XCUIElementTypeOther/XCUIElementTypeTable' + '/XCUIElementTypeCell[1]/XCUIElementTypeOther/XCUIElementTypeCollectionView/XCUIElementTypeCell' + - '/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeStaticText' //it works only with this selector + '/XCUIElementTypeOther/XCUIElementTypeOther/XCUIElementTypeStaticText',//it works only with this selector + RETURN_BUTTON: '~Return' }; class NewMessageScreen extends BaseScreen { @@ -30,6 +31,8 @@ class NewMessageScreen extends BaseScreen { setAddRecipient(recipient) { this.addRecipientField.setValue(recipient); + browser.pause(1000); + $(SELECTORS.RETURN_BUTTON).click() } setSubject(subject) { diff --git a/appium/tests/specs/inbox/CheckEncryptedEmailAfterRestartApp.spec.ts b/appium/tests/specs/inbox/CheckEncryptedEmailAfterRestartApp.spec.ts index 45b14aa99..5e1aab0b0 100644 --- a/appium/tests/specs/inbox/CheckEncryptedEmailAfterRestartApp.spec.ts +++ b/appium/tests/specs/inbox/CheckEncryptedEmailAfterRestartApp.spec.ts @@ -12,7 +12,7 @@ describe('INBOX: ', () => { it('user is able to see encrypted email with pass phrase after restart app', () => { const senderEmail = CommonData.sender.email; - const emailSubject = 'encrypted message'; + const emailSubject = 'encrypted email'; const emailText = 'test test'; const wrongPassPhrase = 'user is not able to see email'; From 99e7c7e5316b2a17bb660f297cf66ffeb18537de Mon Sep 17 00:00:00 2001 From: Dmitry Sotnikov Date: Wed, 27 Oct 2021 15:47:02 +0300 Subject: [PATCH 04/17] removed sleeps --- appium/tests/screenobjects/create-key.screen.ts | 1 - appium/tests/screenobjects/menu-bar.screen.ts | 1 - 2 files changed, 2 deletions(-) diff --git a/appium/tests/screenobjects/create-key.screen.ts b/appium/tests/screenobjects/create-key.screen.ts index aa5a0c6ea..e903cb7d1 100644 --- a/appium/tests/screenobjects/create-key.screen.ts +++ b/appium/tests/screenobjects/create-key.screen.ts @@ -37,7 +37,6 @@ class CreateKeyScreen extends BaseScreen { } fillPassPhrase (passPhrase: string) { - browser.pause(3000);//just for test ElementHelper.clickAndType(this.enterPassPhraseField, passPhrase); } diff --git a/appium/tests/screenobjects/menu-bar.screen.ts b/appium/tests/screenobjects/menu-bar.screen.ts index 3c3c5ac5d..6e53c6f57 100644 --- a/appium/tests/screenobjects/menu-bar.screen.ts +++ b/appium/tests/screenobjects/menu-bar.screen.ts @@ -26,7 +26,6 @@ class MenuBarScreen extends BaseScreen { } clickMenuIcon () { - browser.pause(1000);//just for test ElementHelper.waitAndClick(this.menuIcon); } From 69529984668d5bc3864221bfe0f94fe385a6dd29 Mon Sep 17 00:00:00 2001 From: fcvakintos Date: Thu, 28 Oct 2021 06:35:10 +0000 Subject: [PATCH 05/17] push tmp always --- .semaphore/semaphore.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.semaphore/semaphore.yml b/.semaphore/semaphore.yml index 1b2ff0bef..572172d4f 100644 --- a/.semaphore/semaphore.yml +++ b/.semaphore/semaphore.yml @@ -59,7 +59,9 @@ blocks: - bundle exec fastlane build - ls -la appium && cd appium && npm run-script only.test.all epilogue: - on_fail: + always: commands: - artifact push job ~/git/flowcrypt-ios/appium/tmp + on_fail: + commands: - artifact push job ~/git/flowcrypt-ios/appium/FlowCrypt.app From b5223650fff12dac8de705f868b9eb19e7de3321 Mon Sep 17 00:00:00 2001 From: Dmitry Sotnikov Date: Thu, 28 Oct 2021 10:59:09 +0300 Subject: [PATCH 06/17] added fix for first time login --- appium/tests/screenobjects/splash.screen.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/appium/tests/screenobjects/splash.screen.ts b/appium/tests/screenobjects/splash.screen.ts index def61fb23..e1f56ba4c 100644 --- a/appium/tests/screenobjects/splash.screen.ts +++ b/appium/tests/screenobjects/splash.screen.ts @@ -16,7 +16,8 @@ const SELECTORS = { PASSWORD_FIELD: '~Enter your password', DONE_BTN: '~Done', LANGUAGE_DROPDOWN: '-ios class chain:**/XCUIElementTypeOther[`label == "content information"`]/XCUIElementTypeOther[1]', - SIGN_IN_WITH_GMAIL: '-ios class chain:**/XCUIElementTypeOther[`label == "Sign in - Google Accounts"`]' + SIGN_IN_WITH_GMAIL: '-ios class chain:**/XCUIElementTypeOther[`label == "Sign in - Google Accounts"`]', + SKIP_FAST_FINGER_PRINT_BUTTON: '-ios class chain:**/XCUIElementTypeStaticText[`label == "Continue"`]' }; class SplashScreen extends BaseScreen { @@ -138,6 +139,7 @@ class SplashScreen extends BaseScreen { this.clickNextBtn(); this.fillPassword(password); this.clickNextBtn(); + ElementHelper.waitAndClick($(SELECTORS.SKIP_FAST_FINGER_PRINT_BUTTON)); } } From 2d7ee0d7ae6de126b389fb653aa0993c1baf560d Mon Sep 17 00:00:00 2001 From: Dmitry Sotnikov Date: Thu, 28 Oct 2021 11:38:29 +0300 Subject: [PATCH 07/17] remove click continue --- appium/config/wdio.ios.app.conf.js | 2 +- appium/tests/screenobjects/splash.screen.ts | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/appium/config/wdio.ios.app.conf.js b/appium/config/wdio.ios.app.conf.js index 82da5eedd..e74dc2301 100644 --- a/appium/config/wdio.ios.app.conf.js +++ b/appium/config/wdio.ios.app.conf.js @@ -27,7 +27,7 @@ config.capabilities = [ automationName: 'XCUITest', app: join(process.cwd(), './FlowCrypt.app'), newCommandTimeout: 10000, - wdaLaunchTimeout: 300000, + wdaLaunchTimeout: 600000, wdaConnectionTimeout: 600000, wdaStartupRetries: 4, wdaStartupRetryInterval: 120000, diff --git a/appium/tests/screenobjects/splash.screen.ts b/appium/tests/screenobjects/splash.screen.ts index e1f56ba4c..def61fb23 100644 --- a/appium/tests/screenobjects/splash.screen.ts +++ b/appium/tests/screenobjects/splash.screen.ts @@ -16,8 +16,7 @@ const SELECTORS = { PASSWORD_FIELD: '~Enter your password', DONE_BTN: '~Done', LANGUAGE_DROPDOWN: '-ios class chain:**/XCUIElementTypeOther[`label == "content information"`]/XCUIElementTypeOther[1]', - SIGN_IN_WITH_GMAIL: '-ios class chain:**/XCUIElementTypeOther[`label == "Sign in - Google Accounts"`]', - SKIP_FAST_FINGER_PRINT_BUTTON: '-ios class chain:**/XCUIElementTypeStaticText[`label == "Continue"`]' + SIGN_IN_WITH_GMAIL: '-ios class chain:**/XCUIElementTypeOther[`label == "Sign in - Google Accounts"`]' }; class SplashScreen extends BaseScreen { @@ -139,7 +138,6 @@ class SplashScreen extends BaseScreen { this.clickNextBtn(); this.fillPassword(password); this.clickNextBtn(); - ElementHelper.waitAndClick($(SELECTORS.SKIP_FAST_FINGER_PRINT_BUTTON)); } } From d32407b521e20044b99f1b4084acc33c23d46df0 Mon Sep 17 00:00:00 2001 From: Dmitry Sotnikov Date: Thu, 28 Oct 2021 12:28:15 +0300 Subject: [PATCH 08/17] push page source --- appium/config/wdio.ios.app.conf.js | 2 +- appium/tests/helpers/ElementHelper.ts | 3 +-- appium/tests/screenobjects/create-key.screen.ts | 2 ++ 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/appium/config/wdio.ios.app.conf.js b/appium/config/wdio.ios.app.conf.js index e74dc2301..d40f0362d 100644 --- a/appium/config/wdio.ios.app.conf.js +++ b/appium/config/wdio.ios.app.conf.js @@ -5,7 +5,7 @@ require('dotenv').config({ path: pathWdioConfig.resolve(__dirname, '../.env') }) config.suites = { all: [ - './tests/specs/**/*.spec.ts' + './tests/specs/composeEmail/CheckComposeEmailAfterReopening.spec.ts' ], smoke: [ './tests/specs/login/GmailLogin.spec.ts' diff --git a/appium/tests/helpers/ElementHelper.ts b/appium/tests/helpers/ElementHelper.ts index be7b37c24..e11b8d0ba 100644 --- a/appium/tests/helpers/ElementHelper.ts +++ b/appium/tests/helpers/ElementHelper.ts @@ -51,8 +51,7 @@ class ElementHelper { } static clickAndType(element, text: string) { - element.waitForDisplayed(); - element.click(); + this.waitAndClick(element) element.setValue(text); } } diff --git a/appium/tests/screenobjects/create-key.screen.ts b/appium/tests/screenobjects/create-key.screen.ts index e903cb7d1..971dce02d 100644 --- a/appium/tests/screenobjects/create-key.screen.ts +++ b/appium/tests/screenobjects/create-key.screen.ts @@ -31,6 +31,8 @@ class CreateKeyScreen extends BaseScreen { } setPassPhrase(text: string = CommonData.account.passPhrase) { + browser.pause(5000); + console.log(driver.getPageSource()); this.fillPassPhrase(text); this.clickSetPassPhraseBtn(); this.confirmPassPhrase(text); From a076dbf5ba323a895f46ea9a885f769f3e997cad Mon Sep 17 00:00:00 2001 From: Dmitry Sotnikov Date: Thu, 28 Oct 2021 13:50:10 +0300 Subject: [PATCH 09/17] remove retry --- appium/config/wdio.shared.conf.js | 2 +- appium/tests/screenobjects/create-key.screen.ts | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/appium/config/wdio.shared.conf.js b/appium/config/wdio.shared.conf.js index 824d2fea4..1029280b2 100644 --- a/appium/config/wdio.shared.conf.js +++ b/appium/config/wdio.shared.conf.js @@ -31,7 +31,7 @@ exports.config = { ], port: 4723, path: '/wd/hub', - specFileRetries: 1, + specFileRetries: 0, specFileRetriesDeferred: false, afterTest: function (test, context, { error, result, duration, passed, retries }) { diff --git a/appium/tests/screenobjects/create-key.screen.ts b/appium/tests/screenobjects/create-key.screen.ts index 971dce02d..8e1847082 100644 --- a/appium/tests/screenobjects/create-key.screen.ts +++ b/appium/tests/screenobjects/create-key.screen.ts @@ -31,9 +31,11 @@ class CreateKeyScreen extends BaseScreen { } setPassPhrase(text: string = CommonData.account.passPhrase) { - browser.pause(5000); - console.log(driver.getPageSource()); - this.fillPassPhrase(text); + try { + this.fillPassPhrase(text); + } catch { + console.log(driver.getPageSource()); + } this.clickSetPassPhraseBtn(); this.confirmPassPhrase(text); } From 24e6313b89de0e2840b123707aabdbc051947c34 Mon Sep 17 00:00:00 2001 From: Dmitry Sotnikov Date: Thu, 28 Oct 2021 14:23:17 +0300 Subject: [PATCH 10/17] timeout increased --- appium/config/wdio.shared.conf.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appium/config/wdio.shared.conf.js b/appium/config/wdio.shared.conf.js index 1029280b2..03fd5e177 100644 --- a/appium/config/wdio.shared.conf.js +++ b/appium/config/wdio.shared.conf.js @@ -5,7 +5,7 @@ exports.config = { runner: 'local', framework: 'jasmine', jasmineNodeOpts: { - defaultTimeoutInterval: 180000, + defaultTimeoutInterval: 600000, requires: ['ts-node/register', 'tsconfig-paths/register'] }, sync: true, From b06c29d2ef7f72bdc772dc486226a4de86efbdca Mon Sep 17 00:00:00 2001 From: fcvakintos Date: Thu, 28 Oct 2021 12:26:05 +0000 Subject: [PATCH 11/17] add npm logs to artifacts --- .semaphore/semaphore.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.semaphore/semaphore.yml b/.semaphore/semaphore.yml index 572172d4f..2c4d94478 100644 --- a/.semaphore/semaphore.yml +++ b/.semaphore/semaphore.yml @@ -64,4 +64,5 @@ blocks: - artifact push job ~/git/flowcrypt-ios/appium/tmp on_fail: commands: + - /Users/semaphore/.npm/_logs - artifact push job ~/git/flowcrypt-ios/appium/FlowCrypt.app From 6a04c02f1ac74ec5e1ed3c2eb53401717a3a9461 Mon Sep 17 00:00:00 2001 From: Dmitry Sotnikov Date: Thu, 28 Oct 2021 16:02:57 +0300 Subject: [PATCH 12/17] remove resetOnSessionStartOnly --- appium/config/wdio.ios.app.conf.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/appium/config/wdio.ios.app.conf.js b/appium/config/wdio.ios.app.conf.js index d40f0362d..a82217390 100644 --- a/appium/config/wdio.ios.app.conf.js +++ b/appium/config/wdio.ios.app.conf.js @@ -27,11 +27,10 @@ config.capabilities = [ automationName: 'XCUITest', app: join(process.cwd(), './FlowCrypt.app'), newCommandTimeout: 10000, - wdaLaunchTimeout: 600000, + wdaLaunchTimeout: 300000, wdaConnectionTimeout: 600000, wdaStartupRetries: 4, - wdaStartupRetryInterval: 120000, - resetOnSessionStartOnly: true + wdaStartupRetryInterval: 120000 }, ]; From 5b4c07b8464d81ee8132aee8e72122196b0274fa Mon Sep 17 00:00:00 2001 From: fcvakintos Date: Thu, 28 Oct 2021 13:09:14 +0000 Subject: [PATCH 13/17] put logs --- .semaphore/semaphore.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.semaphore/semaphore.yml b/.semaphore/semaphore.yml index 2c4d94478..e533260da 100644 --- a/.semaphore/semaphore.yml +++ b/.semaphore/semaphore.yml @@ -64,5 +64,5 @@ blocks: - artifact push job ~/git/flowcrypt-ios/appium/tmp on_fail: commands: - - /Users/semaphore/.npm/_logs + - /Users/semaphore/.npm/_logs/*-debug.log - artifact push job ~/git/flowcrypt-ios/appium/FlowCrypt.app From e931f3996df33f4077924ad894830e57bb61398b Mon Sep 17 00:00:00 2001 From: fcvakintos Date: Thu, 28 Oct 2021 13:15:02 +0000 Subject: [PATCH 14/17] start simulator before tests --- .semaphore/semaphore.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.semaphore/semaphore.yml b/.semaphore/semaphore.yml index e533260da..6b0fa752f 100644 --- a/.semaphore/semaphore.yml +++ b/.semaphore/semaphore.yml @@ -56,6 +56,10 @@ blocks: commands: - mv ~/appium-env ~/git/flowcrypt-ios/appium/.env - cache restore appium-npm && cd ./appium && npm i && cd .. && cache store appium-npm appium/node_modules + - brew install ideviceinstaller + - npm install -g ios-deploy --unsafe-perm=true --allow-root + - npm install ios-sim -g --unsafe-perm=true --allow-root + - ios-sim start --devicetypeid com.apple.CoreSimulator.SimDeviceType.iPhone-13 - bundle exec fastlane build - ls -la appium && cd appium && npm run-script only.test.all epilogue: From f43b7ddd86d6c1c5a3c22ad56ca0ce5600d803aa Mon Sep 17 00:00:00 2001 From: Dmitry Sotnikov Date: Thu, 28 Oct 2021 16:53:32 +0300 Subject: [PATCH 15/17] add sleep for test, remove launch app --- .semaphore/semaphore.yml | 4 ---- appium/tests/screenobjects/splash.screen.ts | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/.semaphore/semaphore.yml b/.semaphore/semaphore.yml index 6b0fa752f..574293470 100644 --- a/.semaphore/semaphore.yml +++ b/.semaphore/semaphore.yml @@ -66,7 +66,3 @@ blocks: always: commands: - artifact push job ~/git/flowcrypt-ios/appium/tmp - on_fail: - commands: - - /Users/semaphore/.npm/_logs/*-debug.log - - artifact push job ~/git/flowcrypt-ios/appium/FlowCrypt.app diff --git a/appium/tests/screenobjects/splash.screen.ts b/appium/tests/screenobjects/splash.screen.ts index def61fb23..c1aef9040 100644 --- a/appium/tests/screenobjects/splash.screen.ts +++ b/appium/tests/screenobjects/splash.screen.ts @@ -142,11 +142,11 @@ class SplashScreen extends BaseScreen { } login(email: string = CommonData.account.email, password: string = CommonData.account.password) { - driver.launchApp(); this.clickContinueWithGmail(); this.clickContinueBtn(); this.changeLanguage(); this.gmailLogin(email, password); + browser.pause(10000); // just to test } } From 6fac4bc594332f3646230660d24e470f5de32e1d Mon Sep 17 00:00:00 2001 From: Dmitry Sotnikov Date: Thu, 28 Oct 2021 18:41:54 +0300 Subject: [PATCH 16/17] enable all tests --- appium/config/wdio.ios.app.conf.js | 2 +- appium/config/wdio.shared.conf.js | 2 +- appium/tests/screenobjects/create-key.screen.ts | 6 +----- appium/tests/screenobjects/splash.screen.ts | 2 +- 4 files changed, 4 insertions(+), 8 deletions(-) diff --git a/appium/config/wdio.ios.app.conf.js b/appium/config/wdio.ios.app.conf.js index a82217390..846e0493d 100644 --- a/appium/config/wdio.ios.app.conf.js +++ b/appium/config/wdio.ios.app.conf.js @@ -5,7 +5,7 @@ require('dotenv').config({ path: pathWdioConfig.resolve(__dirname, '../.env') }) config.suites = { all: [ - './tests/specs/composeEmail/CheckComposeEmailAfterReopening.spec.ts' + './tests/specs/**/*.spec.ts' ], smoke: [ './tests/specs/login/GmailLogin.spec.ts' diff --git a/appium/config/wdio.shared.conf.js b/appium/config/wdio.shared.conf.js index 03fd5e177..644cf1408 100644 --- a/appium/config/wdio.shared.conf.js +++ b/appium/config/wdio.shared.conf.js @@ -31,7 +31,7 @@ exports.config = { ], port: 4723, path: '/wd/hub', - specFileRetries: 0, + specFileRetries: 1, specFileRetriesDeferred: false, afterTest: function (test, context, { error, result, duration, passed, retries }) { diff --git a/appium/tests/screenobjects/create-key.screen.ts b/appium/tests/screenobjects/create-key.screen.ts index 8e1847082..e903cb7d1 100644 --- a/appium/tests/screenobjects/create-key.screen.ts +++ b/appium/tests/screenobjects/create-key.screen.ts @@ -31,11 +31,7 @@ class CreateKeyScreen extends BaseScreen { } setPassPhrase(text: string = CommonData.account.passPhrase) { - try { - this.fillPassPhrase(text); - } catch { - console.log(driver.getPageSource()); - } + this.fillPassPhrase(text); this.clickSetPassPhraseBtn(); this.confirmPassPhrase(text); } diff --git a/appium/tests/screenobjects/splash.screen.ts b/appium/tests/screenobjects/splash.screen.ts index c1aef9040..5d18f3a5f 100644 --- a/appium/tests/screenobjects/splash.screen.ts +++ b/appium/tests/screenobjects/splash.screen.ts @@ -146,7 +146,7 @@ class SplashScreen extends BaseScreen { this.clickContinueBtn(); this.changeLanguage(); this.gmailLogin(email, password); - browser.pause(10000); // just to test + browser.pause(10000); // STABILITY FIX UNTIL WE WLL FIGURE OUT WITH ISSUE } } From 4604cd75d470b88f661ad2b535e65569a0d0c1dd Mon Sep 17 00:00:00 2001 From: Dmitry Sotnikov Date: Thu, 28 Oct 2021 20:23:01 +0300 Subject: [PATCH 17/17] [skip ci] rename click and type method --- appium/tests/helpers/ElementHelper.ts | 2 +- appium/tests/screenobjects/create-key.screen.ts | 4 ++-- appium/tests/screenobjects/new-message.screen.ts | 2 +- appium/tests/screenobjects/splash.screen.ts | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/appium/tests/helpers/ElementHelper.ts b/appium/tests/helpers/ElementHelper.ts index e11b8d0ba..1338d37e9 100644 --- a/appium/tests/helpers/ElementHelper.ts +++ b/appium/tests/helpers/ElementHelper.ts @@ -50,7 +50,7 @@ class ElementHelper { element.click(); } - static clickAndType(element, text: string) { + static waitClickAndType(element, text: string) { this.waitAndClick(element) element.setValue(text); } diff --git a/appium/tests/screenobjects/create-key.screen.ts b/appium/tests/screenobjects/create-key.screen.ts index e903cb7d1..470023f23 100644 --- a/appium/tests/screenobjects/create-key.screen.ts +++ b/appium/tests/screenobjects/create-key.screen.ts @@ -37,7 +37,7 @@ class CreateKeyScreen extends BaseScreen { } fillPassPhrase (passPhrase: string) { - ElementHelper.clickAndType(this.enterPassPhraseField, passPhrase); + ElementHelper.waitClickAndType(this.enterPassPhraseField, passPhrase); } clickSetPassPhraseBtn () { @@ -45,7 +45,7 @@ class CreateKeyScreen extends BaseScreen { } confirmPassPhrase (passPhrase: string) { - ElementHelper.clickAndType(this.confirmPassPhraseField, passPhrase); + ElementHelper.waitClickAndType(this.confirmPassPhraseField, passPhrase); ElementHelper.waitAndClick(this.okButton); } } diff --git a/appium/tests/screenobjects/new-message.screen.ts b/appium/tests/screenobjects/new-message.screen.ts index e3405156d..d413afcad 100644 --- a/appium/tests/screenobjects/new-message.screen.ts +++ b/appium/tests/screenobjects/new-message.screen.ts @@ -36,7 +36,7 @@ class NewMessageScreen extends BaseScreen { } setSubject(subject) { - ElementHelper.clickAndType(this.subjectField, subject); + ElementHelper.waitClickAndType(this.subjectField, subject); } setComposeSecurityMessage(message) { diff --git a/appium/tests/screenobjects/splash.screen.ts b/appium/tests/screenobjects/splash.screen.ts index 5d18f3a5f..eabe5b9ea 100644 --- a/appium/tests/screenobjects/splash.screen.ts +++ b/appium/tests/screenobjects/splash.screen.ts @@ -108,13 +108,13 @@ class SplashScreen extends BaseScreen { } fillEmail (email: string) { - ElementHelper.clickAndType(this.loginField, email); + ElementHelper.waitClickAndType(this.loginField, email); this.clickDoneBtn(); browser.pause(500); // stability sleep } fillPassword(password: string) { - ElementHelper.clickAndType(this.passwordField, password); + ElementHelper.waitClickAndType(this.passwordField, password); this.clickDoneBtn(); browser.pause(500); // stability sleep }