diff --git a/.semaphore/semaphore.yml b/.semaphore/semaphore.yml index 184c9a95b..1b2ff0bef 100644 --- a/.semaphore/semaphore.yml +++ b/.semaphore/semaphore.yml @@ -57,7 +57,7 @@ blocks: - mv ~/appium-env ~/git/flowcrypt-ios/appium/.env - cache restore appium-npm && cd ./appium && npm i && cd .. && cache store appium-npm appium/node_modules - bundle exec fastlane build - - ls -la appium && cd appium && npm run-script only.test.smoke + - ls -la appium && cd appium && npm run-script only.test.all epilogue: on_fail: commands: diff --git a/FlowCryptAppTests/Core/FlowCryptCoreTests.swift b/FlowCryptAppTests/Core/FlowCryptCoreTests.swift index 7fe3d5782..c14a579cd 100644 --- a/FlowCryptAppTests/Core/FlowCryptCoreTests.swift +++ b/FlowCryptAppTests/Core/FlowCryptCoreTests.swift @@ -17,7 +17,7 @@ final class FlowCryptCoreTests: XCTestCase { core.startInBackgroundIfNotAlreadyRunning { expectation.fulfill() } - wait(for: [expectation], timeout: 10) + wait(for: [expectation], timeout: 20) } // the tests below diff --git a/appium/config/wdio.ios.app.conf.js b/appium/config/wdio.ios.app.conf.js index c07d7dbec..82da5eedd 100644 --- a/appium/config/wdio.ios.app.conf.js +++ b/appium/config/wdio.ios.app.conf.js @@ -12,6 +12,9 @@ config.suites = { ], settings: [ './tests/specs/settings/*.spec.ts' + ], + inbox: [ + './tests/specs/inbox/*.spec.ts' ] }; diff --git a/appium/config/wdio.shared.conf.js b/appium/config/wdio.shared.conf.js index e2181eb1a..824d2fea4 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: 300000, + defaultTimeoutInterval: 180000, requires: ['ts-node/register', 'tsconfig-paths/register'] }, sync: true, diff --git a/appium/package.json b/appium/package.json index ff16943c4..69435b16b 100644 --- a/appium/package.json +++ b/appium/package.json @@ -7,6 +7,7 @@ "only.test.smoke": "./node_modules/.bin/wdio ./config/wdio.ios.app.conf.js --suite smoke", "only.test.settings": "./node_modules/.bin/wdio ./config/wdio.ios.app.conf.js --suite settings", "only.test.all": "./node_modules/.bin/wdio ./config/wdio.ios.app.conf.js --suite all", + "only.test.inbox": "./node_modules/.bin/wdio ./config/wdio.ios.app.conf.js --suite inbox", "test": "(cd .. && bundle exec fastlane build) && npm run-script only.test.all" }, "author": "FlowCrypt a. s.", diff --git a/appium/tests/screenobjects/email.screen.ts b/appium/tests/screenobjects/email.screen.ts index 4be310daa..9f89b2457 100644 --- a/appium/tests/screenobjects/email.screen.ts +++ b/appium/tests/screenobjects/email.screen.ts @@ -70,7 +70,7 @@ class EmailScreen extends BaseScreen { this.enterPassPhraseField.setValue(text); }; - checkErrorMessage() { + checkWrongPassPhraseErrorMessage() { this.wrongPassPhraseMessage.waitForDisplayed(); } diff --git a/appium/tests/screenobjects/inbox.screen.ts b/appium/tests/screenobjects/inbox.screen.ts index 8430e3f0a..81e17cb89 100644 --- a/appium/tests/screenobjects/inbox.screen.ts +++ b/appium/tests/screenobjects/inbox.screen.ts @@ -25,6 +25,7 @@ class InboxScreen extends BaseScreen { clickOnEmailBySubject (subject) { this.createEmailButton.waitForDisplayed(); const selector = `~${subject}`; + $(selector).waitForDisplayed(); $(selector).click(); } diff --git a/appium/tests/screenobjects/menu-bar.screen.ts b/appium/tests/screenobjects/menu-bar.screen.ts index ff77915cc..b4fcc9786 100644 --- a/appium/tests/screenobjects/menu-bar.screen.ts +++ b/appium/tests/screenobjects/menu-bar.screen.ts @@ -25,6 +25,7 @@ class MenuBarScreen extends BaseScreen { } clickMenuIcon () { + this.menuIcon.waitForDisplayed(); this.menuIcon.click(); } diff --git a/appium/tests/screenobjects/splash.screen.ts b/appium/tests/screenobjects/splash.screen.ts index c0a79186b..999065e98 100644 --- a/appium/tests/screenobjects/splash.screen.ts +++ b/appium/tests/screenobjects/splash.screen.ts @@ -15,6 +15,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"`]' }; class SplashScreen extends BaseScreen { @@ -74,6 +75,10 @@ class SplashScreen extends BaseScreen { return $(SELECTORS.LANGUAGE_DROPDOWN) } + get signInAsGoogleAccounLabel () { + return $(SELECTORS.SIGN_IN_WITH_GMAIL); + } + checkLoginPage () { expect(this.privacyTab).toBeDisplayed(); expect(this.termsTab).toBeDisplayed(); @@ -94,6 +99,8 @@ class SplashScreen extends BaseScreen { } changeLanguage (language: string = '‪English (United States)‬') { + this.languageDropdown.waitForDisplayed(); + browser.pause(500); // stability sleep this.languageDropdown.click(); const selector = `~${language}`; $(selector).waitForDisplayed(); @@ -104,6 +111,7 @@ class SplashScreen extends BaseScreen { this.loginField.click(); this.loginField.setValue(email); this.doneButton.click(); + browser.pause(500); // stability sleep } clickNextBtn () { @@ -114,10 +122,13 @@ class SplashScreen extends BaseScreen { this.passwordField.click(); this.passwordField.setValue(password); this.doneButton.click(); + browser.pause(500); // stability sleep } gmailLogin (email: string, password: string) { const emailSelector = `-ios class chain:**/XCUIElementTypeStaticText[\`label == "${email}"\`]`; + this.signInAsGoogleAccounLabel.waitForDisplayed(); + browser.pause(1000); // stability sleep for language change if($(emailSelector).isDisplayed()) { $(emailSelector).click(); } else { diff --git a/appium/tests/specs/inbox/CheckEncryptedEmailAfterRestartApp.spec.ts b/appium/tests/specs/inbox/CheckEncryptedEmailAfterRestartApp.spec.ts index f3ca1175c..45b14aa99 100644 --- a/appium/tests/specs/inbox/CheckEncryptedEmailAfterRestartApp.spec.ts +++ b/appium/tests/specs/inbox/CheckEncryptedEmailAfterRestartApp.spec.ts @@ -23,7 +23,7 @@ describe('INBOX: ', () => { SplashScreen.login(); CreateKeyScreen.setPassPhrase(); - InboxScreen.clickOnEmailBySubject(senderEmail); + InboxScreen.clickOnEmailBySubject(emailSubject); EmailScreen.checkOpenedEmail(senderEmail, emailSubject, emailText); driver.terminateApp(bundleId); @@ -35,7 +35,7 @@ describe('INBOX: ', () => { //try to see encrypted message with wrong pass phrase EmailScreen.enterPassPhrase(wrongPassPhrase); EmailScreen.clickOkButton(); - EmailScreen.checkErrorMessage(); + EmailScreen.checkWrongPassPhraseErrorMessage(); //check email after setting correct pass phrase EmailScreen.enterPassPhrase(correctPassPhrase); diff --git a/appium/tests/specs/inbox/ReadEmailAfterRestartApp.spec.ts b/appium/tests/specs/inbox/ReadEmailAfterRestartApp.spec.ts index 5a8a643e1..7a3b0cccc 100644 --- a/appium/tests/specs/inbox/ReadEmailAfterRestartApp.spec.ts +++ b/appium/tests/specs/inbox/ReadEmailAfterRestartApp.spec.ts @@ -20,7 +20,7 @@ describe('INBOX: ', () => { SplashScreen.login(); CreateKeyScreen.setPassPhrase(); - InboxScreen.clickOnEmailBySubject(senderEmail); + InboxScreen.clickOnEmailBySubject(emailSubject); EmailScreen.checkOpenedEmail(senderEmail, emailSubject, emailText); driver.terminateApp(bundleId); diff --git a/appium/tests/specs/settings/CheckSettingsForLoggedUser.spec.ts b/appium/tests/specs/settings/CheckSettingsForLoggedUser.spec.ts index 4030bf800..7860eeda3 100644 --- a/appium/tests/specs/settings/CheckSettingsForLoggedUser.spec.ts +++ b/appium/tests/specs/settings/CheckSettingsForLoggedUser.spec.ts @@ -30,6 +30,5 @@ describe('SETTINGS: ', () => { KeysScreen.clickOnShowPublicKey(); PublicKeyScreen.checkPublicKey(); - }); });