Beispiel #1
0
class test_main(GaiaTestCase):
    def setUp(self):
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.dialer = Dialer(self)

        #
        # Get own number and incoming
        #
        self.phone_number = self.UTILS.general.get_config_variable(
            "phone_number", "custom")
        self.call_number = self.UTILS.general.get_config_variable(
            "target_call_number", "common")
        self.incoming_number = self.UTILS.general.get_config_variable(
            "incoming_call_number", "common")
        self.UTILS.statusbar.clearAllStatusBarNotifs()

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

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

        self.dialer.enterNumber(self.call_number)
        self.dialer.call_this_number_and_hangup(2)

        time.sleep(2)
        self.UTILS.messages.create_incoming_sms(self.incoming_number,
                                                "Call:" + self.phone_number)
        self.UTILS.iframe.switch_to_frame(*DOM.Dialer.frame_locator)
        self.dialer.answer_and_hangup(3)

        time.sleep(2)
        self.UTILS.iframe.switchToFrame(*DOM.Dialer.frame_locator)
        time.sleep(2)
        self.dialer.enterNumber(self.call_number)
        self.dialer.call_this_number()

        self.UTILS.messages.create_incoming_sms(self.incoming_number,
                                                "Call:" + self.phone_number)
        self.UTILS.iframe.switchToFrame(*DOM.Dialer.frame_locator_calling)
        self.wait_for_element_displayed('id', 'incoming-answer', timeout=50)
        answer = self.marionette.find_element('id', 'incoming-answer')
        if answer:
            answer.tap()
        time.sleep(2)
        self.dialer.hangUp()
        time.sleep(5)
        self.UTILS.iframe.switchToFrame(*DOM.Dialer.frame_locator_calling)
        self.dialer.hangUp()
Beispiel #2
0
class test_main(GaiaTestCase):
    def __init__(self, *args, **kwargs):
        kwargs['restart'] = True
        super(test_main, self).__init__(*args, **kwargs)

    def setUp(self):
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.dialer = Dialer(self)

        # Get own number and incoming
        self.phone_number = self.UTILS.general.get_config_variable(
            "phone_number", "custom")
        self.UTILS.reporting.logComment("Calling to " + self.phone_number)
        self.incoming_number = self.UTILS.general.get_config_variable(
            "incoming_call_number", "common")

        # Generate the incoming call
        self.marionette.switch_to_frame()
        self.data_layer.send_sms(self.incoming_number,
                                 "Call:" + self.phone_number)
        self.dialer.wait_for_incoming_call(
            self.incoming_number.split("+34")[-1])
        self.dialer.answer_and_hangup(2)

        self.apps.kill_all()
        time.sleep(2)

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

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

        keypad_option = self.UTILS.element.getElement(
            DOM.Dialer.option_bar_keypad, "Keypad Option")
        keypad_option.tap()

        call_button = self.UTILS.element.getElement(
            DOM.Dialer.call_number_button, "Call button")
        call_button.tap()

        # Make sure that after tapping, we get the last outgoing call in the call log
        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(dialer_num == "", "Nothing in the input area")
Beispiel #3
0
class test_main(GaiaTestCase):

    def setUp(self):
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.dialer = Dialer(self)

        #
        # Get own number and incoming
        #
        self.phone_number = self.UTILS.general.get_config_variable("phone_number", "custom")
        self.call_number = self.UTILS.general.get_config_variable("target_call_number", "common")
        self.incoming_number = self.UTILS.general.get_config_variable("incoming_call_number", "common")
        self.UTILS.statusbar.clearAllStatusBarNotifs()

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

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

        self.dialer.enterNumber(self.call_number)
        self.dialer.call_this_number_and_hangup(2)

        time.sleep(2)
        self.UTILS.messages.create_incoming_sms(self.incoming_number, "Call:" + self.phone_number)
        self.UTILS.iframe.switch_to_frame(*DOM.Dialer.frame_locator)
        self.dialer.answer_and_hangup(3)

        time.sleep(2)
        self.UTILS.iframe.switchToFrame(*DOM.Dialer.frame_locator)
        time.sleep(2)
        self.dialer.enterNumber(self.call_number)
        self.dialer.call_this_number()

        self.UTILS.messages.create_incoming_sms(self.incoming_number, "Call:" + self.phone_number)
        self.UTILS.iframe.switchToFrame(*DOM.Dialer.frame_locator_calling)
        self.wait_for_element_displayed('id', 'incoming-answer', timeout=50)
        answer = self.marionette.find_element('id', 'incoming-answer')
        if answer:
            answer.tap()
        time.sleep(2)
        self.dialer.hangUp()
        time.sleep(5)
        self.UTILS.iframe.switchToFrame(*DOM.Dialer.frame_locator_calling)
        self.dialer.hangUp()
Beispiel #4
0
class test_main(GaiaTestCase):

    def __init__(self, *args, **kwargs):
        kwargs['restart'] = True
        super(test_main, self).__init__(*args, **kwargs)

    def setUp(self):
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.dialer = Dialer(self)

        # Get own number and incoming
        self.phone_number = self.UTILS.general.get_config_variable("phone_number", "custom")
        self.UTILS.reporting.logComment("Calling to " + self.phone_number)
        self.incoming_number = self.UTILS.general.get_config_variable("incoming_call_number", "common")

        # Generate the incoming call
        self.marionette.switch_to_frame()
        self.data_layer.send_sms(self.incoming_number, "Call:" + self.phone_number)
        self.dialer.wait_for_incoming_call(self.incoming_number.split("+34")[-1])
        self.dialer.answer_and_hangup(2)

        self.apps.kill_all()
        time.sleep(2)

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

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

        keypad_option = self.UTILS.element.getElement(DOM.Dialer.option_bar_keypad, "Keypad Option")
        keypad_option.tap()

        call_button = self.UTILS.element.getElement(DOM.Dialer.call_number_button, "Call button")
        call_button.tap()

        # Make sure that after tapping, we get the last outgoing call in the call log
        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(dialer_num == "", "Nothing in the input area")