Esempio n. 1
0
class main(GaiaTestCase):

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

        self.connect_to_network()

        self.loop.initial_test_checks()

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

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

    def test_run(self):
        # First, login
        self.loop.launch()
        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")
            time.sleep(5)
            self.loop.open_settings()
            self.loop.logout()

        # The user is not logged in, so no ID is available. The screen to authenticate
        # is shown instead
        phone_btn = self.marionette.find_element(*DOM.Loop.wizard_login_phone_number)
        self.UTILS.test.test(phone_btn, "Use phone number login button is present")
Esempio n. 2
0
class main(GaiaTestCase):

    def setUp(self):
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.loop = Loop(self)
        self.settings = Settings(self)

        self.connect_to_network()

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

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

    def test_run(self):
        # First, login not finished
        self.loop.launch()
        self.loop.wizard_or_login()

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

        # Now check for login to be prompted
        self.loop.launch()
        self.loop.wizard_or_login()
        self.UTILS.element.waitForElements(DOM.Loop.wizard_login, "Login options prompted")
Esempio n. 3
0
class main(GaiaTestCase):

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

        self.connect_to_network()

        self.loop.initial_test_checks()

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

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

    def test_run(self):
        # First, login
        self.loop.launch()

        # The user is not logged in, so no ID is available. The screen to authenticate
        # is shown instead
        ffox_btn = self.marionette.find_element(*DOM.Loop.wizard_login_ffox_account)
        self.UTILS.test.test(ffox_btn, "Use Firefox Accounts login button is present")
Esempio n. 4
0
class main(GaiaTestCase):
    def setUp(self):
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.loop = Loop(self)

        self.connect_to_network()

        self.loop.initial_test_checks()

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

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

    def test_run(self):
        # First, login
        self.loop.launch()
        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.loop.open_settings()
        selected_camera = self.marionette.find_element(
            *DOM.Loop.settings_selected_camera)
        front_str = _("Front")
        self.UTILS.test.test(selected_camera.text == front_str, "Default camera is {} (Expected: {})".\
                             format(selected_camera.text, front_str))
Esempio n. 5
0
class main(GaiaTestCase):
    def setUp(self):
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.loop = Loop(self)

        self.connect_to_network()

        self.loop.initial_test_checks()

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

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

    def test_run(self):
        # First, login
        self.loop.launch()

        # The user is not logged in, so no ID is available. The screen to authenticate
        # is shown instead
        ffox_btn = self.marionette.find_element(
            *DOM.Loop.wizard_login_ffox_account)
        self.UTILS.test.test(ffox_btn,
                             "Use Firefox Accounts login button is present")
Esempio n. 6
0
class main(GaiaTestCase):

    def setUp(self):
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.loop = Loop(self)
        self.settings = Settings(self)

        self.connect_to_network()

        self.loop.initial_test_checks()

        self.settings.launch()
        self.settings.fxa()
        self.settings.fxa_log_out()
        self.apps.kill_all()
        time.sleep(2)

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

    def test_run(self):
        self.loop.launch()
        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")
Esempio n. 7
0
class main(GaiaTestCase):

    def setUp(self):
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.loop = Loop(self)
        self.settings = Settings(self)

        self.fxa_user = self.UTILS.general.get_config_variable("fxa_user", "common")
        self.fxa_pass = self.UTILS.general.get_config_variable("fxa_pass", "common")
        self.connect_to_network()

        # Update loop
        self.loop.update_and_publish()

        self.loop.initial_test_checks()

        self.settings.launch()
        self.settings.fxa()
        self.settings.fxa_log_out()
        self.apps.kill_all()
        time.sleep(2)

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

    def test_run(self):
        self.loop.launch()
        result = self.loop.wizard_or_login()

        if result:
            self.loop.firefox_login(self.fxa_user, self.fxa_pass)
            self.loop.allow_permission_ffox_login()
            self.UTILS.element.waitForElements(DOM.Loop.app_header, "Loop main view")
Esempio n. 8
0
class main(GaiaTestCase):

    def setUp(self):
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.loop = Loop(self)
        self.settings = Settings(self)

        self.connect_to_network()

        self.loop.initial_test_checks()

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

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

    def test_run(self):
        # First, login
        self.loop.launch()
        result = self.loop.wizard_or_login()

        if result:
            self.loop.phone_login()
            # TODO: implement deny option
            self.loop.allow_permission_phone_login()
Esempio n. 9
0
class main(GaiaTestCase):

    def setUp(self):
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.loop = Loop(self)
        self.settings = Settings(self)

        self.fxa_user = self.UTILS.general.get_config_variable("fxa_user", "common")
        self.fxa_pass = self.UTILS.general.get_config_variable("fxa_pass", "common")

        self.connect_to_network()

        self.loop.initial_test_checks()

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

    def test_run(self):
        # First, login
        self.loop.launch()
        result = self.loop.wizard_or_login()

        if result:
            self.UTILS.element.waitForElements(DOM.Loop.wizard_login, "Loop login")
            self.UTILS.element.waitForNotElements(DOM.Loop.app_header, "Loop main view")
            self.UTILS.element.waitForNotElements(DOM.Loop.settings_panel, "Settings panel")
            self.UTILS.element.waitForNotElements(DOM.Loop.calls_section, "Call log")
            self.UTILS.element.waitForNotElements(DOM.Loop.shared_links_section, "Urls section")
Esempio n. 10
0
class main(GaiaTestCase):
    def setUp(self):
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.loop = Loop(self)
        self.settings = Settings(self)

        self.connect_to_network()

        self.loop.initial_test_checks()

        self.settings.launch()
        self.settings.fxa()
        self.settings.fxa_log_out()
        self.apps.kill_all()
        time.sleep(2)

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

    def test_run(self):
        self.loop.launch()
        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")
Esempio n. 11
0
class main(GaiaTestCase):
    def setUp(self):
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.loop = Loop(self)
        self.settings = Settings(self)

        self.connect_to_network()

        self.loop.initial_test_checks()

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

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

    def test_run(self):
        # First, login
        self.loop.launch()
        result = self.loop.wizard_or_login()

        if result:
            self.loop.phone_login()
            # TODO: implement deny option
            self.loop.allow_permission_phone_login()
Esempio n. 12
0
class main(GaiaTestCase):

    def setUp(self):
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.loop = Loop(self)
        self.settings = Settings(self)
        self.phone_number_without_prefix = self.UTILS.general.get_config_variable("phone_number", "custom")[3:]

        self.connect_to_network()

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

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

    def test_run(self):
        # First, login
        self.loop.launch()
        result = self.loop.wizard_or_login()

        if result:
            self.loop.phone_login_manually(self.phone_number_without_prefix)
            self.loop.allow_permission_phone_login()
            self.UTILS.element.waitForElements(DOM.Loop.app_header, "Loop main view")
Esempio n. 13
0
class main(GaiaTestCase):
    def setUp(self):
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.loop = Loop(self)
        self.settings = Settings(self)

        self.connect_to_network()

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

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

    def test_run(self):
        # First, login not finished
        self.loop.launch()
        self.loop.wizard_or_login()

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

        # Now check for login to be prompted
        self.loop.launch()
        self.loop.wizard_or_login()
        self.UTILS.element.waitForElements(DOM.Loop.wizard_login,
                                           "Login options prompted")
Esempio n. 14
0
class main(GaiaTestCase):

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

        self.connect_to_network()

        self.loop.initial_test_checks()

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

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

    def test_run(self):
        # First, login
        self.loop.launch()
        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.loop.open_settings()
        selected_camera = self.marionette.find_element(*DOM.Loop.settings_selected_camera)
        front_str = _("Front")
        self.UTILS.test.test(selected_camera.text == front_str, "Default camera is {} (Expected: {})".\
                             format(selected_camera.text, front_str))
Esempio n. 15
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")
Esempio n. 16
0
class main(GaiaTestCase):
    def setUp(self):
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.loop = Loop(self)
        self.settings = Settings(self)

        self.fxa_user_1 = self.UTILS.general.get_config_variable(
            "fxa_user", "common")
        self.fxa_pass_1 = self.UTILS.general.get_config_variable(
            "fxa_pass", "common")
        self.connect_to_network()

        self.loop.initial_test_checks()
        self.settings.launch()
        self.settings.fxa()

        if self.settings.is_fxa_logged_in():
            self.settings.fxa_log_out()
        self.settings.fxa_log_in(self.fxa_user_1, self.fxa_pass_1)

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

        # First, login with the first fxa
        self.loop.launch()
        result = self.loop.wizard_or_login()

        if result:
            self.loop.tap_on_firefox_login_button()

            self.UTILS.element.waitForElements(DOM.Loop.app_header,
                                               "Loop main view")
            self.loop.open_settings()
            self.loop.logout()

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

    def test_run(self):
        # Now logout of FxA via settings
        self.settings.launch()
        self.settings.fxa()
        self.settings.fxa_log_out()

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

        # And try to login in Loop
        self.loop.launch()
        result = self.loop.wizard_or_login()

        if result:
            self.loop.tap_on_firefox_login_button()
            self.UTILS.iframe.switchToFrame(
                *DOM.Loop.ffox_account_frame_locator)
            self.UTILS.element.waitForElements(
                DOM.Loop.ffox_account_login_title, "Firefox Accounts login")
Esempio n. 17
0
class main(GaiaTestCase):

    def setUp(self):
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.loop = Loop(self)
        self.settings = Settings(self)

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

        self.fxa_user = self.UTILS.general.get_config_variable("fxa_user", "common")
        self.fxa_pass = self.UTILS.general.get_config_variable("fxa_pass", "common")
        _ = setup_translations(self)
        self.expected_message = _("No problem! Just share the following link and they can call you back from"
                          " any browser.")


        self.connect_to_network()
        self.loop.initial_test_checks()
        self.settings.launch()
        self.settings.fxa()
        self.settings.fxa_log_out()
        self.apps.kill_all()
        time.sleep(2)

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

    def test_run(self):
        # First, login
        self.loop.launch()
        result = self.loop.wizard_or_login()

        if result:
            self.loop.firefox_login(self.fxa_user, self.fxa_pass)
            self.loop.allow_permission_ffox_login()
            self.UTILS.element.waitForElements(DOM.Loop.app_header, "Loop main view")

            self.loop.open_address_book()
            elem = (DOM.Contacts.view_all_contact_specific_contact[
                    0], DOM.Contacts.view_all_contact_specific_contact[1].format(self.test_contact["givenName"]))
            entry = self.UTILS.element.getElement(elem, "Contact in address book")
            entry.tap()

            self.UTILS.iframe.switch_to_active_frame()
            elem = (DOM.Loop.call_screen_contact_details[
                    0], DOM.Loop.call_screen_contact_details[1].format(self.test_contact["name"]))
            self.UTILS.element.waitForElements(elem, "Call to contact: {}".format(self.test_contact["name"]))

            time.sleep(5)
            self.apps.switch_to_displayed_app()
            self.UTILS.element.waitForElements(DOM.Loop.share_panel, "Share panel")

            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))
Esempio n. 18
0
class main(GaiaTestCase):

    def setUp(self):
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.loop = Loop(self)
        self.settings = Settings(self)

        self.scenario = "scenarios/urls/single/revoked/idb"
        self.aux_files_dir = self.UTILS.general.get_config_variable("aux_files", "loop")
        self.fxa_user = self.UTILS.general.get_config_variable("fxa_user", "common")
        self.fxa_pass = self.UTILS.general.get_config_variable("fxa_pass", "common")
        self.connect_to_network()

        # Insert our test contacts
        number_of_contacts = 3
        contact_given = "Test"
        contact_family = map(str, range(1, number_of_contacts + 1))
        contact_name = ["{} {}".format(contact_given, contact_family[i])
                        for i in range(number_of_contacts)]
        contact_numbers = ["666666666666", "777777777777", "888888888888"]

        test_contacts = [MockContact(name=contact_name[i], givenName=contact_given,
                                     familyName=contact_family[i],
                                     tel={'type': 'Mobile', 'value': contact_numbers[i]})
                         for i in range(number_of_contacts)]
        map(self.UTILS.general.insertContact, test_contacts)

        self.loop.initial_test_checks()

        # Make sure we're not logged in FxA
        self.settings.launch()
        self.settings.fxa()
        self.settings.fxa_log_out()

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

    def test_run(self):
        self.loop.launch()
        # This needs to be done at this point, bcs if the app is freshly installed the persistence
        # directories are not in its place until the app is launched for the first time
        self.loop.update_db("{}/{}".format(self.aux_files_dir, self.scenario))
        result = self.loop.wizard_or_login()

        if result:
            self.loop.firefox_login(self.fxa_user, self.fxa_pass)
            self.loop.allow_permission_ffox_login()
            self.UTILS.element.waitForElements(DOM.Loop.app_header, "Loop main view")

        self.loop.switch_to_urls()
        self.loop.open_settings()
        self.loop.delete_just_revoked(cancel=False)

        self.UTILS.element.waitForElements(DOM.Loop.call_log, "Check we are returned to the call log")
        current = self.loop.get_number_of_revoked_urls()
        self.UTILS.test.test(current == 0, "Check that after deleting the URL, we have one less")
Esempio n. 19
0
class main(GaiaTestCase):

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

        self.test_contact = MockContact(givenName="QA", familyName="Automation")
        self.fxa_user = self.UTILS.general.get_config_variable("fxa_user", "common")
        self.fxa_pass = self.UTILS.general.get_config_variable("fxa_pass", "common")
        _ = setup_translations(self)
        self.expected_msg = _("This contact does not have either a phone number or an email address.")

        self.contacts.launch()
        self.contacts.start_create_new_contact()
        cont_fields = self.contacts.get_contact_fields()
        self.contacts.replace_str(cont_fields['givenName'], self.test_contact['givenName'])
        self.contacts.replace_str(cont_fields['familyName'], self.test_contact['familyName'])
        done_button = self.UTILS.element.getElement(DOM.Contacts.done_button, "'Done' button")
        done_button.tap()

        self.connect_to_network()
        self.loop.initial_test_checks()
        self.settings.launch()
        self.settings.fxa()
        self.settings.fxa_log_out()
        self.apps.kill_all()
        time.sleep(2)

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

    def test_run(self):
        # First, login
        self.loop.launch()
        result = self.loop.wizard_or_login()

        if result:
            self.loop.firefox_login(self.fxa_user, self.fxa_pass)
            self.loop.allow_permission_ffox_login()
            self.UTILS.element.waitForElements(DOM.Loop.app_header, "Loop main view")

            self.loop.open_address_book()
            elem = (DOM.Contacts.view_all_contact_specific_contact[
                    0], DOM.Contacts.view_all_contact_specific_contact[1].format(self.test_contact["givenName"]))
            entry = self.UTILS.element.getElement(elem, "Contact in address book")
            entry.tap()

            time.sleep(5)
            self.marionette.switch_to_frame()
            title = self.UTILS.element.getElement(DOM.GLOBAL.modal_dialog_alert_title, "Error title")
            msg = self.UTILS.element.getElement(DOM.GLOBAL.modal_dialog_alert_msg, "Error message")
            self.UTILS.test.test(title.text == "Firefox Hello", "Error title matches")
            self.UTILS.test.test(msg.text == self.expected_msg, "Error message matches")
Esempio n. 20
0
class main(GaiaTestCase):

    def setUp(self):
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.loop = Loop(self)
        self.settings = Settings(self)
        self.fxa_user = self.UTILS.general.get_config_variable("fxa_user", "common")
        self.fxa_pass = self.UTILS.general.get_config_variable("fxa_pass", "common")
        self.fxa_user2 = self.UTILS.general.get_config_variable("fxa_user2", "common")
        self.fxa_pass2 = self.UTILS.general.get_config_variable("fxa_pass2", "common")

        self.connect_to_network()

        self.loop.initial_test_checks()
        self.logout_fxa()
        self.apps.kill_all()
        time.sleep(2)

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

    def test_run(self):
        # First, login
        self.loop.launch()
        result = self.loop.wizard_or_login()

        if result:
            self.loop.firefox_login(self.fxa_user2, self.fxa_pass2)
            self.loop.allow_permission_ffox_login()
            self.UTILS.element.waitForElements(DOM.Loop.app_header, "Loop main view")
            time.sleep(5)
            self.loop.open_settings()
            self.loop.logout()

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

        self.loop.launch()
        result = self.loop.wizard_or_login()
        if result:
            self.loop.firefox_login(self.fxa_user, self.fxa_pass)

        self.UTILS.iframe.switch_to_frame(*DOM.Loop.frame_locator)
        self.loop.open_settings()
        login_info_elem = self.UTILS.element.getElement(DOM.Loop.settings_logged_as, "Login info")
        login_info = login_info_elem.text.split("\n")[-1]

        self.UTILS.test.test(login_info == self.fxa_user, "Login info matches [FxA]")

    def logout_fxa(self):
        self.settings.launch()
        self.settings.fxa()
        self.settings.fxa_log_out()
Esempio n. 21
0
class main(GaiaTestCase):
    def setUp(self):
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.loop = Loop(self)
        self.settings = Settings(self)

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

        self.fxa_user = self.UTILS.general.get_config_variable(
            "fxa_user", "common")
        self.fxa_pass = self.UTILS.general.get_config_variable(
            "fxa_pass", "common")

        self.connect_to_network()
        self.loop.initial_test_checks()
        self.settings.launch()
        self.settings.fxa()
        self.settings.fxa_log_out()
        self.apps.kill_all()
        time.sleep(2)

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

    def test_run(self):
        # First, login
        self.loop.launch()
        result = self.loop.wizard_or_login()

        if result:
            self.loop.firefox_login(self.fxa_user, self.fxa_pass)
            self.loop.allow_permission_ffox_login()
            self.UTILS.element.waitForElements(DOM.Loop.app_header,
                                               "Loop main view")

            self.loop.open_settings()
            self.loop.change_call_mode("Video")
            self.loop.settings_go_back()

            self.loop.open_address_book()
            elem = (DOM.Contacts.view_all_contact_specific_contact[0],
                    DOM.Contacts.view_all_contact_specific_contact[1].format(
                        self.test_contact["givenName"]))
            entry = self.UTILS.element.getElement(elem,
                                                  "Contact in address book")
            entry.tap()

            self.UTILS.iframe.switch_to_active_frame()
            video_mode = self.UTILS.element.getElement(
                DOM.Loop.call_screen_video_mode, "Video")
            self.UTILS.test.test(
                not "setting-disabled" in video_mode.get_attribute("class"),
                "Video is disabled when call mode is set to 'Audio'")
Esempio n. 22
0
class main(GaiaTestCase):
    def setUp(self):
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.loop = Loop(self)
        self.settings = Settings(self)
        self.fxa_user = self.UTILS.general.get_config_variable(
            "fxa_user", "common")
        self.fxa_pass = self.UTILS.general.get_config_variable(
            "fxa_pass", "common")

        self.connect_to_network()

        self.loop.initial_test_checks()

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

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

    def test_run(self):
        # First, login
        self.loop.launch()
        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")
            time.sleep(5)
            self.loop.open_settings()
            self.loop.logout()

        self.loop.launch()
        result = self.loop.wizard_or_login()
        if result:
            self.loop.firefox_login(self.fxa_user, self.fxa_pass)

        self.UTILS.iframe.switch_to_frame(*DOM.Loop.frame_locator)
        self.loop.open_settings()
        login_info_elem = self.UTILS.element.getElement(
            DOM.Loop.settings_logged_as, "Login info")
        login_info = login_info_elem.text.split("\n")[-1]

        self.UTILS.test.test(login_info == self.fxa_user,
                             "Login info matches [FxA]")

    def logout_fxa(self):
        self.settings.launch()
        self.settings.fxa()
        self.settings.fxa_log_out()
Esempio n. 23
0
class main(GaiaTestCase):

    def setUp(self):
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.loop = Loop(self)
        self.settings = Settings(self)

        self.fxa_user_1 = self.UTILS.general.get_config_variable("fxa_user", "common")
        self.fxa_pass_1 = self.UTILS.general.get_config_variable("fxa_pass", "common")
        self.connect_to_network()

        self.loop.initial_test_checks()
        self.settings.launch()
        self.settings.fxa()

        if self.settings.is_fxa_logged_in():
            self.settings.fxa_log_out()
        self.settings.fxa_log_in(self.fxa_user_1, self.fxa_pass_1)

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

        # First, login with the first fxa
        self.loop.launch()
        result = self.loop.wizard_or_login()

        if result:
            self.loop.tap_on_firefox_login_button()

            self.UTILS.element.waitForElements(DOM.Loop.app_header, "Loop main view")
            self.loop.open_settings()
            self.loop.logout()

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

    def test_run(self):
        # Now logout of FxA via settings
        self.settings.launch()
        self.settings.fxa()
        self.settings.fxa_log_out()

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

        # And try to login in Loop
        self.loop.launch()
        result = self.loop.wizard_or_login()

        if result:
            self.loop.tap_on_firefox_login_button()
            self.UTILS.iframe.switchToFrame(*DOM.Loop.ffox_account_frame_locator)
            self.UTILS.element.waitForElements(DOM.Loop.ffox_account_login_title, "Firefox Accounts login")
Esempio n. 24
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))
Esempio n. 25
0
class main(GaiaTestCase):

    def setUp(self):
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.loop = Loop(self)
        self.settings = Settings(self)

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

        self.fxa_user = self.UTILS.general.get_config_variable("fxa_user", "common")
        self.fxa_pass = self.UTILS.general.get_config_variable("fxa_pass", "common")

        self.connect_to_network()
        self.loop.initial_test_checks()
        self.settings.launch()
        self.settings.fxa()
        self.settings.fxa_log_out()
        self.apps.kill_all()
        time.sleep(2)

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

    def test_run(self):
        # First, login
        self.loop.launch()
        result = self.loop.wizard_or_login()

        if result:
            self.loop.firefox_login(self.fxa_user, self.fxa_pass)
            self.loop.allow_permission_ffox_login()
            self.UTILS.element.waitForElements(DOM.Loop.app_header, "Loop main view")

            self.loop.open_settings()
            self.loop.change_call_mode("Audio")
            self.loop.settings_go_back()

            self.loop.open_address_book()
            elem = (DOM.Contacts.view_all_contact_specific_contact[
                    0], DOM.Contacts.view_all_contact_specific_contact[1].format(self.test_contact["givenName"]))
            entry = self.UTILS.element.getElement(elem, "Contact in address book")
            entry.tap()

            self.UTILS.iframe.switch_to_active_frame()
            video_mode = self.UTILS.element.getElement(DOM.Loop.call_screen_video_mode, "Video")
            self.UTILS.test.test("setting-disabled" in video_mode.get_attribute("class"), "Video is disabled when call mode is set to 'Audio'")
Esempio n. 26
0
class main(GaiaTestCase):
    def setUp(self):
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.loop = Loop(self)
        self.settings = Settings(self)

        self.connect_to_network()

        self.fxa_user = self.UTILS.general.get_config_variable(
            "fxa_user", "common")
        self.fxa_pass = self.UTILS.general.get_config_variable(
            "fxa_pass", "common")

        self.loop.initial_test_checks()
        self.logout_fxa()

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

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

    def test_run(self):
        # First, login
        self.loop.launch()
        result = self.loop.wizard_or_login()

        if result:
            self.loop.firefox_login(self.fxa_user, self.fxa_pass)
            self.loop.allow_permission_ffox_login()
            self.UTILS.element.waitForElements(DOM.Loop.app_header,
                                               "Loop main view")
            time.sleep(5)
            self.loop.open_settings()
            self.loop.logout()

        # The user is not logged in, so no ID is available. The screen to authenticate
        # is shown instead
        phone_btn = self.marionette.find_element(
            *DOM.Loop.wizard_login_phone_number)
        self.UTILS.test.test(phone_btn,
                             "Use phone number login button is present")

    def logout_fxa(self):
        self.settings.launch()
        self.settings.fxa()
        self.settings.fxa_log_out()
Esempio n. 27
0
class main(GaiaTestCase):
    def setUp(self):
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.loop = Loop(self)
        self.settings = Settings(self)
        _ = setup_translations(self)

        self.fxa_user = self.UTILS.general.get_config_variable(
            "fxa_user", "common")
        self.fxa_fake_pass = "******"
        self.expected_error_msg = _("Invalid Password")

        self.connect_to_network()

        self.loop.initial_test_checks()

        # Make sure we're not already logged in
        self.settings.launch()
        self.settings.fxa()
        self.settings.fxa_log_out()
        self.apps.kill_all()
        time.sleep(2)

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

    def test_run(self):
        # First, login
        self.loop.launch()
        result = self.loop.wizard_or_login()

        if result:
            self.loop.firefox_login(self.fxa_user,
                                    self.fxa_fake_pass,
                                    is_wrong=True)

            # We're informed of a wrong log in
            self.UTILS.element.waitForElements(
                DOM.Loop.ffox_account_error_overlay, "Error overlay")
            error_msg = self.UTILS.element.getElement(
                DOM.Loop.ffox_account_error_overlay_title,
                "Error overlay title")
            self.UTILS.test.test(error_msg.text == self.expected_error_msg,
                                 "Invalid password message is shown")
            self.UTILS.element.waitForNotElements(DOM.Loop.app_header,
                                                  "Loop main view")
Esempio n. 28
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)))
Esempio n. 29
0
class main(GaiaTestCase):

    def setUp(self):
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.loop = Loop(self)
        self.settings = Settings(self)

        self.fxa_user = self.UTILS.general.get_config_variable("fxa_user", "common")
        self.fxa_pass = self.UTILS.general.get_config_variable("fxa_pass", "common")
        self.connect_to_network()

        self.loop.initial_test_checks()
        self.settings.launch()
        self.settings.fxa()
        if self.settings.is_fxa_logged_in():
            self.settings.fxa_log_out()

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

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

    def test_run(self):
        # First, login
        self.loop.launch()
        result = self.loop.wizard_or_login()

        if result:
            self.loop.firefox_login(self.fxa_user, self.fxa_pass)
            self.loop.allow_permission_ffox_login()
            self.UTILS.element.waitForElements(DOM.Loop.app_header, "Loop main view")

        # Now logout
        self.loop.open_settings()
        self.loop.logout()

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

        # Now check for login to be prompted
        self.loop.launch()
        self.loop.wizard_or_login()

        self.UTILS.element.waitForElements(DOM.Loop.wizard_login, "Login options prompted")
Esempio n. 30
0
class main(GaiaTestCase):
    def setUp(self):
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.loop = Loop(self)
        self.settings = Settings(self)

        self.connect_to_network()

        self.loop.initial_test_checks()

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

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

    def test_run(self):
        # First, login
        self.loop.launch()
        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")

        # Logout, login, and check permissio overlay is not shown ever ever again
        self.loop.open_settings()
        self.loop.logout()

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

        self.loop.launch()
        result = self.loop.wizard_or_login()
        if result:
            self.loop.phone_login()
            self.UTILS.element.waitForNotElements(
                DOM.GLOBAL.app_permission_dialog,
                "Permission dialog",
                timeout=10)
            self.UTILS.element.waitForElements(DOM.Loop.app_header,
                                               "Loop main view",
                                               timeout=10)
Esempio n. 31
0
class main(GaiaTestCase):
    def setUp(self):
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.loop = Loop(self)
        self.settings = Settings(self)
        self.test_contact = MockContact()
        self.fxa_user = self.UTILS.general.get_config_variable(
            "fxa_user", "common")
        self.fxa_pass = self.UTILS.general.get_config_variable(
            "fxa_pass", "common")

        self.test_contact["givenName"] = "This is a very looooooooooooong name"
        self.test_contact["familyName"] = "Test"
        self.test_contact["name"] = "{} {}".format(
            self.test_contact["givenName"], self.test_contact["familyName"])

        self.UTILS.general.insertContact(self.test_contact)

        self.connect_to_network()
        self.loop.initial_test_checks()
        self.settings.launch()
        self.settings.fxa()
        self.settings.fxa_log_out()
        self.apps.kill_all()
        time.sleep(2)

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

    def test_run(self):
        # First, login
        self.loop.launch()
        result = self.loop.wizard_or_login()

        if result:
            self.loop.firefox_login(self.fxa_user, self.fxa_pass)
            self.loop.allow_permission_ffox_login()
            self.UTILS.element.waitForElements(DOM.Loop.app_header,
                                               "Loop main view")

            self.loop.open_address_book()
            elem = (DOM.Contacts.view_all_contact_specific_contact[0],
                    DOM.Contacts.view_all_contact_specific_contact[1].format(
                        self.test_contact["givenName"]))
            self.UTILS.element.waitForElements(elem, "Contact in address book")
Esempio n. 32
0
class main(GaiaTestCase):
    def setUp(self):
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.loop = Loop(self)
        self.settings = Settings(self)

        self.connect_to_network()

        self.loop.initial_test_checks()

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

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

    def test_run(self):
        # First, login
        self.loop.launch()
        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.loop.open_settings()
        cameras = self.marionette.find_element(
            *DOM.Loop.settings_select_camera)
        options = cameras.find_elements('css selector', 'option')
        if len(options) > 0:
            self.UTILS.reporting.debug(
                "*** Found {} options for camera".format(len(options)))
            default_mode = self.marionette.find_element(
                *DOM.Loop.settings_selected_call_mode)
            self.UTILS.reporting.debug("*** Default call mode: {}".format(
                default_mode.text))
            video_str = _("Video")
            self.UTILS.test.test(default_mode.text == video_str, "Default call mode is {} (Expected: {})".\
                                 format(default_mode.text, video_str))
        else:
            self.UTILS.reporting.debug("No camera detected")
Esempio n. 33
0
class main(GaiaTestCase):

    def setUp(self):
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.loop = Loop(self)
        self.settings = Settings(self)
        self.test_contact = MockContact()
        self.fxa_user = self.UTILS.general.get_config_variable("fxa_user", "common")
        self.fxa_pass = self.UTILS.general.get_config_variable("fxa_pass", "common")


        self.test_contact["givenName"] = "This is a very looooooooooooong name"
        self.test_contact["familyName"] = "Test"
        self.test_contact["name"] = "{} {}".format(
            self.test_contact["givenName"], self.test_contact["familyName"])

        self.UTILS.general.insertContact(self.test_contact)

        self.connect_to_network()    
        self.loop.initial_test_checks()
        self.settings.launch()
        self.settings.fxa()
        self.settings.fxa_log_out()
        self.apps.kill_all()
        time.sleep(2)

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

    def test_run(self):
        # First, login
        self.loop.launch()
        result = self.loop.wizard_or_login()

        if result:
            self.loop.firefox_login(self.fxa_user, self.fxa_pass)
            self.loop.allow_permission_ffox_login()
            self.UTILS.element.waitForElements(DOM.Loop.app_header, "Loop main view")

            self.loop.open_address_book()
            elem = (DOM.Contacts.view_all_contact_specific_contact[
                    0], DOM.Contacts.view_all_contact_specific_contact[1].format(self.test_contact["givenName"]))
            self.UTILS.element.waitForElements(elem, "Contact in address book")
Esempio n. 34
0
class main(GaiaTestCase):

    def setUp(self):
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.loop = Loop(self)
        self.settings = Settings(self)

        self.connect_to_network()

        self.loop.initial_test_checks()

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

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

    def test_run(self):
        # First, login
        self.loop.launch()
        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.loop.open_settings()
        cameras = self.marionette.find_element(*DOM.Loop.settings_select_camera)
        options = cameras.find_elements('css selector', 'option')
        if len(options) > 0:
            self.UTILS.reporting.debug("*** Found {} options for camera".format(len(options)))
            default_mode = self.marionette.find_element(*DOM.Loop.settings_selected_call_mode)
            self.UTILS.reporting.debug("*** Default call mode: {}".format(default_mode.text))
            video_str = _("Video")
            self.UTILS.test.test(default_mode.text == video_str, "Default call mode is {} (Expected: {})".\
                                 format(default_mode.text, video_str))
        else:
            self.UTILS.reporting.debug("No camera detected")
Esempio n. 35
0
class main(GaiaTestCase):

    def setUp(self):
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.loop = Loop(self)
        self.settings = Settings(self)

        self.connect_to_network()

        self.loop.initial_test_checks()

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

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

    def test_run(self):
        # First, login
        self.loop.launch()
        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")

        # Logout, login, and check permissio overlay is not shown ever ever again
        self.loop.open_settings()
        self.loop.logout()

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

        self.loop.launch()
        result = self.loop.wizard_or_login()
        if result:
            self.loop.phone_login()
            self.UTILS.element.waitForNotElements(DOM.GLOBAL.app_permission_dialog, "Permission dialog", timeout=10)
            self.UTILS.element.waitForElements(DOM.Loop.app_header, "Loop main view", timeout=10)
Esempio n. 36
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")
Esempio n. 37
0
class main(GaiaTestCase):

    def setUp(self):
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.loop = Loop(self)
        self.settings = Settings(self)
        _ = setup_translations(self)

        self.fxa_user = self.UTILS.general.get_config_variable("fxa_user", "common")
        self.fxa_fake_pass = "******"
        self.expected_error_msg = _("Invalid Password")

        self.connect_to_network()

        self.loop.initial_test_checks()

        # Make sure we're not already logged in
        self.settings.launch()
        self.settings.fxa()
        self.settings.fxa_log_out()
        self.apps.kill_all()
        time.sleep(2)

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

    def test_run(self):
        # First, login
        self.loop.launch()
        result = self.loop.wizard_or_login()

        if result:
            self.loop.firefox_login(self.fxa_user, self.fxa_fake_pass, is_wrong=True)

            # We're informed of a wrong log in
            self.UTILS.element.waitForElements(DOM.Loop.ffox_account_error_overlay, "Error overlay")
            error_msg = self.UTILS.element.getElement(DOM.Loop.ffox_account_error_overlay_title, "Error overlay title")
            self.UTILS.test.test(error_msg.text == self.expected_error_msg, "Invalid password message is shown")
            self.UTILS.element.waitForNotElements(DOM.Loop.app_header, "Loop main view")
Esempio n. 38
0
class main(GaiaTestCase):
    def setUp(self):
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.loop = Loop(self)
        self.settings = Settings(self)

        self.connect_to_network()

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

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

    def test_run(self):
        # First, login
        self.loop.launch()
        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")

        # Now logout
        self.loop.open_settings()
        self.loop.logout()

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

        # Now check for login to be prompted
        self.loop.launch()
        self.loop.wizard_or_login()

        self.UTILS.element.waitForElements(DOM.Loop.wizard_login,
                                           "Login options prompted")
Esempio n. 39
0
class main(GaiaTestCase):
    def setUp(self):
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.loop = Loop(self)
        self.settings = Settings(self)
        self.phone_number = self.UTILS.general.get_config_variable(
            "phone_number", "custom")

        self.connect_to_network()

        self.loop.initial_test_checks()

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

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

    def test_run(self):
        # First, login
        self.loop.launch()
        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")

        # Now logout
        self.loop.open_settings()
        login_info_elem = self.UTILS.element.getElement(
            DOM.Loop.settings_logged_as, "Login info")
        login_info = login_info_elem.text.split("\n")[-1]
        self.UTILS.reporting.logResult('info',
                                       "Login info: {}".format(login_info))
        self.UTILS.test.test(login_info == self.phone_number,
                             "Login info matches [MSISDN]")
Esempio n. 40
0
class main(GaiaTestCase):

    def setUp(self):
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.loop = Loop(self)
        self.settings = Settings(self)

        self.connect_to_network()

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

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

    def test_run(self):
        # First, login
        self.loop.launch()
        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")

        # Now logout
        self.loop.open_settings()
        self.loop.logout()

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

        # Now check for login to be prompted
        self.loop.launch()
        self.loop.wizard_or_login()

        self.UTILS.element.waitForElements(DOM.Loop.wizard_login, "Login options prompted")
Esempio n. 41
0
class main(GaiaTestCase):

    def setUp(self):
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.loop = Loop(self)
        self.settings = Settings(self)

        self.fxa_user = self.UTILS.general.get_config_variable("fxa_user", "common")
        self.fxa_pass = self.UTILS.general.get_config_variable("fxa_pass", "common")

        self.connect_to_network()

        self.loop.initial_test_checks()
        self._do_fxa_logout()

    def _do_fxa_logout(self):
        self.settings.launch()
        self.settings.fxa()
        self.settings.fxa_log_out()
        self.apps.kill_all()
        time.sleep(2)

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

    def test_run(self):
        # First, login
        self.loop.launch()
        result = self.loop.wizard_or_login()

        if result:
            self.loop.tap_on_firefox_login_button()
            self.UTILS.iframe.switchToFrame(*DOM.Loop.ffox_account_frame_locator)
            self.UTILS.element.waitForElements(DOM.Loop.ffox_account_login_title, "Firefox Accounts login")
Esempio n. 42
0
class main(GaiaTestCase):
    def setUp(self):
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.loop = Loop(self)
        self.settings = Settings(self)

        self.fxa_user = self.UTILS.general.get_config_variable(
            "fxa_user", "common")
        self.fxa_pass = self.UTILS.general.get_config_variable(
            "fxa_pass", "common")

        self.connect_to_network()

        self.loop.initial_test_checks()

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

    def test_run(self):
        # First, login
        self.loop.launch()
        result = self.loop.wizard_or_login()

        if result:
            self.UTILS.element.waitForElements(DOM.Loop.wizard_login,
                                               "Loop login")
            self.UTILS.element.waitForNotElements(DOM.Loop.app_header,
                                                  "Loop main view")
            self.UTILS.element.waitForNotElements(DOM.Loop.settings_panel,
                                                  "Settings panel")
            self.UTILS.element.waitForNotElements(DOM.Loop.calls_section,
                                                  "Call log")
            self.UTILS.element.waitForNotElements(
                DOM.Loop.shared_links_section, "Urls section")
Esempio n. 43
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))
Esempio n. 44
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))
Esempio n. 45
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))
Esempio n. 46
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))
Esempio n. 47
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))
Esempio n. 48
0
class main(GaiaTestCase):

    def setUp(self):
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.loop = Loop(self)
        self.contacts = Contacts(self)
        self.settings = Settings(self)
        self.fxa_user = self.UTILS.general.get_config_variable("fxa_user", "common")
        self.fxa_pass = self.UTILS.general.get_config_variable("fxa_pass", "common")

        self.target_name = "QA"
        self.test_contacts = [MockContact() for i in range(3)]
        self.test_contacts[0]["givenName"] = self.target_name
        self.test_contacts[0]["familyName"] = "Automation"
        self.test_contacts[0]["name"] = "{} {}".format(
            self.test_contacts[0]["givenName"], self.test_contacts[0]["familyName"])
        map(self.UTILS.general.insertContact, self.test_contacts)
    
        self.contacts.launch()
        self._add_contact_as_favorite(self.test_contacts[0])

        self.connect_to_network()
        self.loop.initial_test_checks()
        self.settings.launch()
        self.settings.fxa()
        self.settings.fxa_log_out()
        self.apps.kill_all()
        time.sleep(2)

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

    def test_run(self):
        # First, login
        self.loop.launch()
        result = self.loop.wizard_or_login()

        if result:
            self.loop.firefox_login(self.fxa_user, self.fxa_pass)
            self.loop.allow_permission_ffox_login()
            self.UTILS.element.waitForElements(DOM.Loop.app_header, "Loop main view")

            self.loop.open_address_book()
            elem = (DOM.Contacts.view_all_contact_specific_contact[
                    0], DOM.Contacts.view_all_contact_specific_contact[1].format(self.test_contacts[0]["givenName"]))
            self.UTILS.element.waitForElements(elem, "Contact in address book")

    def _add_contact_as_favorite(self, contact):
        self.contacts.view_contact(contact['name'])

        favorite_btn = self.UTILS.element.getElement(DOM.Contacts.favourite_button, "Favourite toggle button")
        favorite_btn.tap()

        back_btn = self.UTILS.element.getElement(DOM.Contacts.details_back_button, "Back button")
        back_btn.tap()

        string = "{}{}".format(contact['givenName'], contact['familyName']).upper()
        favs = ("xpath", DOM.Contacts.favourites_list_xpath.format(string))
        self.UTILS.element.waitForElements(favs, "'" + contact['name'] + "' in the favourites list")
Esempio n. 49
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))
Esempio n. 50
0
class main(GaiaTestCase):
    def setUp(self):
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.loop = Loop(self)
        self.contacts = Contacts(self)
        self.settings = Settings(self)
        self.fxa_user = self.UTILS.general.get_config_variable(
            "fxa_user", "common")
        self.fxa_pass = self.UTILS.general.get_config_variable(
            "fxa_pass", "common")

        self.target_name = "QA"
        self.test_contacts = [MockContact() for i in range(3)]
        self.test_contacts[0]["givenName"] = self.target_name
        self.test_contacts[0]["familyName"] = "Automation"
        self.test_contacts[0]["name"] = "{} {}".format(
            self.test_contacts[0]["givenName"],
            self.test_contacts[0]["familyName"])
        map(self.UTILS.general.insertContact, self.test_contacts)

        self.contacts.launch()
        self._add_contact_as_favorite(self.test_contacts[0])

        self.connect_to_network()
        self.loop.initial_test_checks()
        self.settings.launch()
        self.settings.fxa()
        self.settings.fxa_log_out()
        self.apps.kill_all()
        time.sleep(2)

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

    def test_run(self):
        # First, login
        self.loop.launch()
        result = self.loop.wizard_or_login()

        if result:
            self.loop.firefox_login(self.fxa_user, self.fxa_pass)
            self.loop.allow_permission_ffox_login()
            self.UTILS.element.waitForElements(DOM.Loop.app_header,
                                               "Loop main view")

            self.loop.open_address_book()
            elem = (DOM.Contacts.view_all_contact_specific_contact[0],
                    DOM.Contacts.view_all_contact_specific_contact[1].format(
                        self.test_contacts[0]["givenName"]))
            self.UTILS.element.waitForElements(elem, "Contact in address book")

    def _add_contact_as_favorite(self, contact):
        self.contacts.view_contact(contact['name'])

        favorite_btn = self.UTILS.element.getElement(
            DOM.Contacts.favourite_button, "Favourite toggle button")
        favorite_btn.tap()

        back_btn = self.UTILS.element.getElement(
            DOM.Contacts.details_back_button, "Back button")
        back_btn.tap()

        string = "{}{}".format(contact['givenName'],
                               contact['familyName']).upper()
        favs = ("xpath", DOM.Contacts.favourites_list_xpath.format(string))
        self.UTILS.element.waitForElements(
            favs, "'" + contact['name'] + "' in the favourites list")
Esempio n. 51
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")
Esempio n. 52
0
class main(GaiaTestCase):

    def setUp(self):
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.loop = Loop(self)
        self.settings = Settings(self)

        self.scenario = "scenarios/urls/multiple/available/diff_day/idb"
        self.aux_files_dir = self.UTILS.general.get_config_variable("aux_files", "loop")
        self.fxa_user = self.UTILS.general.get_config_variable("fxa_user", "common")
        self.fxa_pass = self.UTILS.general.get_config_variable("fxa_pass", "common")
        self.connect_to_network()

        # Insert our test contacts
        number_of_contacts = 3
        contact_given = "Test"
        contact_family = map(str, range(1, number_of_contacts + 1))
        contact_name = ["{} {}".format(contact_given, contact_family[i])
                        for i in range(number_of_contacts)]
        contact_numbers = ["666666666666", "777777777777", "888888888888"]

        test_contacts = [MockContact(name=contact_name[i], givenName=contact_given,
                                     familyName=contact_family[i],
                                     tel={'type': 'Mobile', 'value': contact_numbers[i]})
                         for i in range(number_of_contacts)]
        map(self.UTILS.general.insertContact, test_contacts)

        self.loop.initial_test_checks()

        # Make sure we're not logged in FxA
        self.settings.launch()
        self.settings.fxa()
        self.settings.fxa_log_out()

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

    def test_run(self):
        self.loop.launch()
        # This needs to be done at this point, bcs if the app is freshly installed the persistence
        # directories are not in its place until the app is launched for the first time
        self.loop.update_db("{}/{}".format(self.aux_files_dir, self.scenario))
        result = self.loop.wizard_or_login()

        if result:
            self.loop.firefox_login(self.fxa_user, self.fxa_pass)
            self.loop.allow_permission_ffox_login()
            self.UTILS.element.waitForElements(DOM.Loop.app_header, "Loop main view")

        self.loop.switch_to_urls()
        previous = self.loop.get_number_of_available_urls()

        self.loop.open_settings()
        self.loop.delete_all_urls(cancel=False)

        self.UTILS.element.waitForElements(DOM.Loop.call_log, "Check we are returned to the call log")
        current = self.loop.get_number_of_available_urls()
        self.UTILS.test.test(
            previous > current and current == 0,
            "Check that after deleting all URLs of different days when there are only available, there's nothing")
Esempio n. 53
0
class main(GaiaTestCase):
    def setUp(self):
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.loop = Loop(self)
        self.contacts = Contacts(self)
        self.settings = Settings(self)

        self.test_contact = MockContact(givenName="QA",
                                        familyName="Automation")
        self.fxa_user = self.UTILS.general.get_config_variable(
            "fxa_user", "common")
        self.fxa_pass = self.UTILS.general.get_config_variable(
            "fxa_pass", "common")
        _ = setup_translations(self)
        self.expected_msg = _(
            "This contact does not have either a phone number or an email address."
        )

        self.contacts.launch()
        self.contacts.start_create_new_contact()
        cont_fields = self.contacts.get_contact_fields()
        self.contacts.replace_str(cont_fields['givenName'],
                                  self.test_contact['givenName'])
        self.contacts.replace_str(cont_fields['familyName'],
                                  self.test_contact['familyName'])
        done_button = self.UTILS.element.getElement(DOM.Contacts.done_button,
                                                    "'Done' button")
        done_button.tap()

        self.connect_to_network()
        self.loop.initial_test_checks()
        self.settings.launch()
        self.settings.fxa()
        self.settings.fxa_log_out()
        self.apps.kill_all()
        time.sleep(2)

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

    def test_run(self):
        # First, login
        self.loop.launch()
        result = self.loop.wizard_or_login()

        if result:
            self.loop.firefox_login(self.fxa_user, self.fxa_pass)
            self.loop.allow_permission_ffox_login()
            self.UTILS.element.waitForElements(DOM.Loop.app_header,
                                               "Loop main view")

            self.loop.open_address_book()
            elem = (DOM.Contacts.view_all_contact_specific_contact[0],
                    DOM.Contacts.view_all_contact_specific_contact[1].format(
                        self.test_contact["givenName"]))
            entry = self.UTILS.element.getElement(elem,
                                                  "Contact in address book")
            entry.tap()

            time.sleep(5)
            self.marionette.switch_to_frame()
            title = self.UTILS.element.getElement(
                DOM.GLOBAL.modal_dialog_alert_title, "Error title")
            msg = self.UTILS.element.getElement(
                DOM.GLOBAL.modal_dialog_alert_msg, "Error message")
            self.UTILS.test.test(title.text == "Firefox Hello",
                                 "Error title matches")
            self.UTILS.test.test(msg.text == self.expected_msg,
                                 "Error message matches")