Skip to content

Commit

Permalink
issue #973 appium: added fixes for login method for google authentica…
Browse files Browse the repository at this point in the history
…tion (#980)

Co-authored-by: Dmitry Sotnikov <[email protected]>
  • Loading branch information
fcvakintos and acladima authored Nov 10, 2021
1 parent c5334ed commit 7be54dc
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion appium/tests/screenobjects/splash.screen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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"`]',
USE_ANOTHER_ACCOUNT: '-ios class chain:**/XCUIElementTypeStaticText[`label == "Use another account"`]'
};

class SplashScreen extends BaseScreen {
Expand Down Expand Up @@ -80,6 +81,10 @@ class SplashScreen extends BaseScreen {
return $(SELECTORS.SIGN_IN_WITH_GMAIL);
}

get useAnotherAcoount () {
return $(SELECTORS.USE_ANOTHER_ACCOUNT);
}

checkLoginPage () {
expect(this.privacyTab).toBeDisplayed();
expect(this.termsTab).toBeDisplayed();
Expand Down Expand Up @@ -133,6 +138,11 @@ class SplashScreen extends BaseScreen {
browser.pause(1000); // stability sleep for language change
if($(emailSelector).isDisplayed()) {
$(emailSelector).click();
this.useAnotherAcoount.waitForDisplayed({timeout: 1000, reverse: true});
if(this.passwordField.isDisplayed()) {
this.fillPassword(password);
this.clickNextBtn();
}
} else {
this.fillEmail(email);
this.clickNextBtn();
Expand Down

0 comments on commit 7be54dc

Please sign in to comment.