Skip to content

Instantly share code, notes, and snippets.

@davehunt
Created June 18, 2015 10:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davehunt/a093d28786077b78b50f to your computer and use it in GitHub Desktop.
Save davehunt/a093d28786077b78b50f to your computer and use it in GitHub Desktop.
diff --git a/tests/python/gaia-ui-tests/gaiatest/apps/email/app.py b/tests/python/gaia-ui-tests/gaiatest/apps/email/app.py
index 111ab28..96ed90b 100644
--- a/tests/python/gaia-ui-tests/gaiatest/apps/email/app.py
--- a/tests/python/gaia-ui-tests/gaiatest/apps/email/app.py
+++ b/tests/python/gaia-ui-tests/gaiatest/apps/email/app.py
@@ -45,6 +45,11 @@ class Email(Base):
# check if the google autocomplete on email field works as expected
assert google_login.email == email
+ # dismiss the keyboard and return to the correct frame
+ google_login.keyboard.dismiss()
+ google_login.switch_to_frame()
+
+ google_login.tap_next()
google_login.type_password(password)
google_login.tap_sign_in()
diff --git a/tests/python/gaia-ui-tests/gaiatest/apps/email/regions/google.py b/tests/python/gaia-ui-tests/gaiatest/apps/email/regions/google.py
index a8992a4..15e789d 100644
--- a/tests/python/gaia-ui-tests/gaiatest/apps/email/regions/google.py
+++ b/tests/python/gaia-ui-tests/gaiatest/apps/email/regions/google.py
@@ -13,15 +13,11 @@ class GoogleLogin(Base):
_password_locator = (By.ID, 'Passwd')
_sign_in_locator = (By.ID, 'signIn')
_approve_access_locator = (By.CSS_SELECTOR, '#submit_approve_access.goog-buttonset-action')
+ _next_locator = (By.ID, 'next')
def __init__(self, marionette):
Base.__init__(self, marionette)
-
- # wait for the pop up screen to open
- view = Wait(self.marionette).until(
- expected.element_present(*self._iframe_locator))
- self.marionette.switch_to_frame(view)
-
+ self.switch_to_frame()
# wait for the page to load
email = Wait(self.marionette).until(
expected.element_present(*self._email_locator))
@@ -32,11 +28,16 @@ class GoogleLogin(Base):
return self.marionette.find_element(*self._email_locator).get_attribute('value')
def type_password(self, password):
- self.marionette.find_element(*self._password_locator).send_keys(password)
+ element = Wait(self.marionette).until(expected.element_present(*self._password_locator))
+ Wait(self.marionette).until(expected.element_displayed(element))
+ element.send_keys(password)
def tap_sign_in(self):
self.marionette.find_element(*self._sign_in_locator).tap()
+ def tap_next(self):
+ self.marionette.find_element(*self._next_locator).tap()
+
def wait_for_approve_access(self):
Wait(self.marionette).until(expected.element_displayed(
Wait(self.marionette).until(expected.element_present(
@@ -47,3 +48,9 @@ class GoogleLogin(Base):
expected.element_present(*self._approve_access_locator))
Wait(self.marionette).until(expected.element_enabled(approve_access))
approve_access.tap()
+
+ def switch_to_frame(self):
+ # wait for the pop up screen to open
+ view = Wait(self.marionette).until(
+ expected.element_present(*self._iframe_locator))
+ self.marionette.switch_to_frame(view)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment