Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .semaphore/semaphore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion FlowCryptAppTests/Core/FlowCryptCoreTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions appium/config/wdio.ios.app.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ config.suites = {
],
settings: [
'./tests/specs/settings/*.spec.ts'
],
inbox: [
'./tests/specs/inbox/*.spec.ts'
]
};

Expand Down
2 changes: 1 addition & 1 deletion appium/config/wdio.shared.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ exports.config = {
runner: 'local',
framework: 'jasmine',
jasmineNodeOpts: {
defaultTimeoutInterval: 300000,
defaultTimeoutInterval: 180000,
requires: ['ts-node/register', 'tsconfig-paths/register']
},
sync: true,
Expand Down
1 change: 1 addition & 0 deletions appium/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
Expand Down
2 changes: 1 addition & 1 deletion appium/tests/screenobjects/email.screen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class EmailScreen extends BaseScreen {
this.enterPassPhraseField.setValue(text);
};

checkErrorMessage() {
checkWrongPassPhraseErrorMessage() {
this.wrongPassPhraseMessage.waitForDisplayed();
}

Expand Down
1 change: 1 addition & 0 deletions appium/tests/screenobjects/inbox.screen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class InboxScreen extends BaseScreen {
clickOnEmailBySubject (subject) {
this.createEmailButton.waitForDisplayed();
const selector = `~${subject}`;
$(selector).waitForDisplayed();
$(selector).click();
}

Expand Down
1 change: 1 addition & 0 deletions appium/tests/screenobjects/menu-bar.screen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class MenuBarScreen extends BaseScreen {
}

clickMenuIcon () {
this.menuIcon.waitForDisplayed();
this.menuIcon.click();
}
Comment on lines 27 to 30
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On browser extension (puppeteer) I use methods like waitAndClick and waitAndType and waitAndRead and so on. Generally, for every element that you interact with, you have to wait until it's there (and anyway it doesn't hurt to make sure first) so I recommend to use such methods (nearly) everywhere.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, let's make separate task for this to add ActionHelper file


Expand Down
11 changes: 11 additions & 0 deletions appium/tests/screenobjects/splash.screen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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();
Expand All @@ -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();
Expand All @@ -104,6 +111,7 @@ class SplashScreen extends BaseScreen {
this.loginField.click();
this.loginField.setValue(email);
this.doneButton.click();
browser.pause(500); // stability sleep
}

clickNextBtn () {
Expand All @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ describe('INBOX: ', () => {
SplashScreen.login();
CreateKeyScreen.setPassPhrase();

InboxScreen.clickOnEmailBySubject(senderEmail);
InboxScreen.clickOnEmailBySubject(emailSubject);
EmailScreen.checkOpenedEmail(senderEmail, emailSubject, emailText);

driver.terminateApp(bundleId);
Expand All @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ describe('INBOX: ', () => {
SplashScreen.login();
CreateKeyScreen.setPassPhrase();

InboxScreen.clickOnEmailBySubject(senderEmail);
InboxScreen.clickOnEmailBySubject(emailSubject);
EmailScreen.checkOpenedEmail(senderEmail, emailSubject, emailText);

driver.terminateApp(bundleId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,5 @@ describe('SETTINGS: ', () => {

KeysScreen.clickOnShowPublicKey();
PublicKeyScreen.checkPublicKey();

});
});