Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def tap_done(self):
close = self.marionette.find_element(*self._settings_close_button_locator)
close.tap()
Wait(self.marionette).until(expected.element_not_displayed(close))
from gaiatest.apps.contacts.app import Contacts
return Contacts(self.marionette)
def _switch_to_contacts_frame(self):
# This is a nested frame and we cannot locate it with AppWindowManager
frame = Wait(self.marionette).until(
expected.element_present(*self._contacts_frame_locator))
self.marionette.switch_to_frame(frame)
from gaiatest.apps.contacts.app import Contacts
return Contacts(self.marionette)
def tap_back(self):
el = self.marionette.find_element(*self._details_header_locator)
Wait(self.marionette).until(expected.element_displayed(el))
# TODO: remove tap with coordinates after Bug 1061698 is fixed
el.tap(25, 25)
Wait(self.marionette).until(expected.element_not_displayed(el))
from gaiatest.apps.contacts.app import Contacts
return Contacts(self.marionette)
Wait(self.marionette).until(lambda m: self.apps.displayed_app.name != Contacts.name)
# Fall back to the underlying app
def tap_import_from_sim(self):
import_from_sim = Wait(self.marionette).until(
expected.element_present(*self._import_from_sim_button_locator))
Wait(self.marionette).until(expected.element_displayed(import_from_sim))
import_from_sim.tap()
from gaiatest.apps.contacts.app import Contacts
status_message = Wait(self.marionette).until(
expected.element_present(*Contacts._status_message_locator))
Wait(self.marionette).until(expected.element_displayed(status_message))
Wait(self.marionette).until(expected.element_not_displayed(status_message))
def login(self, user, password):
self.type_email(user)
self.type_password(password)
self.tap_submit()
from gaiatest.apps.contacts.app import Contacts
Contacts(self.marionette).wait_to_be_displayed()
self.apps.switch_to_displayed_app()
# switch to facebook import page to select the friends
from gaiatest.apps.contacts.regions.contact_import_picker import ContactImportPicker
return ContactImportPicker(self.marionette)
def wait_for_done(self, return_contacts=True):
# NewContact can be opened as an Activity from other apps. In this scenario we don't return Contacts
if return_contacts:
self.wait_for_element_not_displayed(*self._done_button_locator)
from gaiatest.apps.contacts.app import Contacts
return Contacts(self.marionette)
else:
from gaiatest.apps.contacts.app import Contacts
Wait(self.marionette).until(lambda m: self.apps.displayed_app.name != Contacts.name)
# Fall back to the underlying app
self.apps.switch_to_displayed_app()
def tap_add_recipient(self):
self.marionette.find_element(*self._add_recipient_button_locator).tap()
contacts_app = Contacts(self.marionette)
contacts_app.switch_to_contacts_frame()
return contacts_app