class test_main(GaiaTestCase): def setUp(self): GaiaTestCase.setUp(self) self.UTILS = UTILS(self) self.browser = Browser(self) def tearDown(self): self.UTILS.reporting.reportResults() GaiaTestCase.tearDown(self) def test_run(self): self.UTILS.test.test(not self.UTILS.network.is_network_type_enabled("data"), "Data mode is disabled before we start this test.") self.UTILS.statusbar.toggleViaStatusBar("data") self.wait_for_condition(lambda m: self.data_layer.is_cell_data_connected, timeout=20, message="Device attached to data connection") self.browser.launch() self.browser.open_url("http://www.google.com") self.UTILS.statusbar.toggleViaStatusBar("data") self.wait_for_condition(lambda m: not self.data_layer.is_cell_data_connected, timeout=20, message="Device attached to data connection") self.UTILS.element.waitForNotElements(DOM.Statusbar.dataConn, "Data icon in statusbar")
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.wifi_name = self.UTILS.general.get_config_variable("ssid", "wifi") self.wifi_pass = self.UTILS.general.get_config_variable("password", "wifi") self.testURL = self.UTILS.general.get_config_variable("test_url", "common") self.apps.set_permission_by_url(Browser.search_manifest_url, 'geolocation', 'deny') # switch off keyboard FTU screen self.data_layer.set_setting("keyboard.ftu.enabled", False) def tearDown(self): self.UTILS.reporting.reportResults() GaiaTestCase.tearDown(self) def test_run(self): # Open the settings application. self.settings.launch() # Connect to the wifi. self.settings.wifi() self.settings.connect_to_wifi(self.wifi_name, self.wifi_pass) # Open the browser app. self.browser.launch() # Open our URL. self.browser.open_url(self.testURL)
class test_main(GaiaTestCase): def setUp(self): # Set up child objects... GaiaTestCase.setUp(self) self.UTILS = UTILS(self) self.browser = Browser(self) self.testURL = self.UTILS.general.get_config_variable("test_url", "common") self.UTILS.reporting.logComment("Using " + self.testURL) # switch off keyboard FTU screen self.data_layer.set_setting("keyboard.ftu.enabled", False) def tearDown(self): self.UTILS.reporting.reportResults() GaiaTestCase.tearDown(self) def test_run(self): # Wifi needs to be off for this test to work. self.data_layer.connect_to_cell_data() # Open the browser app. self.browser.launch() # Open our URL. self.browser.open_url(self.testURL)
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=120)
class test_main(GaiaTestCase): def setUp(self): GaiaTestCase.setUp(self) self.UTILS = UTILS(self) self.browser = Browser(self) self.settings = Settings(self) self.wifi_name = self.UTILS.general.get_config_variable("ssid", "wifi") self.wifi_pass = self.UTILS.general.get_config_variable("password", "wifi") self.data_layer.connect_to_wifi() self.data_layer.is_wifi_connected() self.apps.kill_all() self.url = "https://acperez.github.io/gecko-sw-test/" self.sw_scope = "https://acperez.github.io/gecko-sw-test/" self.sw_header = "https://acperez.github.io!appId=22&inBrowser=1" self.script_spec = "https://acperez.github.io/gecko-sw-test/service-worker.js" def tearDown(self): self.data_layer.disable_wifi() self.UTILS.reporting.reportResults() GaiaTestCase.tearDown(self) def test_run(self): self.browser.launch() self.browser.open_url(self.url) register_btn = self.UTILS.element.getElement(dom.acperez_register_btn_dom, "Register Worker button") register_btn.tap() self.settings.launch() time.sleep(2) self.settings.developer_settings() time.sleep(2) self.settings.service_workers_menu() div_dom = (DOM.Settings.service_worker_div[0], DOM.Settings.service_worker_div[1].format(self.sw_scope)) div_elem = self.UTILS.element.getElement(div_dom, "Service worker div") self.UTILS.element.scroll_into_view(div_elem) header = div_elem.find_element(*DOM.Settings.service_worker_header) self.UTILS.test.test(header.text == self.sw_header, "Header found [{}] Expected [{}]". format(header.text, self.sw_header)) scope = div_elem.find_element(*DOM.Settings.service_worker_scope) self.UTILS.test.test(self.sw_scope == scope.text, "Scope found [{}] Expected [{}]". format(scope.text, self.sw_scope)) script_spec = div_elem.find_element(*DOM.Settings.service_worker_script_spec) self.UTILS.test.test(self.script_spec == script_spec.text, "Script spec found [{}] Expected [{}]". format(script_spec.text, self.script_spec)) worker_url = div_elem.find_element(*DOM.Settings.service_worker_current_url) self.UTILS.test.test(self.script_spec == worker_url.text, "URL found [{}] Expected [{}]". format(worker_url.text, self.script_spec)) unregister_btn = div_elem.find_element(*DOM.Settings.service_worker_unregister_btn) unregister_btn.tap()
class test_main(GaiaTestCase): button_locator = ('css selector', "button.icon") 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 = "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() self.apps.kill_all() time.sleep(2) 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(3) self.settings.launch() self.settings.downloads() self.download_manager.open_download(self.data_url) share_option = self.UTILS.element.getElement(DOM.DownloadManager.download_file_option_share, "Getting Share option button") share_option.tap() self.marionette.switch_to_frame() share_menu = self.UTILS.element.getElement(DOM.GLOBAL.action_menu, "Share menu") options = share_menu.find_elements(*self.button_locator) self.UTILS.test.test(len(options) > 0, "A list with several options to share is shown") self._show_option(options) def _show_option(self, options): for option in options: self.UTILS.reporting.logResult('info', "Share option: {}".format(option.text))
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))
class test_main(GaiaTestCase): test_url = "http://everlong.org/mozilla/packaged/" _appName = "cool packaged app" _appOK = True install_button_locator = ('id', 'install-app') confirm_install_locator = ('id', 'app-install-install-button') def setUp(self): # Set up child objects... GaiaTestCase.setUp(self) self.UTILS = UTILS(self) self.settings = Settings(self) self.browser = Browser(self) self.connect_to_network() # Uninstall the app (if need be). self.UTILS.app.uninstallApp(self._appName) def tearDown(self): self.UTILS.reporting.reportResults() GaiaTestCase.tearDown(self) def test_run(self): self.browser.launch() self.browser.open_url(self.test_url) """ Install the app (these DOM items are peculiar to this little dev app, so dont bother putting them in the main DOM.py file). """ install_btn = self.UTILS.element.getElement(self.install_button_locator, "Install an app button") install_btn.tap() # Install button on the splash screen (switch to main frame to 'see' this). self.marionette.switch_to_frame() install_btn = self.UTILS.element.getElement(self.confirm_install_locator, "Install button", True, 30) install_btn.tap() ok_btn = self.UTILS.element.getElement(DOM.GLOBAL.modal_dialog_alert_ok, "Ok button") ok_btn.tap() expected_msg = "{} installed".format(self._appName) system_banner = self.UTILS.element.getElement(DOM.GLOBAL.system_banner, "System notification banner") self.UTILS.test.test(system_banner.text == expected_msg, "Banner matches expected message") self.apps.kill_all() time.sleep(2) # Go back to the home page and check the app is installed. self.UTILS.test.test(self.UTILS.app.launchAppViaHomescreen(self._appName), "Application '" + self._appName + "' can be launched from the homescreen.", True)
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 = "41MB.rar" self.data_url = "{}/{}".format(self.test_url, self.file_name) self.data_layer.connect_to_cell_data() 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(text="Download started", notif_text="Downloading", timeout=15) self.apps.kill_all() time.sleep(2) self.settings.launch() self.settings.downloads() # Verify status downloading using data-state="downloading". self.download_manager.verify_download_status(self.data_url, "downloading") self.download_manager.verify_download_graphical_status(self.data_url, "downloading") self.UTILS.home.touchHomeButton() self.UTILS.statusbar.displayStatusBar() self.UTILS.statusbar.wait_for_notification_statusbar_title("Downloading") self.UTILS.statusbar.hideStatusBar() self.UTILS.statusbar.wait_for_notification_toaster_title("Download complete", timeout=240)
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 = "105MB.rar" self.data_url = "{}/{}".format(self.test_url, self.file_name) # make the download process slower self.data_layer.connect_to_cell_data() 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( text="Download started", notif_text="Downloading", timeout=15) time.sleep(5) self.apps.kill_all() time.sleep(2) self.settings.launch() self.settings.downloads() # Verify status downloading using data-state="downloading". self.download_manager.verify_download_status(self.data_url, "downloading") self.download_manager.verify_download_graphical_status( self.data_url, "downloading") self.download_manager.stop_download(self.data_url, True) self.UTILS.statusbar.wait_for_notification_statusbar_title( "Download stopped")
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 = "11MB.rar" 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) previous_number_of_pictures = len(self.data_layer.sdcard_files()) self.settings.launch() self.settings.downloads() self.download_manager.open_download(self.data_url) self.download_manager.open_download_delete_file() elem = (DOM.DownloadManager.download_element[0], DOM.DownloadManager.download_element[1].format(self.data_url)) self.UTILS.element.waitForNotElements(elem, "Download is not there") # Check that picture saved to SD card self.wait_for_condition( lambda m: len(self.data_layer.sdcard_files()) == previous_number_of_pictures - 1, 20) self.assertEqual(len(self.data_layer.sdcard_files()), previous_number_of_pictures - 1)
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")
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 = "1GB.rar" self.data_url = "{}/{}".format(self.test_url, self.file_name) # make the download process slower self.data_layer.connect_to_cell_data() 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(text="Download started", notif_text="Downloading", timeout=15) time.sleep(5) self.apps.kill_all() time.sleep(2) self.settings.launch() self.settings.downloads() # Verify status downloading using data-state="downloading". self.download_manager.verify_download_status(self.data_url, "downloading") download_info = self.download_manager.get_download_info(self.data_url) match = re.search(r"(\d)+(.(\d)+)*\s(GB|MB|KB)\sof\s(\d)+(.(\d)+)*\sGB$", download_info.text) self.UTILS.test.test(match is not None, "Verify the the text is: 'X' GB of 'Y' GB") time.sleep(3) self.download_manager.stop_download(self.data_url, True)
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 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) 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.connect_to_cell_data()
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")
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 = "105MB.rar" self.data_url = "{}/{}".format(self.test_url, self.file_name) # make the download process slower self.data_layer.connect_to_cell_data() 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(text="Download started", notif_text="Downloading", timeout=15) time.sleep(5) self.apps.kill_all() time.sleep(2) self.settings.launch() self.settings.downloads() # Verify status downloading using data-state="downloading". self.download_manager.verify_download_status(self.data_url, "downloading") self.download_manager.verify_download_graphical_status(self.data_url, "downloading") self.download_manager.stop_download(self.data_url, True) is_there = self.UTILS.statusbar.isIconInStatusBar(DOM.Statusbar.downloads) self.UTILS.test.test(not is_there, "Verify that the download icon in status bar is dismissed")
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 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 = "41MB.rar" self.data_url = "{}/{}".format(self.test_url, self.file_name) self.data_layer.connect_to_cell_data() self.settings.launch() self.settings.downloads() self.download_manager.clean_downloads_list()
def setUpEmail(self): GaiaTestCase.setUp(self) self.UTILS = UTILS(self) self.email = Email(self) self.settings = Settings(self) self.browser = Browser(self) _ = setup_translations(self) # Create (and record) a unique 'subject'. self.subject = "test " + str(time.time()) self.body = "This is the test email body." # Set up specific folder names. if "gmail" in self.test_type: self.UTILS.reporting.logComment("Gmail account being used.") self.sent_folder_name = _("Sent Mail") elif "exchange" in self.test_type: self.UTILS.reporting.logComment("Exchange account being used.") self.sent_folder_name = _("Sent Items") else: self.UTILS.reporting.logComment("Non-gmail account being used.") self.sent_folder_name = _("Sent") self.marionette.set_search_timeout(50)
def setUp(self): GaiaTestCase.setUp(self) self.UTILS = UTILS(self) self.browser = Browser(self) self.settings = Settings(self) self.wifi_name = self.UTILS.general.get_config_variable("ssid", "wifi") self.wifi_pass = self.UTILS.general.get_config_variable("password", "wifi") self.data_layer.connect_to_wifi() self.data_layer.is_wifi_connected() self.apps.kill_all() self.url = "http://jaoo.github.io/service-worker-testing/index.html" self.sw_scope = "http://jaoo.es/service-worker-testing/" self.sw_header = "http://jaoo.es!appId=22&inBrowser=1" self.script_spec = "http://jaoo.es/service-worker-testing/service.js"
class test_main(GaiaTestCase): def setUp(self): GaiaTestCase.setUp(self) self.UTILS = UTILS(self) # Specific for this test. self.browser = Browser(self) self.settings = Settings(self) self.download_manager = DownloadManager(self) self.testURL = self.UTILS.general.get_config_variable("download_url", "common") self.file_names = ["Toast.doc", "Porridge.doc"] self.connect_to_network() self.settings.launch() self.settings.downloads() self.download_manager.clean_downloads_list() self.apps.kill_all() time.sleep(2) 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.testURL) map(self.download_manager.download_file, self.file_names) self.UTILS.statusbar.wait_for_notification_toaster_title("Download complete", timeout=60) time.sleep(5) previous_number_of_pictures = len(self.data_layer.sdcard_files()) self.settings.launch() self.settings.downloads() # Delete All downloads self.download_manager.delete_all_downloads() # Check that picture saved to SD card self.wait_for_condition( lambda m: len(self.data_layer.sdcard_files()) == previous_number_of_pictures - len(self.file_names), 20) self.assertEqual(len(self.data_layer.sdcard_files()), previous_number_of_pictures - len(self.file_names))
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()
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 = "11MB.rar" self.data_url = "{}/{}".format(self.test_url, self.file_name) # make the download process slower self.data_layer.connect_to_cell_data() 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( text="Download started", notif_text="Downloading", timeout=15) is_there = self.UTILS.statusbar.isIconInStatusBar( DOM.Statusbar.downloads) self.UTILS.test.test( is_there, "Verify that the download icon in status bar is active") self.UTILS.statusbar.wait_for_notification_toaster_title( "Download complete", timeout=120) is_there = self.UTILS.statusbar.isIconInStatusBar( DOM.Statusbar.downloads) self.UTILS.test.test( not is_there, "Verify that the download icon in status bar is dismissed")
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))
def setUp(self): GaiaTestCase.setUp(self) self.UTILS = UTILS(self) self.browser = Browser(self) self.settings = Settings(self) self.wifi_name = self.UTILS.general.get_config_variable("ssid", "wifi") self.wifi_pass = self.UTILS.general.get_config_variable( "password", "wifi") self.data_layer.connect_to_wifi() self.data_layer.is_wifi_connected() self.apps.kill_all() self.url = "https://music.hostedweb.tid.es/" self.sw_scope = "https://music.hostedweb.tid.es/" self.sw_header = "https://music.hostedweb.tid.es!appId=22&inBrowser=1" self.script_spec = "https://music.hostedweb.tid.es/offliner-worker.js"
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.")
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")
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 = "prueba_archivo_con_nombre_muy_largo_de_30MB.rar" 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 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"
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))
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 = "GOSPEL.mp3" self.data_url = "{}/{}".format(self.test_url, self.file_name) self.connect_to_network() self.UTILS.statusbar.clearAllStatusBarNotifs() # Download and audio file self.settings.launch() self.settings.downloads() self.download_manager.clean_downloads_list() 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) self.apps.kill_all() time.sleep(2) def tearDown(self): self.UTILS.reporting.reportResults() GaiaTestCase.tearDown(self) def test_run(self): self.settings.launch() self.settings.downloads() self.download_manager.open_download(self.data_url) cancel_btn = self.UTILS.element.getElement(DOM.DownloadManager.download_file_option_cancel, "Getting Open file button") cancel_btn.tap() self.UTILS.element.waitForElements(DOM.Settings.downloads_header, "Downloads header appears.", True, 20, True)
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 = "prueba_archivo_con_nombre_muy_largo_de_30MB.rar" 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() # Check the file is there entry_name = self.download_manager.get_download_entry(self.data_url).find_element(*('css selector', 'p.fileName')) value = self.UTILS.element.get_css_value(entry_name, "text-overflow") is_ellipsis = self.UTILS.element.is_ellipsis_active(entry_name) self.UTILS.test.test(value == "ellipsis" and is_ellipsis, "Download list shows ellipsis(...) for a long entry [{}]".format(self.file_name))
def setUp(self): # Set up child objects... GaiaTestCase.setUp(self) self.UTILS = UTILS(self) self.settings = Settings(self) self.Browser = Browser(self) self.wifi_name = self.UTILS.general.get_config_variable("ssid", "wifi") self.wifi_pass = self.UTILS.general.get_config_variable("password", "wifi")
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 setUp(self): # Set up child objects... GaiaTestCase.setUp(self) self.UTILS = UTILS(self) self.settings = Settings(self) self.browser = Browser(self) self.wifi_name = self.UTILS.general.get_config_variable("ssid", "wifi") self.wifi_pass = self.UTILS.general.get_config_variable( "password", "wifi") self.testURL = self.UTILS.general.get_config_variable( "test_url", "common") self.apps.set_permission_by_url(Browser.search_manifest_url, 'geolocation', 'deny') # switch off keyboard FTU screen self.data_layer.set_setting("keyboard.ftu.enabled", False)
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 = "11MB.rar" 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.open_download_keep_file() elem = (DOM.DownloadManager.download_element[0], DOM.DownloadManager.download_element[1].format(self.data_url)) self.UTILS.element.waitForElements(elem, "Download is still there")
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 = "11MB.rar" 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.open_download_keep_file() elem = (DOM.DownloadManager.download_element[0], DOM.DownloadManager.download_element[1].format(self.data_url)) self.UTILS.element.waitForElements(elem, "Download is still there")
class test_main(GaiaTestCase): def setUp(self): GaiaTestCase.setUp(self) self.UTILS = UTILS(self) # Specific for this test. 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() self.apps.kill_all() time.sleep(2) 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.settings.launch() self.settings.downloads() self.download_manager.verify_download_status(self.data_url, "succeeded") self.download_manager.delete_download(self.data_url)
def setUp(self): GaiaTestCase.setUp(self) self.UTILS = UTILS(self) # Specific for this test. self.browser = Browser(self) self.settings = Settings(self) self.download_manager = DownloadManager(self) self.testURL = self.UTILS.general.get_config_variable("download_url", "common") self.file_names = ["Toast.doc", "Porridge.doc"] self.connect_to_network() self.settings.launch() self.settings.downloads() self.download_manager.clean_downloads_list() self.apps.kill_all() time.sleep(2)
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.browser.launch() self.browser.open_url(self.test_url) self.download_manager.download_file(self.file_name) self.UTILS.statusbar.click_on_notification_title( "Download complete", frame_to_change=DOM.Gallery.frame_locator, timeout=60) # Verify that the image is opened. time.sleep(2) 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") self.UTILS.element.waitForElements( DOM.Gallery.download_manager_preview, "Waiting for image to be loaded")
class test_main(GaiaTestCase): def setUp(self): GaiaTestCase.setUp(self) self.UTILS = UTILS(self) # Specific for this test. 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() self.apps.kill_all() time.sleep(2) 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.settings.launch() self.settings.downloads() self.download_manager.verify_download_status(self.data_url, "succeeded") self.download_manager.delete_download(self.data_url)
def setUp(self): # Set up child objects... GaiaTestCase.setUp(self) self.UTILS = UTILS(self) self.settings = Settings(self) self.browser = Browser(self) self.connect_to_network() # Uninstall the app (if need be). self.UTILS.app.uninstallApp(self._appName)
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)
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))
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 setUp(self): # Set up child objects... GaiaTestCase.setUp(self) self.UTILS = UTILS(self) self.browser = Browser(self) self.testURL = self.UTILS.general.get_config_variable("test_url", "common") self.UTILS.reporting.logComment("Using " + self.testURL) # switch off keyboard FTU screen self.data_layer.set_setting("keyboard.ftu.enabled", False)
def setUp(self): GaiaTestCase.setUp(self) self.UTILS = UTILS(self) # Specific for this test. 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() self.apps.kill_all() time.sleep(2)
def __init__(self, parent): self.apps = parent.apps self.data_layer = parent.data_layer self.parent = parent self.marionette = parent.marionette self.UTILS = parent.UTILS self.actions = Actions(self.marionette) self.browser = Browser(self.parent) self.app_name = "Firefox Hello" self.market_url = "https://owd.tid.es/B3lg1r89n/market/appList.html" self.persistent_directory = "/data/local/storage/persistent" self.loop_dir = self.UTILS.general.get_config_variable("install_dir", "loop")
class test_main(GaiaTestCase): def setUp(self): # Set up child objects... GaiaTestCase.setUp(self) self.UTILS = UTILS(self) self.browser = Browser(self) def tearDown(self): self.UTILS.reporting.reportResults() GaiaTestCase.tearDown(self) def test_run(self): url1 = "www.google.com" url2 = "www.bbc.co.uk" # Wifi needs to be off for this test to work. self.data_layer.connect_to_cell_data() # Open the browser app. self.browser.launch() # Open our URL. self.browser.open_url(url1) self.browser.open_url(url2, timeout=60) # bbc is heavier
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) 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.connect_to_cell_data()
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)
class test_main(GaiaTestCase): def setUp(self): # Set up child objects... GaiaTestCase.setUp(self) self.UTILS = UTILS(self) self.browser = Browser(self) def tearDown(self): self.UTILS.reporting.reportResults() GaiaTestCase.tearDown(self) def test_run(self): test_url = "http://qatecnico.blogspot.com.es/search/label/Automatizaci%C3%B3n%20de%20Pruebas" # Wifi needs to be off for this test to work. self.data_layer.connect_to_cell_data() # Open the browser app. self.browser.launch() self.browser.open_url(test_url)
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.wifi_name = self.UTILS.general.get_config_variable("ssid", "wifi") self.wifi_pass = self.UTILS.general.get_config_variable( "password", "wifi") self.testURL = self.UTILS.general.get_config_variable( "test_url", "common") self.apps.set_permission_by_url(Browser.search_manifest_url, 'geolocation', 'deny') # switch off keyboard FTU screen self.data_layer.set_setting("keyboard.ftu.enabled", False) def tearDown(self): self.UTILS.reporting.reportResults() GaiaTestCase.tearDown(self) def test_run(self): # Open the settings application. self.settings.launch() # Connect to the wifi. self.settings.wifi() self.settings.connect_to_wifi(self.wifi_name, self.wifi_pass) # Open the browser app. self.browser.launch() # Open our URL. self.browser.open_url(self.testURL)
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.browser.launch() self.browser.open_url(self.test_url) self.download_manager.download_file(self.file_name) self.UTILS.statusbar.click_on_notification_title( "Download complete", frame_to_change=DOM.Gallery.frame_locator, timeout=60) # Verify that the image is opened. time.sleep(2) 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") self.UTILS.element.waitForElements(DOM.Gallery.download_manager_preview, "Waiting for image to be loaded")