コード例 #1
0
ファイル: test_26993.py プロジェクト: owdqa/owd_test_cases
class test_main(GaiaTestCase):
    def setUp(self):

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

        phone_number = self.UTILS.general.get_config_variable(
            "phone_number", "custom")
        prefix = "0034"
        self.num1 = prefix + phone_number if not phone_number.startswith(
            "+34") else prefix + phone_number[3:]
        self.num2 = phone_number[3:] if phone_number.startswith(
            "+34") else phone_number

        self.contact = MockContact(tel={'type': 'Mobile', 'value': self.num1})
        self.UTILS.general.insertContact(self.contact)

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

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

        # Create and send a new test message to this contact.
        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)

        self.messages.enterSMSMsg("Test message.")
        self.messages.sendSMS()

        self.messages.wait_for_message()

        # Tap the header to call.
        self.messages.header_call()

        # Dialler is started with the number already filled in.
        phone_field = self.UTILS.element.getElement(DOM.Dialer.phone_number,
                                                    "Phone number")
        self.UTILS.test.test(
            self.num2 in phone_field.get_attribute("value"),
            "The phone number contains '{}' (it was '{}').".format(
                self.num1, phone_field.get_attribute("value")))
コード例 #2
0
ファイル: test_26992.py プロジェクト: owdqa/owd_test_cases
class test_main(GaiaTestCase):

    test_msg = "Test message."

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

        self.phone_number = self.UTILS.general.get_config_variable("phone_number", "custom").split("+34")[-1]
        self.contact = MockContact(tel={'type': 'Mobile', 'value': self.phone_number})
        self.UTILS.general.insertContact(self.contact)

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

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

        # Create and send a new test message.
        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)

        self.messages.enterSMSMsg("Test message.")
        self.messages.sendSMS()
        send_time = self.messages.last_sent_message_timestamp()

        self.messages.wait_for_message(send_time=send_time)

        # Tap the header to call.
        self.messages.header_call()

        # Dialer is started with the number already filled in.
        time.sleep(2)
        phone_field = self.UTILS.element.getElement(DOM.Dialer.phone_number, "Phone number field", False)
        dialer_num = phone_field.get_attribute("value")

        self.UTILS.test.test(self.phone_number == dialer_num,
                        "The phone is '{}' (expected '{}').".\
                        format(dialer_num, self.phone_number))
コード例 #3
0
class test_main(GaiaTestCase):
    def setUp(self):

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

        self.phone_number = self.UTILS.general.get_config_variable(
            "phone_number", "custom")
        self.test_msg = "Test message at {}".format(time.time())

        self.contact = MockContact(tel={
            'type': 'Mobile',
            'value': self.phone_number
        })
        self.UTILS.general.insertContact(self.contact)
        self.data_layer.delete_all_sms()
        self.UTILS.statusbar.clearAllStatusBarNotifs()

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

    def test_run(self):

        # Create and send a new test message.
        self.data_layer.send_sms(self.phone_number, self.test_msg)
        self.UTILS.statusbar.wait_for_notification_toaster_detail(
            self.test_msg, timeout=120)
        self.UTILS.statusbar.click_on_notification_detail(
            self.test_msg, DOM.Messages.frame_locator)

        # Tap the header to call.
        self.messages.header_call()

        # Dialer is started with the number already filled in.
        current = self.UTILS.element.getElement(
            DOM.Dialer.phone_number, "Phone number").get_attribute("value")
        self.UTILS.test.test(
            self.phone_number == current,
            "The phone number contains '{}' (expected '{}').".format(
                current, self.phone_number))

        # Dial the number.
        self.Dialer.call_this_number_and_hangup(5)
コード例 #4
0
ファイル: test_26993.py プロジェクト: owdqa/owd_test_cases
class test_main(GaiaTestCase):

    def setUp(self):

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

        phone_number = self.UTILS.general.get_config_variable("phone_number", "custom")
        prefix = "0034"
        self.num1 = prefix + phone_number if not phone_number.startswith("+34") else prefix + phone_number[3:]
        self.num2 = phone_number[3:] if phone_number.startswith("+34") else phone_number

        self.contact = MockContact(tel={'type': 'Mobile', 'value': self.num1})
        self.UTILS.general.insertContact(self.contact)

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

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

        # Create and send a new test message to this contact.
        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)

        self.messages.enterSMSMsg("Test message.")
        self.messages.sendSMS()

        self.messages.wait_for_message()

        # Tap the header to call.
        self.messages.header_call()

        # Dialler is started with the number already filled in.
        phone_field = self.UTILS.element.getElement(DOM.Dialer.phone_number, "Phone number")
        self.UTILS.test.test(self.num2 in phone_field.get_attribute("value"),
                        "The phone number contains '{}' (it was '{}').".format(self.num1, phone_field.get_attribute("value")))
コード例 #5
0
ファイル: test_26991.py プロジェクト: owdqa/owd_test_cases
class test_main(GaiaTestCase):

    def setUp(self):

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

        self.phone_number = self.UTILS.general.get_config_variable("phone_number", "custom")
        self.test_msg = "Test message at {}".format(time.time())

        self.contact = MockContact(tel={'type': 'Mobile', 'value': self.phone_number})
        self.UTILS.general.insertContact(self.contact)
        self.data_layer.delete_all_sms()
        self.UTILS.statusbar.clearAllStatusBarNotifs()

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

    def test_run(self):

        # Create and send a new test message.
        self.data_layer.send_sms(self.phone_number, self.test_msg)
        self.UTILS.statusbar.wait_for_notification_toaster_detail(self.test_msg, timeout=120)
        self.UTILS.statusbar.click_on_notification_detail(self.test_msg, DOM.Messages.frame_locator)

        # Tap the header to call.
        self.messages.header_call()

        # Dialer is started with the number already filled in.
        current = self.UTILS.element.getElement(DOM.Dialer.phone_number, "Phone number").get_attribute("value")
        self.UTILS.test.test(self.phone_number == current,
                        "The phone number contains '{}' (expected '{}').".format(current, self.phone_number))

        # Dial the number.
        self.Dialer.call_this_number_and_hangup(5)