Beispiel #1
0
class test_main(GaiaTestCase):
    def setUp(self):

        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)

        self.browser = Browser(self)
        self.settings = Settings(self)
        self.download_manager = DownloadManager(self)
        self.test_url = self.UTILS.general.get_config_variable(
            "download_url", "common")
        self.file_name = "Crazy_Horse.jpg"
        self.data_url = "{}/{}".format(self.test_url, self.file_name)

        self.connect_to_network()
        self.settings.launch()
        self.settings.downloads()
        self.download_manager.clean_downloads_list()

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

    def test_run(self):
        self.UTILS.statusbar.clearAllStatusBarNotifs()

        self.browser.launch()
        self.browser.open_url(self.test_url)
        self.download_manager.download_file(self.file_name)
        self.UTILS.statusbar.wait_for_notification_toaster_title(
            "Download complete", timeout=60)
        time.sleep(5)

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

        self.settings.launch()
        self.settings.downloads()
        self.download_manager.open_download(self.data_url)
        self.download_manager.tap_on_open_option()

        # Verify that the image is opened.
        self.UTILS.iframe.switchToFrame(*DOM.Gallery.frame_locator)
        title = self.UTILS.element.getElement(DOM.Gallery.file_name_header,
                                              "File name header")
        self.UTILS.test.test(title.text == self.file_name,
                             "File name matches in Gallery")

        is_loaded = self.UTILS.element.waitForElements(
            DOM.Gallery.current_image_pic, "Waiting for image to be loaded")
        self.UTILS.test.test(is_loaded, "Image has been loaded")
Beispiel #2
0
class test_main(GaiaTestCase):
    def setUp(self):

        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)

        self.browser = Browser(self)
        self.settings = Settings(self)
        self.download_manager = DownloadManager(self)
        self.music = Music(self)
        self.test_url = self.UTILS.general.get_config_variable(
            "download_url", "common")
        self.file_name = "GOSPEL.mp3"
        self.data_url = "{}/{}".format(self.test_url, self.file_name)

        self.connect_to_network()
        self.settings.launch()
        self.settings.downloads()
        self.download_manager.clean_downloads_list()

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

    def test_run(self):
        self.browser.launch()
        self.browser.open_url(self.test_url)
        self.download_manager.download_file(self.file_name)
        self.UTILS.statusbar.wait_for_notification_toaster_title(
            "Download complete", timeout=60)
        time.sleep(5)

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

        self.settings.launch()
        self.settings.downloads()
        self.download_manager.open_download(self.data_url)
        self.download_manager.tap_on_open_option()

        self.UTILS.iframe.switchToFrame(*DOM.Music.frame_locator)
        time.sleep(5)

        title = self.UTILS.element.getElement(
            DOM.Music.title_song, "Getting song title in music player")
        self.UTILS.test.test(title.text in self.file_name, "Mp3 file title")

        self.UTILS.test.test(self.music.is_player_playing(),
                             "Mp3 file is being played")
Beispiel #3
0
class test_main(GaiaTestCase):

    def setUp(self):

        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)

        self.browser = Browser(self)
        self.settings = Settings(self)
        self.download_manager = DownloadManager(self)
        self.test_url = self.UTILS.general.get_config_variable("download_url", "common")
        self.file_name = "Crazy_Horse.jpg"
        self.data_url = "{}/{}".format(self.test_url, self.file_name)

        self.connect_to_network()
        self.settings.launch()
        self.settings.downloads()
        self.download_manager.clean_downloads_list()

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

    def test_run(self):
        self.UTILS.statusbar.clearAllStatusBarNotifs()

        self.browser.launch()
        self.browser.open_url(self.test_url)
        self.download_manager.download_file(self.file_name)
        self.UTILS.statusbar.wait_for_notification_toaster_title("Download complete", timeout=60)
        time.sleep(5)

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

        self.settings.launch()
        self.settings.downloads()
        self.download_manager.open_download(self.data_url)
        self.download_manager.tap_on_open_option()

        # Verify that the image is opened.
        self.UTILS.iframe.switchToFrame(*DOM.Gallery.frame_locator)
        title = self.UTILS.element.getElement(DOM.Gallery.file_name_header, "File name header")
        self.UTILS.test.test(title.text == self.file_name, "File name matches in Gallery")

        is_loaded = self.UTILS.element.waitForElements(DOM.Gallery.current_image_pic,
                                                       "Waiting for image to be loaded")
        self.UTILS.test.test(is_loaded, "Image has been loaded")
Beispiel #4
0
class test_main(GaiaTestCase):

    def setUp(self):

        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)

        self.browser = Browser(self)
        self.settings = Settings(self)
        self.download_manager = DownloadManager(self)
        self.music = Music(self)
        self.test_url = self.UTILS.general.get_config_variable("download_url", "common")
        self.file_name = "GOSPEL.mp3"
        self.data_url = "{}/{}".format(self.test_url, self.file_name)

        self.connect_to_network()
        self.settings.launch()
        self.settings.downloads()
        self.download_manager.clean_downloads_list()

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

    def test_run(self):
        self.browser.launch()
        self.browser.open_url(self.test_url)
        self.download_manager.download_file(self.file_name)
        self.UTILS.statusbar.wait_for_notification_toaster_title("Download complete", timeout=60)
        time.sleep(5)

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

        self.settings.launch()
        self.settings.downloads()
        self.download_manager.open_download(self.data_url)
        self.download_manager.tap_on_open_option()

        self.UTILS.iframe.switchToFrame(*DOM.Music.frame_locator)
        time.sleep(5)

        title = self.UTILS.element.getElement(DOM.Music.title_song, "Getting song title in music player")
        self.UTILS.test.test(title.text in self.file_name, "Mp3 file title")

        self.UTILS.test.test(self.music.is_player_playing(), "Mp3 file is being played")
Beispiel #5
0
class test_main(GaiaTestCase):

    def setUp(self):

        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)

        self.browser = Browser(self)
        self.settings = Settings(self)
        self.download_manager = DownloadManager(self)
        self.video = Video(self)
        self.test_url = self.UTILS.general.get_config_variable("download_url", "common")
        self.file_name = "clipcanvas_14348_H264_320x180.mp4"
        self.data_url = "{}/{}".format(self.test_url, self.file_name)

        self.connect_to_network()
        self.settings.launch()
        self.settings.downloads()
        self.download_manager.clean_downloads_list()

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

    def test_run(self):
        self.UTILS.statusbar.clearAllStatusBarNotifs()
    
        self.browser.launch()
        self.browser.open_url(self.test_url)
        self.download_manager.download_file(self.file_name)
        self.UTILS.statusbar.wait_for_notification_toaster_title("Download complete", timeout=60)
        time.sleep(5)

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

        self.settings.launch()
        self.settings.downloads()
        self.download_manager.open_download(self.data_url)
        self.download_manager.tap_on_open_option()

        # Verifying video player
        self.UTILS.iframe.switchToFrame(*DOM.Video.frame_locator)
        result = self.video.is_this_video_being_played(self.file_name)
        self.UTILS.test.test(result, "This video [{}] is actually being played".format(self.file_name))