예제 #1
0
class test_main(GaiaTestCase):
    def setUp(self):
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.contacts = Contacts(self)

        # Create test contacts.
        self.contact = MockContact()
        self.UTILS.general.insertContact(self.contact)

    def tearDown(self):
        self.UTILS.reporting.reportResults()
        GaiaTestCase.tearDown(self)

    def test_run(self):
        # Launch contacts app.
        self.contacts.launch()

        # View our contact.
        self.contacts.view_contact(self.contact['name'])

        # Edit our contact.
        self.contacts.press_edit_contact_button()

        # Delete our contact.
        self.contacts.press_delete_contact_button()

        # Cancel deletion.
        cancel_deletion = self.UTILS.element.getElement(
            DOM.Contacts.cancel_delete_btn, "Cancel button")
        cancel_deletion.tap()

        # Cancel contact edition
        self.contacts.press_cancel_edit_button()

        # Go back to contacts start page
        self.contacts.go_back_from_contact_details()

        # Now actually delete our contact.
        self.contacts.delete_contact(self.contact['name'])
예제 #2
0
class test_main(GaiaTestCase):

    def setUp(self):

        # Set up child objects...
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.contacts = Contacts(self)
        self.messages = Messages(self)

        # Prepare the contact we're going to insert.
        self.phone_number = self.UTILS.general.get_config_variable("phone_number", "custom")
        self.contact = MockContact(tel={'type': '', 'value': self.phone_number})
        self.test_msg = "Test."

        self.UTILS.general.insertContact(self.contact)
        self.UTILS.reporting.logComment("Using target telephone number " + self.contact["tel"]["value"])
        self.data_layer.delete_all_sms()

    def tearDown(self):
        self.UTILS.reporting.reportResults()
        GaiaTestCase.tearDown(self)

    def test_run(self):
        msgapp = self.messages.launch()
        self.messages.create_and_send_sms([self.phone_number], "Test")
        send_time = self.messages.last_sent_message_timestamp()
        self.messages.wait_for_message(send_time=send_time)

        self.messages.go_back()
        self.messages.openThread(self.contact["name"])

        # Delete the contact
        self.apps.kill(msgapp)
        self.contacts.launch()
        self.contacts.delete_contact(self.contact["name"])

        # Go back to SMS app and try to open the thread by phone number
        self.messages.launch()
        self.messages.openThread(self.contact["tel"]["value"])
예제 #3
0
class test_main(GaiaTestCase):

    def setUp(self):
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.contacts = Contacts(self)

        # Create test contacts.
        self.contact = MockContact()
        self.UTILS.general.insertContact(self.contact)

    def tearDown(self):
        self.UTILS.reporting.reportResults()
        GaiaTestCase.tearDown(self)

    def test_run(self):
        # Launch contacts app.
        self.contacts.launch()

        # View our contact.
        self.contacts.view_contact(self.contact['name'])

        # Edit our contact.
        self.contacts.press_edit_contact_button()

        # Delete our contact.
        self.contacts.press_delete_contact_button()

        # Cancel deletion.
        cancel_deletion = self.UTILS.element.getElement(DOM.Contacts.cancel_delete_btn, "Cancel button")
        cancel_deletion.tap()

        # Cancel contact edition
        self.contacts.press_cancel_edit_button()

        # Go back to contacts start page
        self.contacts.go_back_from_contact_details()

        # Now actually delete our contact.
        self.contacts.delete_contact(self.contact['name'])