예제 #1
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)

        # Import contact (adjust the correct number).
        self.contact = MockContact()
        self.UTILS.general.insertContact(self.contact)

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

    def test_run(self):
        self.messages.launch()

        # Start a new SMS and add the message and contact name.
        self.messages.startNewSMS()
        self.messages.selectAddContactButton()
        self.UTILS.iframe.switchToFrame(*DOM.Contacts.frame_locator)
        self.contacts.view_contact(self.contact["givenName"], False)
        self.UTILS.iframe.switchToFrame(*DOM.Messages.frame_locator)
        self.messages.checkIsInToField(self.contact["name"], True)

        # Remove it.
        self.messages.removeContactFromToField(self.contact["name"])

        # Verify the contact name is no longer present before removing it.
        self.messages.checkIsInToField(self.contact["name"], False)
예제 #2
0
class test_main(GaiaTestCase):

    def setUp(self):

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

        # Prepare the contact we're going to insert.
        self.contacts = []
        for i in range(3):
            given_name = "Name {}".format(i)
            family_name = "Surname {}".format(i)
            contact = MockContact(givenName=given_name, familyName=family_name,
                                       name="{} {}".format(given_name, family_name))
            self.contacts.append(contact)
            self.UTILS.general.insertContact(contact)

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

    def test_run(self):

        self.messages.launch()

        self.messages.startNewSMS()

        for c in self.contacts:
            self.messages.addContactToField(c["name"])

        # Remove it.
        self.messages.removeContactFromToField(self.contacts[1]["name"])

        # Verify the contact name is not present after removal
        self.messages.checkIsInToField(self.contacts[1]["name"], False)

        self.UTILS.reporting.logResult("info", "It is not the 'To' list.")
예제 #3
0
class test_main(GaiaTestCase):
    def setUp(self):

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

        # Prepare the contact we're going to insert.
        self.contacts = []
        for i in range(3):
            given_name = "Name {}".format(i)
            family_name = "Surname {}".format(i)
            contact = MockContact(givenName=given_name,
                                  familyName=family_name,
                                  name="{} {}".format(given_name, family_name))
            self.contacts.append(contact)
            self.UTILS.general.insertContact(contact)

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

    def test_run(self):

        self.messages.launch()

        self.messages.startNewSMS()

        for c in self.contacts:
            self.messages.addContactToField(c["name"])

        # Remove it.
        self.messages.removeContactFromToField(self.contacts[1]["name"])

        # Verify the contact name is not present after removal
        self.messages.checkIsInToField(self.contacts[1]["name"], False)

        self.UTILS.reporting.logResult("info", "It is not the 'To' list.")