def tap_add_to_contact(self): self.marionette.find_element(*self._add_to_contact_button_locator).tap() from gaiatest.apps.contacts.app import Contacts contacts = Contacts(self.marionette) contacts.switch_to_contacts_frame() return contacts
def test_delete_contact(self): """ Test delete contact https://github.com/mozilla/gaia-ui-tests/issues/493 """ contacts_app = Contacts(self.marionette) contacts_app.launch() contacts_app.wait_for_contacts() pre_contacts_count = len(contacts_app.contacts) self.assertEqual( pre_contacts_count, 1, "Should insert one contact before running this test.") contact_item = contacts_app.contact(self.contact['givenName'][0]) contact_item_detail = contact_item.tap() contact_item_edit = contact_item_detail.tap_edit() contact_item_edit.tap_delete() contact_item_edit.tap_confirm_delete() self.wait_for_condition( lambda m: len(self.data_layer.all_contacts) == 0, message="Should have no contact after run this test.") contacts_app.switch_to_contacts_frame() post_contacts_count = len(contacts_app.contacts) self.assertEqual(post_contacts_count, 0, "Should have no contact after run this test.")
def test_delete_contact(self): """ Test delete contact https://github.com/mozilla/gaia-ui-tests/issues/493 """ contacts_app = Contacts(self.marionette) contacts_app.launch() contacts_app.wait_for_contacts() pre_contacts_count = len(contacts_app.contacts) self.assertEqual(pre_contacts_count, 1, "Should insert one contact before running this test.") contact_item = contacts_app.contact(self.contact['givenName'][0]) contact_item_detail = contact_item.tap() contact_item_edit = contact_item_detail.tap_edit() contact_item_edit.tap_delete() contact_item_edit.tap_confirm_delete() self.wait_for_condition(lambda m: len(self.data_layer.all_contacts) == 0, message="Should have no contact after run this test.") contacts_app.switch_to_contacts_frame() post_contacts_count = len(contacts_app.contacts) self.assertEqual(post_contacts_count, 0, "Should have no contact after run this test.")
def tap_add_to_existing_contact(self): element = self.marionette.find_element(*self._add_to_existing_contact_locator) Wait(self.marionette).until(expected.element_displayed(element)) element.tap() contact = Contacts(self.marionette) contact.switch_to_contacts_frame() return contact
def tap_add_to_existing_contact(self): element = self.marionette.find_element( *self._add_to_existing_contact_locator) Wait(self.marionette).until(expected.element_displayed(element)) element.tap() contact = Contacts(self.marionette) contact.switch_to_contacts_frame() return contact
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