Пример #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.loop = Loop(self)

        # Get details of our test contacts.
        self.contact = MockContact()
        self.UTILS.general.insertContact(self.contact)
        self.data_layer.connect_to_wifi()

        result = self.loop.initial_test_checks()

        if result:
            self.loop.phone_login()
            self.loop.allow_permission_phone_login()
            self.UTILS.element.waitForElements(DOM.Loop.app_header, "Loop main view")

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

        _ = setup_translations(self)
        self.expected_message = _("No problem! Just share the following link and they can call you back from"\
                                  " any browser.")

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

    def test_run(self):

        # Launch contacts app.
        self.contacts.launch()
        self.contacts.view_contact(self.contact['name'])
        video_btn = self.marionette.find_element(DOM.Contacts.view_contact_hello_option[0],
                                                 DOM.Contacts.view_contact_hello_option[1].format("video"))
        video_btn.tap()
        self.loop.share_micro_and_camera()
        self.wait_for_element_displayed(*DOM.Loop.not_a_user_explanation, timeout=10)
        not_a_user_explanation = self.marionette.find_element(*DOM.Loop.not_a_user_explanation)
        self.UTILS.test.test(not_a_user_explanation.text == self.expected_message, "Message found: {} (Expected: {}".\
                             format(not_a_user_explanation.text, self.expected_message))

        share_options = self.UTILS.element.getElements(DOM.Loop.share_link_options, "Sharing options")
        self.UTILS.test.test(len(share_options) == 3, "There are {} sharing options (Expected: 3)".\
                             format(len(share_options)))
        share_by_others = self.UTILS.element.getElement(DOM.Loop.share_panel_others_share, "Share by others")
        share_by_others.tap()
        self.marionette.switch_to_frame()
        self.UTILS.element.getElement((DOM.Loop.share_others_header[0],
                                      DOM.Loop.share_others_header[1].format(_("Share with:"))),
                                      "Share with Header")
        options = self.UTILS.element.getElements((DOM.Loop.share_others_options[0],
                                                  DOM.Loop.share_others_options[1].\
                                                  format(_("Share with:"))), "Options buttons")
        self.UTILS.test.test(len(options) == 3, "There are {} options (Expected: 3)".format(len(options)))
Пример #2
0
class main(GaiaTestCase):

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

        self.connect_to_network()

        self.loop.initial_test_checks()

        self.contact = MockContact()
        self.UTILS.general.insertContact(self.contact)

        self.apps.kill_all()
        time.sleep(2)
        _ = setup_translations(self)

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

    def test_run(self):
        self.contacts.launch()
        self.contacts.view_contact(self.contact['name'])
        video_btn = self.marionette.find_element(DOM.Contacts.view_contact_hello_option[0],
                                                 DOM.Contacts.view_contact_hello_option[1].format("video"))
        video_btn.tap()
        self.loop.share_micro_and_camera()
        header = self.marionette.find_element(*DOM.Loop.app_header)
        self.UTILS.test.test(header, "Firefox Hello launched successfully")
        self.UTILS.iframe.switch_to_frame(*DOM.Loop.frame_locator)
        phone_btn = self.marionette.find_element(*DOM.Loop.wizard_login_phone_number)
        self.UTILS.test.test(phone_btn, "Login using phone number button present")
Пример #3
0
class test_main(GaiaTestCase):
    def setUp(self):

        # Set up child objects...
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.contacts = Contacts(self)
        self.loop = Loop(self)

        # Get details of our test contacts.
        self.contact = MockContact()
        self.UTILS.general.insertContact(self.contact)
        self.data_layer.connect_to_wifi()

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

    def test_run(self):

        # Launch contacts app.
        self.contacts.launch()
        self.contacts.view_contact(self.contact['name'])
        video_btn = self.marionette.find_element(
            DOM.Contacts.view_contact_hello_option[0],
            DOM.Contacts.view_contact_hello_option[1].format("video"))
        video_btn.tap()
        self.loop.share_micro_and_camera()
        header = self.marionette.find_element(*DOM.Loop.app_header)
        self.UTILS.test.test(header, "Firefox Hello launched successfully")
Пример #4
0
class test_main(GaiaTestCase):

    def setUp(self):

        # Set up child objects...
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.contacts = Contacts(self)
        self.loop = Loop(self)

        # Insert test contact
        self.contact = MockContact()
        self.UTILS.general.insertContact(self.contact)
        _ = setup_translations(self)

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

    def test_run(self):

        # Launch contacts app.
        self.contacts.launch()
        self.contacts.view_contact(self.contact['name'])
        video_btn = self.marionette.find_element(DOM.Contacts.view_contact_hello_option[0],
                                                 DOM.Contacts.view_contact_hello_option[1].format("video"))
        video_btn.tap()
        self.loop.share_micro_and_camera()
        self.marionette.switch_to_frame()
        msg_dom = (DOM.Loop.connection_error_msg[0], DOM.Loop.connection_error_msg[1].format(_("connection failure")))
        self.wait_for_element_displayed(*msg_dom,
                                        timeout=15)
        error_msg = self.marionette.find_element(*msg_dom)
        self.UTILS.test.test(error_msg, "Error message due to connection failure was found")
Пример #5
0
class test_main(GaiaTestCase):

    def setUp(self):

        # Set up child objects...
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.contacts = Contacts(self)
        self.loop = Loop(self)

        # Get details of our test contacts.
        self.contact = MockContact()
        curr_time = repr(time.time()).replace('.', '')
        self.contact['email'] = [self.contact['email']]
        self.contact['tel'] = [self.contact['tel']]
        self.contact['email'].append({
            'type': 'Job',
            'value': '{}@testmail.net'.format(curr_time)})
        self.contact['tel'].append({
            'type': 'Landline',
            'value': '91{}'.format(curr_time)})
        self.UTILS.general.insertContact(self.contact)
        self.data_layer.connect_to_wifi()

        self.loop.initial_test_checks()

        result = self.loop.wizard_or_login()
        if result:
            self.loop.phone_login()
            self.loop.allow_permission_phone_login()
            self.UTILS.element.waitForElements(DOM.Loop.app_header, "Loop main view")
        self.apps.kill_all()
        time.sleep(2)
        _ = setup_translations(self)

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

    def test_run(self):

        # Launch contacts app.
        self.contacts.launch()
        self.contacts.view_contact(self.contact['name'])
        video_btn = self.marionette.find_element(DOM.Contacts.view_contact_hello_option[0],
                                                 DOM.Contacts.view_contact_hello_option[1].format("video"))
        video_btn.tap()
        self.loop.share_micro_and_camera()
        not_user_str = _("Not a Firefox Hello user yet")
        not_user_dom = (DOM.Loop.not_a_hello_user_msg[0], DOM.Loop.not_a_hello_user_msg[1].format(not_user_str))
        self.wait_for_element_displayed(*not_user_dom, timeout=10)
        not_a_user_msg = self.marionette.find_element(*not_user_dom)
        self.UTILS.test.test(not_a_user_msg.text == not_user_str, "Message found: {} (Expected: {}".\
                             format(not_a_user_msg.text, not_user_str))
Пример #6
0
class test_main(GaiaTestCase):

    def setUp(self):

        # Set up child objects...
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.contacts = Contacts(self)
        self.loop = Loop(self)

        # Get details of our test contacts.
        self.contact = MockContact()
        self.UTILS.general.insertContact(self.contact)
        self.data_layer.connect_to_wifi()

        result = self.loop.initial_test_checks()

        if result:
            self.loop.phone_login()
            self.loop.allow_permission_phone_login()
            self.UTILS.element.waitForElements(DOM.Loop.app_header, "Loop main view")

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

        _ = setup_translations(self)
        self.expected_message = _("No problem! Just share the following link and they can call you back from"\
                                  " any browser.")

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

    def test_run(self):

        # Launch contacts app.
        self.contacts.launch()
        self.contacts.view_contact(self.contact['name'])
        video_btn = self.marionette.find_element(DOM.Contacts.view_contact_hello_option[0],
                                                 DOM.Contacts.view_contact_hello_option[1].format("video"))
        video_btn.tap()
        self.loop.share_micro_and_camera()
        self.wait_for_element_displayed(*DOM.Loop.not_a_user_explanation, timeout=10)
        not_a_user_explanation = self.marionette.find_element(*DOM.Loop.not_a_user_explanation)
        self.UTILS.test.test(not_a_user_explanation.text == self.expected_message, "Message found: {} (Expected: {}".\
                             format(not_a_user_explanation.text, self.expected_message))

        share_options = self.UTILS.element.getElements(DOM.Loop.share_link_options, "Sharing options")
        self.UTILS.test.test(len(share_options) == 3, "There are {} sharing options (Expected: 3)".\
                             format(len(share_options)))
        share_by_sms = self.UTILS.element.getElement(DOM.Loop.share_panel_sms_share, "Share by SMS")
        share_by_sms.tap()
        self.UTILS.iframe.switch_to_frame(*DOM.Messages.frame_locator)
        self.UTILS.element.getElement(DOM.Messages.target_numbers, "Message recipients")
Пример #7
0
class test_main(GaiaTestCase):
    def setUp(self):

        # Set up child objects...
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.contacts = Contacts(self)
        self.loop = Loop(self)

        # Insert test contact
        self.contact = MockContact()
        self.UTILS.general.insertContact(self.contact)
        _ = setup_translations(self)

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

    def test_run(self):

        # Launch contacts app.
        self.contacts.launch()
        self.contacts.view_contact(self.contact['name'])
        video_btn = self.marionette.find_element(
            DOM.Contacts.view_contact_hello_option[0],
            DOM.Contacts.view_contact_hello_option[1].format("video"))
        video_btn.tap()
        self.loop.share_micro_and_camera()
        self.marionette.switch_to_frame()
        msg_dom = (DOM.Loop.connection_error_msg[0],
                   DOM.Loop.connection_error_msg[1].format(
                       _("connection failure")))
        self.wait_for_element_displayed(*msg_dom, timeout=15)
        error_msg = self.marionette.find_element(*msg_dom)
        self.UTILS.test.test(
            error_msg, "Error message due to connection failure was found")
Пример #8
0
class test_main(GaiaTestCase):

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

    def setUp(self):

        # Set up child objects...
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.contacts = Contacts(self)
        self.email = Email(self)
        self.loop = Loop(self)

        self.email_add = self.UTILS.general.get_config_variable("gmail_2_email", "common")
        self.email_pass = self.UTILS.general.get_config_variable("gmail_2_pass", "common")
        self.email_user = self.UTILS.general.get_config_variable("gmail_2_user", "common")

        # Get details of our test contacts.
        self.contact = MockContact()
        self.UTILS.general.insertContact(self.contact)
        self.data_layer.connect_to_wifi()

        result = self.loop.initial_test_checks()

        if result:
            self.loop.phone_login()
            self.loop.allow_permission_phone_login()
            self.UTILS.element.waitForElements(DOM.Loop.app_header, "Loop main view")

        self.email.launch()
        self.email.setup_account(self.email_user, self.email_add, self.email_pass)
        self.apps.kill_all()
        time.sleep(2)

        _ = setup_translations(self)
        self.expected_message = _("No problem! Just share the following link and they can call you back from"\
                                  " any browser.")

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

    def test_run(self):

        # Launch contacts app.
        self.contacts.launch()
        self.contacts.view_contact(self.contact['name'])
        video_btn = self.marionette.find_element(DOM.Contacts.view_contact_hello_option[0],
                                                 DOM.Contacts.view_contact_hello_option[1].format("video"))
        video_btn.tap()
        self.loop.share_micro_and_camera()
        self.wait_for_element_displayed(*DOM.Loop.not_a_user_explanation, timeout=10)
        not_a_user_explanation = self.marionette.find_element(*DOM.Loop.not_a_user_explanation)
        self.UTILS.test.test(not_a_user_explanation.text == self.expected_message, "Message found: {} (Expected: {}".\
                             format(not_a_user_explanation.text, self.expected_message))

        share_options = self.UTILS.element.getElements(DOM.Loop.share_link_options, "Sharing options")
        self.UTILS.test.test(len(share_options) == 3, "There are {} sharing options (Expected: 3)".\
                             format(len(share_options)))
        share_by_email = self.UTILS.element.getElement(DOM.Loop.share_panel_email_share, "Share by Email")
        share_by_email.tap()
        self.UTILS.iframe.switch_to_frame(*DOM.Email.frame_locator)
        time.sleep(2)

        # Modify the message subject
        subject = self.UTILS.element.getElement(DOM.Email.compose_subject, "Subject input").get_attribute("value")
        self.UTILS.reporting.debug("*** Email Subject before editing: {}".format(subject))
        new_subject = " Editing subject"
        expected = subject + new_subject
        self.UTILS.general.typeThis(DOM.Email.compose_subject, "Subject input area", new_subject, p_clear=False,
                                    p_validate=False)
        subject_after = self.UTILS.element.getElement(DOM.Email.compose_subject, "Subject input").\
                                                        get_attribute("value")
        self.UTILS.test.test(expected == subject_after, "Expected subject: {} Actual subject: {}".\
                            format(expected, subject_after))

        # Modify the message body
        msg_body = self.UTILS.element.getElement(DOM.Email.compose_msg, "Input message area").text
        self.UTILS.reporting.debug("*** Email Body before editing: {}".format(msg_body))
        new_text = " This is more test in the Email"
        expected = msg_body + new_text
        self.UTILS.general.typeThis(DOM.Email.compose_msg, "Input message area",
                                   new_text, p_clear=False, p_validate=False)
        msg_body_after = self.UTILS.element.getElement(DOM.Email.compose_msg, "Input message area").text
        self.UTILS.test.test(expected == msg_body_after, "Expected text: {} Actual text: {}".\
                            format(expected, msg_body_after))
Пример #9
0
class test_main(GaiaTestCase):
    def __init__(self, *args, **kwargs):
        kwargs['restart'] = True
        super(test_main, self).__init__(*args, **kwargs)

    def setUp(self):

        # Set up child objects...
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.contacts = Contacts(self)
        self.email = Email(self)
        self.loop = Loop(self)

        self.email_add = self.UTILS.general.get_config_variable(
            "gmail_2_email", "common")
        self.email_pass = self.UTILS.general.get_config_variable(
            "gmail_2_pass", "common")
        self.email_user = self.UTILS.general.get_config_variable(
            "gmail_2_user", "common")

        # Get details of our test contacts.
        self.contact = MockContact()
        self.UTILS.general.insertContact(self.contact)
        self.data_layer.connect_to_wifi()

        result = self.loop.initial_test_checks()

        if result:
            self.loop.phone_login()
            self.loop.allow_permission_phone_login()
            self.UTILS.element.waitForElements(DOM.Loop.app_header,
                                               "Loop main view")

        self.email.launch()
        self.email.setup_account(self.email_user, self.email_add,
                                 self.email_pass)
        self.apps.kill_all()
        time.sleep(2)

        _ = setup_translations(self)
        self.expected_message = _("No problem! Just share the following link and they can call you back from"\
                                  " any browser.")

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

    def test_run(self):

        # Launch contacts app.
        self.contacts.launch()
        self.contacts.view_contact(self.contact['name'])
        video_btn = self.marionette.find_element(
            DOM.Contacts.view_contact_hello_option[0],
            DOM.Contacts.view_contact_hello_option[1].format("video"))
        video_btn.tap()
        self.loop.share_micro_and_camera()
        self.wait_for_element_displayed(*DOM.Loop.not_a_user_explanation,
                                        timeout=10)
        not_a_user_explanation = self.marionette.find_element(
            *DOM.Loop.not_a_user_explanation)
        self.UTILS.test.test(not_a_user_explanation.text == self.expected_message, "Message found: {} (Expected: {}".\
                             format(not_a_user_explanation.text, self.expected_message))

        share_options = self.UTILS.element.getElements(
            DOM.Loop.share_link_options, "Sharing options")
        self.UTILS.test.test(len(share_options) == 3, "There are {} sharing options (Expected: 3)".\
                             format(len(share_options)))
        share_by_email = self.UTILS.element.getElement(
            DOM.Loop.share_panel_email_share, "Share by email")
        share_by_email.tap()
        self.UTILS.iframe.switch_to_frame(*DOM.Email.frame_locator)
        to_address = self.UTILS.element.getElement(
            DOM.Email.compose_to_from_contacts, "Recipient Address")
        self.UTILS.test.test(to_address.text == self.contact['email']['value'], "Recipient address: {} Expected: {}".\
                             format(to_address.text, self.contact['email']['value']))
        subject = self.UTILS.element.getElement(DOM.Email.compose_subject,
                                                "Email subject")
        self.UTILS.test.test(subject.get_attribute("value") == "Firefox Hello", "Email subject: {} Expected:"\
                             " Firefox Hello".format(subject.get_attribute("value")))
        compose_msg = self.UTILS.element.getElement(DOM.Email.compose_msg,
                                                    "Message body")
        expected_body = _(
            "Click on the link and answer the call! https://hello.firefox.com/#call"
        )
        self.UTILS.test.test(expected_body in compose_msg.text, "Message body: {} Expected: {}".\
                             format(compose_msg.text, expected_body))
Пример #10
0
class test_main(GaiaTestCase):

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

    def setUp(self):

        # Set up child objects...
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.contacts = Contacts(self)
        self.email = Email(self)
        self.loop = Loop(self)

        self.email_add = self.UTILS.general.get_config_variable("gmail_2_email", "common")
        self.email_pass = self.UTILS.general.get_config_variable("gmail_2_pass", "common")
        self.email_user = self.UTILS.general.get_config_variable("gmail_2_user", "common")

        # Get details of our test contacts.
        self.contact = MockContact()
        self.UTILS.general.insertContact(self.contact)
        self.data_layer.connect_to_wifi()

        result = self.loop.initial_test_checks()

        if result:
            self.loop.phone_login()
            self.loop.allow_permission_phone_login()
            self.UTILS.element.waitForElements(DOM.Loop.app_header, "Loop main view")

        self.email.launch()
        self.email.setup_account(self.email_user, self.email_add, self.email_pass)
        self.apps.kill_all()
        time.sleep(2)

        _ = setup_translations(self)
        self.expected_message = _("No problem! Just share the following link and they can call you back from"\
                                  " any browser.")

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

    def test_run(self):

        # Launch contacts app.
        self.contacts.launch()
        self.contacts.view_contact(self.contact['name'])
        video_btn = self.marionette.find_element(DOM.Contacts.view_contact_hello_option[0],
                                                 DOM.Contacts.view_contact_hello_option[1].format("video"))
        video_btn.tap()
        self.loop.share_micro_and_camera()
        self.wait_for_element_displayed(*DOM.Loop.not_a_user_explanation, timeout=10)
        not_a_user_explanation = self.marionette.find_element(*DOM.Loop.not_a_user_explanation)
        self.UTILS.test.test(not_a_user_explanation.text == self.expected_message, "Message found: {} (Expected: {}".\
                             format(not_a_user_explanation.text, self.expected_message))

        share_options = self.UTILS.element.getElements(DOM.Loop.share_link_options, "Sharing options")
        self.UTILS.test.test(len(share_options) == 3, "There are {} sharing options (Expected: 3)".\
                             format(len(share_options)))
        share_by_email = self.UTILS.element.getElement(DOM.Loop.share_panel_email_share, "Share by email")
        share_by_email.tap()
        self.UTILS.iframe.switch_to_frame(*DOM.Email.frame_locator)
        to_address = self.UTILS.element.getElement(DOM.Email.compose_to_from_contacts, "Recipient Address")
        self.UTILS.test.test(to_address.text == self.contact['email']['value'], "Recipient address: {} Expected: {}".\
                             format(to_address.text, self.contact['email']['value']))
        subject = self.UTILS.element.getElement(DOM.Email.compose_subject, "Email subject")
        self.UTILS.test.test(subject.get_attribute("value") == "Firefox Hello", "Email subject: {} Expected:"\
                             " Firefox Hello".format(subject.get_attribute("value")))
        compose_msg = self.UTILS.element.getElement(DOM.Email.compose_msg, "Message body")
        expected_body = _("Click on the link and answer the call! https://hello.firefox.com/#call")
        self.UTILS.test.test(expected_body in compose_msg.text, "Message body: {} Expected: {}".\
                             format(compose_msg.text, expected_body))
Пример #11
0
class test_main(GaiaTestCase):
    def setUp(self):

        # Set up child objects...
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.contacts = Contacts(self)
        self.loop = Loop(self)

        # Get details of our test contacts.
        self.contact = MockContact()
        self.UTILS.general.insertContact(self.contact)
        self.data_layer.connect_to_wifi()

        result = self.loop.initial_test_checks()

        if result:
            self.loop.phone_login()
            self.loop.allow_permission_phone_login()
            self.UTILS.element.waitForElements(DOM.Loop.app_header,
                                               "Loop main view")

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

        _ = setup_translations(self)
        self.expected_message = _("No problem! Just share the following link and they can call you back from"\
                                  " any browser.")

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

    def test_run(self):

        # Launch contacts app.
        self.contacts.launch()
        self.contacts.view_contact(self.contact['name'])
        video_btn = self.marionette.find_element(
            DOM.Contacts.view_contact_hello_option[0],
            DOM.Contacts.view_contact_hello_option[1].format("video"))
        video_btn.tap()
        self.loop.share_micro_and_camera()
        self.wait_for_element_displayed(*DOM.Loop.not_a_user_explanation,
                                        timeout=10)
        not_a_user_explanation = self.marionette.find_element(
            *DOM.Loop.not_a_user_explanation)
        self.UTILS.test.test(not_a_user_explanation.text == self.expected_message, "Message found: {} (Expected: {}".\
                             format(not_a_user_explanation.text, self.expected_message))

        share_options = self.UTILS.element.getElements(
            DOM.Loop.share_link_options, "Sharing options")
        self.UTILS.test.test(len(share_options) == 3, "There are {} sharing options (Expected: 3)".\
                             format(len(share_options)))
        share_by_sms = self.UTILS.element.getElement(
            DOM.Loop.share_panel_sms_share, "Share by SMS")
        share_by_sms.tap()

        # Check recipient and body
        self.UTILS.iframe.switch_to_frame(*DOM.Messages.frame_locator)
        self.UTILS.element.getElement(DOM.Messages.target_numbers,
                                      "Message recipients")
        recipient_number = self.UTILS.element.getElement(
            DOM.Messages.target_numbers, "Recipient number")
        self.UTILS.test.test(recipient_number.text == self.contact['name'], "Recipient number: {} "\
                             "Expected: {}".format(recipient_number.text, self.contact['name']))
        compose_msg = self.UTILS.element.getElement(
            DOM.Messages.input_message_area, "Composer message body")
        expected_body = _(
            "Click on the link and answer the call! https://hello.firefox.com/#call"
        )
        self.UTILS.test.test(expected_body in compose_msg.text, "Message body: {} Expected: {}".\
                             format(compose_msg.text, expected_body))
Пример #12
0
class test_main(GaiaTestCase):
    def setUp(self):

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

        # Get details of our test contacts.
        self.contact = MockContact()
        self.contact['tel']['value'] = self.UTILS.general.get_config_variable(
            "target_call_number", "common")
        self.UTILS.general.insertContact(self.contact)
        self.data_layer.connect_to_wifi()

        result = self.loop.initial_test_checks()

        if result:
            self.loop.phone_login()
            self.loop.allow_permission_phone_login()
            self.UTILS.element.waitForElements(DOM.Loop.app_header,
                                               "Loop main view")

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

        _ = setup_translations(self)
        self.expected_message = _("No problem! Just share the following link and they can call you back from"\
                                  " any browser.")

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

    def test_run(self):

        # Launch contacts app.
        self.contacts.launch()
        self.contacts.view_contact(self.contact['name'])
        video_btn = self.marionette.find_element(
            DOM.Contacts.view_contact_hello_option[0],
            DOM.Contacts.view_contact_hello_option[1].format("video"))
        video_btn.tap()
        self.loop.share_micro_and_camera()
        self.wait_for_element_displayed(*DOM.Loop.not_a_user_explanation,
                                        timeout=10)
        not_a_user_explanation = self.marionette.find_element(
            *DOM.Loop.not_a_user_explanation)
        self.UTILS.test.test(not_a_user_explanation.text == self.expected_message, "Message found: {} (Expected: {}".\
                             format(not_a_user_explanation.text, self.expected_message))

        share_options = self.UTILS.element.getElements(
            DOM.Loop.share_link_options, "Sharing options")
        self.UTILS.test.test(len(share_options) == 3, "There are {} sharing options (Expected: 3)".\
                             format(len(share_options)))
        share_by_sms = self.UTILS.element.getElement(
            DOM.Loop.share_panel_sms_share, "Share by SMS")
        share_by_sms.tap()
        self.UTILS.iframe.switch_to_frame(*DOM.Messages.frame_locator)
        time.sleep(2)
        msg_body = self.UTILS.element.getElement(
            DOM.Messages.input_message_area, "Message body").text
        send_btn = self.UTILS.element.getElement(
            DOM.Messages.send_message_button, "Send button")
        send_btn.tap()
        self.messages.check_last_message_contents(msg_body)
        btn = self.UTILS.element.getElement(DOM.Messages.header_close_button,
                                            "Close button")
        btn.tap()
        self.UTILS.iframe.switch_to_frame(*DOM.Loop.frame_locator)
        self.UTILS.element.getElement(DOM.Loop.open_settings_btn,
                                      "Open settings button")
Пример #13
0
class test_main(GaiaTestCase):
    def setUp(self):

        # Set up child objects...
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.contacts = Contacts(self)
        self.loop = Loop(self)

        # Get details of our test contacts.
        self.contact = MockContact()
        self.UTILS.general.insertContact(self.contact)
        self.data_layer.connect_to_wifi()

        result = self.loop.initial_test_checks()

        if result:
            self.loop.phone_login()
            self.loop.allow_permission_phone_login()
            self.UTILS.element.waitForElements(DOM.Loop.app_header,
                                               "Loop main view")

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

        _ = setup_translations(self)
        self.expected_message = _("No problem! Just share the following link and they can call you back from"\
                                  " any browser.")

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

    def test_run(self):

        # Launch contacts app.
        self.contacts.launch()
        self.contacts.view_contact(self.contact['name'])
        video_btn = self.marionette.find_element(
            DOM.Contacts.view_contact_hello_option[0],
            DOM.Contacts.view_contact_hello_option[1].format("video"))
        video_btn.tap()
        self.loop.share_micro_and_camera()
        self.wait_for_element_displayed(*DOM.Loop.not_a_user_explanation,
                                        timeout=10)
        not_a_user_explanation = self.marionette.find_element(
            *DOM.Loop.not_a_user_explanation)
        self.UTILS.test.test(not_a_user_explanation.text == self.expected_message, "Message found: {} (Expected: {}".\
                             format(not_a_user_explanation.text, self.expected_message))

        share_options = self.UTILS.element.getElements(
            DOM.Loop.share_link_options, "Sharing options")
        self.UTILS.test.test(len(share_options) == 3, "There are {} sharing options (Expected: 3)".\
                             format(len(share_options)))
        share_by_sms = self.UTILS.element.getElement(
            DOM.Loop.share_panel_sms_share, "Share by SMS")
        share_by_sms.tap()
        self.UTILS.iframe.switch_to_frame(*DOM.Messages.frame_locator)
        time.sleep(2)
        msg_body = self.UTILS.element.getElement(
            DOM.Messages.input_message_area, "Input message area").text
        self.UTILS.reporting.debug(
            "*** SMS Body before editing: {}".format(msg_body))
        new_text = " This is more test in the SMS"
        expected = msg_body + new_text
        self.UTILS.general.typeThis(DOM.Messages.input_message_area,
                                    "Input message area",
                                    new_text,
                                    p_clear=False,
                                    p_validate=False)
        msg_body_after = self.UTILS.element.getElement(
            DOM.Messages.input_message_area, "Input message area")
        self.UTILS.test.test(expected == msg_body_after.text, "Expected text: {} Actual text: {}".\
                             format(expected, msg_body_after.text))
Пример #14
0
class test_main(GaiaTestCase):
    def __init__(self, *args, **kwargs):
        kwargs['restart'] = True
        super(test_main, self).__init__(*args, **kwargs)

    def setUp(self):

        # Set up child objects...
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.contacts = Contacts(self)
        self.email = Email(self)
        self.loop = Loop(self)

        self.email_add = self.UTILS.general.get_config_variable(
            "gmail_2_email", "common")
        self.email_pass = self.UTILS.general.get_config_variable(
            "gmail_2_pass", "common")
        self.email_user = self.UTILS.general.get_config_variable(
            "gmail_2_user", "common")

        # Get details of our test contacts.
        self.contact = MockContact()
        self.UTILS.general.insertContact(self.contact)
        self.data_layer.connect_to_wifi()

        result = self.loop.initial_test_checks()

        if result:
            self.loop.phone_login()
            self.loop.allow_permission_phone_login()
            self.UTILS.element.waitForElements(DOM.Loop.app_header,
                                               "Loop main view")

        self.email.launch()
        self.email.setup_account(self.email_user, self.email_add,
                                 self.email_pass)
        self.apps.kill_all()
        time.sleep(2)

        _ = setup_translations(self)
        self.expected_message = _("No problem! Just share the following link and they can call you back from"\
                                  " any browser.")

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

    def test_run(self):

        # Launch contacts app.
        self.contacts.launch()
        self.contacts.view_contact(self.contact['name'])
        video_btn = self.marionette.find_element(
            DOM.Contacts.view_contact_hello_option[0],
            DOM.Contacts.view_contact_hello_option[1].format("video"))
        video_btn.tap()
        self.loop.share_micro_and_camera()
        self.wait_for_element_displayed(*DOM.Loop.not_a_user_explanation,
                                        timeout=10)
        not_a_user_explanation = self.marionette.find_element(
            *DOM.Loop.not_a_user_explanation)
        self.UTILS.test.test(not_a_user_explanation.text == self.expected_message, "Message found: {} (Expected: {}".\
                             format(not_a_user_explanation.text, self.expected_message))

        share_options = self.UTILS.element.getElements(
            DOM.Loop.share_link_options, "Sharing options")
        self.UTILS.test.test(len(share_options) == 3, "There are {} sharing options (Expected: 3)".\
                             format(len(share_options)))
        share_by_email = self.UTILS.element.getElement(
            DOM.Loop.share_panel_email_share, "Share by Email")
        share_by_email.tap()
        self.UTILS.iframe.switch_to_frame(*DOM.Email.frame_locator)
        time.sleep(2)

        # Modify the message subject
        subject = self.UTILS.element.getElement(
            DOM.Email.compose_subject, "Subject input").get_attribute("value")
        self.UTILS.reporting.debug(
            "*** Email Subject before editing: {}".format(subject))
        new_subject = " Editing subject"
        expected = subject + new_subject
        self.UTILS.general.typeThis(DOM.Email.compose_subject,
                                    "Subject input area",
                                    new_subject,
                                    p_clear=False,
                                    p_validate=False)
        subject_after = self.UTILS.element.getElement(DOM.Email.compose_subject, "Subject input").\
                                                        get_attribute("value")
        self.UTILS.test.test(expected == subject_after, "Expected subject: {} Actual subject: {}".\
                            format(expected, subject_after))

        # Modify the message body
        msg_body = self.UTILS.element.getElement(DOM.Email.compose_msg,
                                                 "Input message area").text
        self.UTILS.reporting.debug(
            "*** Email Body before editing: {}".format(msg_body))
        new_text = " This is more test in the Email"
        expected = msg_body + new_text
        self.UTILS.general.typeThis(DOM.Email.compose_msg,
                                    "Input message area",
                                    new_text,
                                    p_clear=False,
                                    p_validate=False)
        msg_body_after = self.UTILS.element.getElement(
            DOM.Email.compose_msg, "Input message area").text
        self.UTILS.test.test(expected == msg_body_after, "Expected text: {} Actual text: {}".\
                            format(expected, msg_body_after))