From 7be54dc8b31b123284710c7ab275675830efbd5f Mon Sep 17 00:00:00 2001 From: fcvakintos <91205853+fcvakintos@users.noreply.github.com> Date: Wed, 10 Nov 2021 14:35:22 +0200 Subject: [PATCH] issue #973 appium: added fixes for login method for google authentication (#980) Co-authored-by: Dmitry Sotnikov --- appium/tests/screenobjects/splash.screen.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/appium/tests/screenobjects/splash.screen.ts b/appium/tests/screenobjects/splash.screen.ts index eabe5b9ea..745a57ea4 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"`]', + USE_ANOTHER_ACCOUNT: '-ios class chain:**/XCUIElementTypeStaticText[`label == "Use another account"`]' }; class SplashScreen extends BaseScreen { @@ -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(); @@ -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();