Exemplo n.º 1
0
class test_main(GaiaTestCase):

    def setUp(self):
        # Set up child objects...
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.settings = Settings(self)
        self.browser = Browser(self)
        self.url1 = "www.google.com"
        self.url2 = "www.wikipedia.org"

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

    def test_run(self):

        # Open the Settings application.
        self.connect_to_network()

        # Open the browser app.
        self.browser.launch()

        # Open our URL.
        self.browser.open_url(self.url1)
        self.marionette.switch_to_frame()
        self.browser.wait_for_page_to_load()
        self.UTILS.test.test(self.url1 in self.browser.loaded_url(), "Web page loaded correctly.")

        self.browser.open_url(self.url2)
        self.marionette.switch_to_frame()
        self.browser.wait_for_page_to_load()
        self.UTILS.test.test(self.url2 in self.browser.loaded_url(), "Web page loaded correctly.")
Exemplo n.º 2
0
class test_main(GaiaTestCase):
    def setUp(self):
        # Set up child objects...
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.settings = Settings(self)
        self.browser = Browser(self)
        self.url1 = "www.google.com"
        self.url2 = "www.wikipedia.org"

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

    def test_run(self):

        # Open the Settings application.
        self.connect_to_network()

        # Open the browser app.
        self.browser.launch()

        # Open our URL.
        self.browser.open_url(self.url1)
        self.marionette.switch_to_frame()
        self.browser.wait_for_page_to_load()
        self.UTILS.test.test(self.url1 in self.browser.loaded_url(),
                             "Web page loaded correctly.")

        self.browser.open_url(self.url2)
        self.marionette.switch_to_frame()
        self.browser.wait_for_page_to_load()
        self.UTILS.test.test(self.url2 in self.browser.loaded_url(),
                             "Web page loaded correctly.")
Exemplo n.º 3
0
class test_main(GaiaTestCase):
    def setUp(self):
        # Set up child objects...
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.settings = Settings(self)
        self.browser = Browser(self)
        self.messages = Messages(self)

        self.num = self.UTILS.general.get_config_variable(
            "phone_number", "custom")
        self.url1 = "www.google.com"
        self.url2 = "www.wikipedia.org"
        self.test_msg = "Test message"

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

    def test_run(self):
        self.data_layer.connect_to_wifi()

        # Open the first url
        self.browser.launch()
        self.browser.open_url(self.url1)
        self.marionette.switch_to_frame()
        self.browser.wait_for_page_to_load()
        self.UTILS.test.test(self.url1 in self.browser.loaded_url(),
                             "Web page loaded correctly.")

        # Open the SMS app, send a message then jump back to the browser.
        self.messages.launch()
        self.messages.create_and_send_sms([self.num], self.test_msg)
        send_time = self.messages.last_sent_message_timestamp()
        self.messages.wait_for_message(send_time)

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

        self.browser.launch()
        self.browser.open_url(self.url2)
        self.marionette.switch_to_frame()
        self.browser.wait_for_page_to_load()
        self.UTILS.test.test(self.url2 in self.browser.loaded_url(),
                             "Web page loaded correctly.")
Exemplo n.º 4
0
class test_main(GaiaTestCase):

    links = ["www.google.com", "www.hotmail.com", "www.wikipedia.org"]
    test_msg = "Test " + " ".join(links) + " this."

    def setUp(self):

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

        # Establish which phone number to use.
        self.phone_number = self.UTILS.general.get_config_variable(
            "phone_number", "custom")
        self.UTILS.reporting.logComment("Sending sms to telephone number " +
                                        self.phone_number)

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

    def test_run(self):

        self.connect_to_network()

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

        map(self.try_link, range(len(self.links)), self.links)

    def try_link(self, link_number, link):
        self.UTILS.reporting.logResult("info",
                                       "Tapping <b>{}</b> ...".format(link))

        # Switch to messaging app.
        self.messages.launch()
        self.messages.openThread(self.phone_number)
        time.sleep(1)

        # Get last message.
        msg = self.messages.last_message_in_this_thread()

        # Find all URLs
        l = msg.find_element("xpath", "//a[text()='{}']".format(link))

        # Tap on required link.
        self.UTILS.element.simulateClick(l)

        self.marionette.switch_to_frame()
        self.browser.wait_for_page_to_load()
        self.UTILS.test.test(
            link in self.browser.loaded_url(),
            "Web page loaded #{} correctly.".format(link_number + 1))
Exemplo n.º 5
0
class test_main(GaiaTestCase):

    def setUp(self):
        # Set up child objects...
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.settings = Settings(self)
        self.browser = Browser(self)
        self.messages = Messages(self)

        self.num = self.UTILS.general.get_config_variable("phone_number", "custom")
        self.url1 = "www.google.com"
        self.url2 = "www.wikipedia.org"
        self.test_msg = "Test message"

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

    def test_run(self):
        self.data_layer.connect_to_wifi()

        # Open the first url
        self.browser.launch()
        self.browser.open_url(self.url1)
        self.marionette.switch_to_frame()
        self.browser.wait_for_page_to_load()
        self.UTILS.test.test(self.url1 in self.browser.loaded_url(), "Web page loaded correctly.")

        # Open the SMS app, send a message then jump back to the browser.
        self.messages.launch()
        self.messages.create_and_send_sms([self.num], self.test_msg)
        send_time = self.messages.last_sent_message_timestamp()
        self.messages.wait_for_message(send_time)

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

        self.browser.launch()
        self.browser.open_url(self.url2)
        self.marionette.switch_to_frame()
        self.browser.wait_for_page_to_load()
        self.UTILS.test.test(self.url2 in self.browser.loaded_url(), "Web page loaded correctly.")
Exemplo n.º 6
0
class test_main(GaiaTestCase):

    links = ["www.google.com", "www.hotmail.com", "www.wikipedia.org"]
    test_msg = "Test " + " ".join(links) + " this."

    def setUp(self):

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

        # Establish which phone number to use.
        self.phone_number = self.UTILS.general.get_config_variable("phone_number", "custom")
        self.UTILS.reporting.logComment("Sending sms to telephone number " + self.phone_number)

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

    def test_run(self):

        self.connect_to_network()

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

        map(self.try_link, range(len(self.links)), self.links)

    def try_link(self, link_number, link):
        self.UTILS.reporting.logResult("info", "Tapping <b>{}</b> ...".format(link))

        # Switch to messaging app.
        self.messages.launch()
        self.messages.openThread(self.phone_number)
        time.sleep(1)

        # Get last message.
        msg = self.messages.last_message_in_this_thread()

        # Find all URLs
        l = msg.find_element("xpath", "//a[text()='{}']".format(link))

        # Tap on required link.
        self.UTILS.element.simulateClick(l)

        self.marionette.switch_to_frame()
        self.browser.wait_for_page_to_load()
        self.UTILS.test.test(
            link in self.browser.loaded_url(), "Web page loaded #{} correctly.".format(link_number + 1))
Exemplo n.º 7
0
class test_main(GaiaTestCase):
    def setUp(self):
        # Set up child objects...
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.settings = Settings(self)
        self.browser = Browser(self)
        self.url1 = "www.google.com"
        self.url2 = "www.wikipedia.org"

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

    def test_run(self):
        self.data_layer.connect_to_wifi()

        # Open the browser app.
        self.browser.launch()
        self.browser.open_url(self.url1)
        self.marionette.switch_to_frame()
        self.browser.wait_for_page_to_load()
        self.UTILS.test.test(self.url1 in self.browser.loaded_url(),
                             "{} successfully loaded".format(self.url1))

        self.device.turn_screen_off()

        screenshot = self.UTILS.debug.screenShotOnErr()
        self.UTILS.reporting.logResult("info", "Srceenshot of locked screen:",
                                       screenshot)

        time.sleep(3)
        self.device.unlock()

        self.browser.open_url(self.url2)
        self.marionette.switch_to_frame()
        self.browser.wait_for_page_to_load()
        self.UTILS.test.test(self.url2 in self.browser.loaded_url(),
                             "{} successfully loaded".format(self.url2))
Exemplo n.º 8
0
class test_main(GaiaTestCase):

    def setUp(self):
        # Set up child objects...
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.settings = Settings(self)
        self.browser = Browser(self)
        self.url1 = "www.google.com"
        self.url2 = "www.wikipedia.org"

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

    def test_run(self):
        self.data_layer.connect_to_wifi()

        # Open the browser app.
        self.browser.launch()
        self.browser.open_url(self.url1)
        self.marionette.switch_to_frame()
        self.browser.wait_for_page_to_load()
        self.UTILS.test.test(self.url1 in self.browser.loaded_url(), "{} successfully loaded".format(self.url1))

        self.device.turn_screen_off()

        screenshot = self.UTILS.debug.screenShotOnErr()
        self.UTILS.reporting.logResult("info", "Srceenshot of locked screen:", screenshot)

        time.sleep(3)
        self.device.unlock()

        self.browser.open_url(self.url2)
        self.marionette.switch_to_frame()
        self.browser.wait_for_page_to_load()
        self.UTILS.test.test(self.url2 in self.browser.loaded_url(), "{} successfully loaded".format(self.url2))
Exemplo n.º 9
0
class test_main(GaiaTestCase):

    link = "www.google.com"
    test_msg = "Test " + link + " this."

    def setUp(self):

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

        # Establish which phone number to use.
        self.phone_number = self.UTILS.general.get_config_variable(
            "phone_number", "custom")
        self.UTILS.reporting.logComment("Sending sms to telephone number " +
                                        self.phone_number)

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

    def test_run(self):
        self.connect_to_network()

        # Launch messages app.
        self.messages.launch()

        # Create and send a new test message.
        self.messages.create_and_send_sms([self.phone_number], self.test_msg)
        """
        Wait for the last message in this thread to be a 'received' one
        and click the link.
        """

        x = self.messages.wait_for_message()
        self.UTILS.test.test(x, "Received a message.", True)

        x.find_element("tag name", "a").tap()
        """
        Give the browser time to start up, then
        switch to the browser frame and check the page loaded.
        """
        self.marionette.switch_to_frame()
        self.browser.wait_for_page_to_load()
        self.UTILS.test.test(
            self.link in self.browser.loaded_url(),
            "Web page loaded ({}) correctly.".format(self.link))
Exemplo n.º 10
0
class test_main(GaiaTestCase):

    link = "www.google.com"
    test_msg = "Open this URL: " + link

    def setUp(self):

        # Set up child objects...
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.messages = Messages(self)
        self.gallery = Gallery(self)
        self.browser = Browser(self)

        # Establish which phone number to use.
        self.phone_number = self.UTILS.general.get_config_variable(
            "phone_number", "custom")
        self.UTILS.reporting.logComment("Sending mms to telephone number " +
                                        self.phone_number)
        self.data_layer.delete_all_sms()
        self.UTILS.statusbar.clearAllStatusBarNotifs()

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

    def test_run(self):
        self.data_layer.connect_to_cell_data()

        self.messages.create_and_send_mms('image', [self.phone_number],
                                          self.test_msg)
        self.messages.wait_for_message()
        last_msg = self.messages.last_message_in_this_thread()
        tags = last_msg.find_elements("tag name", "a")

        # Tap on required link.
        tags[0].tap()
        """
        Give the browser time to start up, then
        switch to the browser frame and check the page loaded.
        """
        time.sleep(3)
        self.marionette.switch_to_frame()
        self.browser.wait_for_page_to_load()
        self.UTILS.test.test(self.link in self.browser.loaded_url(),
                             "Web page loaded correctly.")
Exemplo n.º 11
0
class test_main(GaiaTestCase):

    link = "www.google.com"
    test_msg = "Test " + link + " this."

    def setUp(self):

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

        # Establish which phone number to use.
        self.phone_number = self.UTILS.general.get_config_variable("phone_number", "custom")
        self.UTILS.reporting.logComment("Sending sms to telephone number " + self.phone_number)

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

    def test_run(self):
        self.connect_to_network()

        # Launch messages app.
        self.messages.launch()

        # Create and send a new test message.
        self.messages.create_and_send_sms([self.phone_number], self.test_msg)
        """
        Wait for the last message in this thread to be a 'received' one
        and click the link.
        """

        x = self.messages.wait_for_message()
        self.UTILS.test.test(x, "Received a message.", True)

        x.find_element("tag name", "a").tap()
        """
        Give the browser time to start up, then
        switch to the browser frame and check the page loaded.
        """
        self.marionette.switch_to_frame()
        self.browser.wait_for_page_to_load()
        self.UTILS.test.test(
            self.link in self.browser.loaded_url(), "Web page loaded ({}) correctly.".format(self.link))
Exemplo n.º 12
0
class test_main(GaiaTestCase):
    def setUp(self):
        # Set up child objects...
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.settings = Settings(self)
        self.browser = Browser(self)
        self.messages = Messages(self)

        self.num = self.UTILS.general.get_config_variable(
            "phone_number", "custom")
        self.cp_incoming_number = self.UTILS.general.get_config_variable(
            "sms_platform_numbers", "common").split(',')
        self.data_layer.delete_all_sms()
        self.url1 = "www.google.com"
        self.url2 = "www.wikipedia.org"

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

    def test_run(self):
        self.data_layer.connect_to_wifi()

        # Open the browser app.
        self.browser.launch()

        # Open our URL.
        self.browser.open_url(self.url1)

        test_msg = "This is a test message sent at {} while connected to a wifi".format(
            time.time())
        self.UTILS.messages.create_incoming_sms(self.num, test_msg)
        self.UTILS.statusbar.wait_for_notification_toaster_detail(test_msg,
                                                                  timeout=120)
        self.UTILS.statusbar.click_on_notification_detail(
            test_msg, DOM.Messages.frame_locator)
        self.messages.check_last_message_contents(test_msg)

        self.browser.launch()
        self.browser.open_url(self.url2)
        self.marionette.switch_to_frame()
        self.browser.wait_for_page_to_load()
        self.UTILS.test.test(self.url2 in self.browser.loaded_url(),
                             "Web page loaded correctly.")
Exemplo n.º 13
0
class test_main(GaiaTestCase):

    link = "www.google.com"
    test_msg = "Test " + link + " this."

    def setUp(self):

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

        # Establish which phone number to use.
        self.phone_number = self.UTILS.general.get_config_variable("phone_number", "custom")
        self.cp_incoming_number = self.UTILS.general.get_config_variable("sms_platform_numbers", "common").split(',')
        self.UTILS.reporting.logComment("Sending sms to telephone number " + self.phone_number)
        self.connect_to_network()
        self.UTILS.statusbar.clearAllStatusBarNotifs()

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

    def test_run(self):
        self.UTILS.messages.create_incoming_sms(self.phone_number, self.test_msg)
        self.UTILS.statusbar.wait_for_notification_toaster_detail(self.test_msg, timeout=120)
        title = self.UTILS.statusbar.wait_for_notification_toaster_with_titles(self.cp_incoming_number, timeout=5)
        self.UTILS.statusbar.click_on_notification_title(title, DOM.Messages.frame_locator)

        last_msg = self.messages.last_message_in_this_thread()
        last_msg.find_element("tag name", "a").tap()

        """
        Give the browser time to start up, then
        switch to the browser frame and check the page loaded.
        """
        self.marionette.switch_to_frame()
        self.browser.wait_for_page_to_load()
        self.UTILS.test.test(
            self.link in self.browser.loaded_url(), "Web page loaded ({}) correctly.".format(self.link))