Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#1850 Enable live test #2290

Draft
wants to merge 9 commits into
base: master
Choose a base branch
from
Draft
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
7 changes: 3 additions & 4 deletions .semaphore/semaphore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,9 @@ blocks:
- npm run-script test.mock.login
- sleep 3
- npm run-script test.mock.settings
# temporary disabled because of e2e account login issue
# - 'wget https://flowcrypt.s3.eu-central-1.amazonaws.com/release/flowcrypt-ios-old-version-for-ci-storage-compatibility-2022-05-09.zip -P ~/git/flowcrypt-ios/appium'
# - unzip flowcrypt-ios-*.zip
# - npm run-script test.live.all
- 'wget https://flowcrypt.s3.eu-central-1.amazonaws.com/release/flowcrypt-ios-old-version-for-ci-storage-compatibility-2022-05-09.zip -P ~/git/flowcrypt-ios/appium'
- unzip flowcrypt-ios-*.zip
- npm run-script test.live.all
secrets:
- name: flowcrypt-ios-ci-secrets
run:
Expand Down
6 changes: 6 additions & 0 deletions appium/tests/data/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import * as path from 'path';
import * as dotenv from 'dotenv';
dotenv.config();

export const CommonData = {
account: {
Expand Down Expand Up @@ -75,6 +77,10 @@ export const CommonData = {
email: '[email protected]',
name: 'Dmitry at FlowCrypt',
},
compatibilitySender: {
email: '[email protected]',
name: 'FlowCrypt Compatibility',
},
contact: {
contactName: 'Dima Flowcrypt',
email: '[email protected]',
Expand Down
3 changes: 3 additions & 0 deletions appium/tests/screenobjects/public-key-details.screen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,12 @@ class PublicKeyDetailsScreen extends BaseScreen {
await (await this.copyButton).waitForDisplayed();
await (await this.shareButton).waitForDisplayed();
await (await this.keyLabel).waitForDisplayed();
await TouchHelper.scrollDownToElement(await this.signatureLabel);
await TouchHelper.scrollDownToElement(await this.fingerprintsLabel);
await (await this.signatureLabel).waitForDisplayed();
await TouchHelper.scrollDownToElement(await this.lastFetchedDateLabel);
await (await this.lastFetchedDateLabel).waitForDisplayed();
await TouchHelper.scrollDownToElement(await this.fingerprintsLabel);
await (await this.fingerprintsLabel).waitForDisplayed();
};

Expand Down
35 changes: 7 additions & 28 deletions appium/tests/screenobjects/splash.screen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ const SELECTORS = {
CONTINUE_BTN: '~Continue',
CANCEL_BTN: '~Cancel',
LOGIN_FIELD: '~Email or phone',
NEXT_BTN: '-ios class chain:**/XCUIElementTypeButton[`label == "Next"`][1]',
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"`]',
Expand Down Expand Up @@ -68,14 +66,6 @@ class SplashScreen extends BaseScreen {
return $(SELECTORS.PASSWORD_FIELD);
}

get nextButton() {
return $(SELECTORS.NEXT_BTN);
}

get doneButton() {
return $(SELECTORS.DONE_BTN);
}

get languageDropdown() {
return $(SELECTORS.LANGUAGE_DROPDOWN);
}
Expand Down Expand Up @@ -116,30 +106,22 @@ class SplashScreen extends BaseScreen {
await ElementHelper.waitAndClick(await this.cancelButton);
};

changeLanguage = async (language = 'English (United States)') => {
changeLanguage = async (language = 'English (United States)') => {
await ElementHelper.waitAndClick(await this.languageDropdown, 500);
const selector = `~${language}`;
await ElementHelper.waitAndClick(await $(selector));
const langEl = await $(`//XCUIElementTypeOther[contains(@name, "${language}")]`);
await ElementHelper.waitAndClick(langEl);
};

fillEmail = async (email: string) => {
await ElementHelper.waitClickAndType(await this.loginField, email);
await this.clickDoneBtn();
await browser.pause(500); // stability sleep
await (await this.loginField).sendKeys(['\uE007']);
await browser.pause(3000);
};

fillPassword = async (password: string) => {
await ElementHelper.waitClickAndType(await this.passwordField, password);
await this.clickDoneBtn();
await browser.pause(500); // stability sleep
};

clickNextBtn = async () => {
await ElementHelper.waitAndClick(await this.nextButton);
};

clickDoneBtn = async () => {
await ElementHelper.waitAndClick(await this.doneButton);
await (await this.passwordField).sendKeys(['\uE007']);
await browser.pause(3000);
};

gmailLogin = async (email: string, password: string) => {
Expand All @@ -151,13 +133,10 @@ class SplashScreen extends BaseScreen {
await (await this.useAnotherAccount).waitForDisplayed({ timeout: 5000, reverse: true });
if (await (await this.passwordField).isDisplayed()) {
await this.fillPassword(password);
await this.clickNextBtn();
}
} else {
await this.fillEmail(email);
await this.clickNextBtn();
await this.fillPassword(password);
await this.clickNextBtn();
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,8 @@ describe('UPDATE: ', () => {
const newAppPath = CommonData.appPath.new;
const bundleId = CommonData.bundleId.id;
const correctPassPhrase = CommonData.account.passPhrase;
const firstContactItemName = CommonData.contact.name;
const firstContactEmail = CommonData.contact.email;
const senderName = CommonData.sender.name;
const senderName = CommonData.compatibilitySender.name;
const senderEmail = CommonData.compatibilitySender.email;
const emailSubject = CommonData.encryptedEmail.subject;
const emailText = CommonData.encryptedEmail.message;
const liveKeys = [ekmKeySamples.e2e, ekmKeySamples.flowcryptCompabilityOther, ekmKeySamples.flowcryptCompability];
Expand All @@ -43,6 +42,7 @@ describe('UPDATE: ', () => {
//login and check user
await SplashScreen.login();
await SetupKeyScreen.setPassPhrase();
await browser.pause(5000);
await MailFolderScreen.checkInboxScreen();

await MailFolderScreen.clickSearchButton();
Expand All @@ -59,11 +59,11 @@ describe('UPDATE: ', () => {
await SettingsScreen.checkSettingsScreen();
await SettingsScreen.clickOnSettingItem('Contacts');
await ContactScreen.checkContactScreen();
await ContactScreen.checkContact(firstContactItemName);
await ContactScreen.checkContact(senderName);

await ContactScreen.clickOnContact(firstContactItemName);
await ContactScreen.clickOnContact(senderName);

await ContactPublicKeyScreen.checkPgpUserId(firstContactEmail);
await ContactPublicKeyScreen.checkPgpUserId(senderEmail);
await ContactPublicKeyScreen.checkPublicKeyDetailsNotEmpty();
await ContactPublicKeyScreen.clickOnFingerPrint();
await PublicKeyDetailsScreen.checkPublicKeyDetailsScreen();
Expand All @@ -84,19 +84,19 @@ describe('UPDATE: ', () => {
await SettingsScreen.checkSettingsScreen();
await SettingsScreen.clickOnSettingItem('Contacts');
await ContactScreen.checkContactScreen();
await ContactScreen.checkContact(firstContactItemName);
await ContactScreen.checkContact(senderName);

await ContactScreen.clickOnContact(firstContactItemName);
await ContactScreen.clickOnContact(senderName);

await ContactPublicKeyScreen.checkPgpUserId(firstContactEmail);
await ContactPublicKeyScreen.checkPgpUserId(senderEmail);
await ContactPublicKeyScreen.checkPublicKeyDetailsNotEmpty();
await ContactPublicKeyScreen.clickOnFingerPrint();
await PublicKeyDetailsScreen.checkPublicKeyNotEmpty();

await ContactPublicKeyScreen.clickBackButton();
await ContactPublicKeyScreen.checkPgpUserId(firstContactEmail);
await ContactPublicKeyScreen.checkPgpUserId(senderEmail);
await ContactPublicKeyScreen.clickBackButton();
await ContactScreen.checkContact(firstContactItemName);
await ContactScreen.checkContact(senderName);
await ContactScreen.clickBackButton();
await SettingsScreen.checkSettingsScreen();

Expand Down