Skip to content

Instantly share code, notes, and snippets.

@bebef1987
Created July 17, 2013 15:50
Show Gist options
  • Save bebef1987/6021840 to your computer and use it in GitHub Desktop.
Save bebef1987/6021840 to your computer and use it in GitHub Desktop.
frame
class NewContact(ContactForm):
_done_button_locator = ('id', 'save-button')
_new_contact_frame_locator = ('css selector', "iframe[src^='app://communications'][src$='contacts/index.html?new']")
def __init__(self, marionette,switch_to_frame = False):
ContactForm.__init__(self, marionette)
if switch_to_frame:
self.marionette.switch_to_frame()
self.wait_for_element_present(*self._new_contact_frame_locator)
frame = self.marionette.find_element(*self._new_contact_frame_locator)
self.marionette.switch_to_frame(frame)
self.wait_for_element_displayed(*self._done_button_locator)
def tap_done(self):
self.marionette.find_element(*self._done_button_locator).tap()
from gaiatest.apps.contacts.app import Contacts
return Contacts(self.marionette)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment