Exemplo n.º 1
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'")
Exemplo 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.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'")
Exemplo n.º 3
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/same_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_all_urls()

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

        self.UTILS.element.waitForElements(DOM.Loop.settings_panel_header, "Check we are still in Settings")
        self.loop.settings_go_back()

        current = self.loop.get_number_of_all_urls()
        self.UTILS.test.test(
            previous == current, "Check that after cancelling the deletion, we have the same number of urls")
Exemplo n.º 4
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/same_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_all_urls()

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

        self.UTILS.element.waitForElements(DOM.Loop.settings_panel_header,
                                           "Check we are still in Settings")
        self.loop.settings_go_back()

        current = self.loop.get_number_of_all_urls()
        self.UTILS.test.test(
            previous == current,
            "Check that after cancelling the deletion, we have the same number of urls"
        )