def test_browser_save_image(self): """ https://moztrap.mozilla.org/manage/case/6889/ """ # Check that there are no images on sdcard before saving self.assertEqual(0, len(self.data_layer.sdcard_files('.jpeg'))) search = Search(self.marionette) search.launch() browser = search.go_to_url(self.test_url) browser.switch_to_content() # Long tap on the image inside the browser content image = self.marionette.find_element('css selector', 'img') Actions(self.marionette).\ press(image).\ wait(3).\ release().\ wait(1).\ perform() activities = Activities(self.marionette) activities.tap_save_image() system = System(self.marionette) system.wait_for_notification_toaster_displayed() system.wait_for_notification_toaster_not_displayed() self.assertEqual(1, len(self.data_layer.sdcard_files('.jpeg')))
def test_browser_save_image(self): """ https://moztrap.mozilla.org/manage/case/6889/ """ # Check that there are no images on sdcard before saving self.assertEqual(0, len(self.data_layer.sdcard_files('.jpeg'))) search = Search(self.marionette) search.launch() browser = search.go_to_url(self.test_url) browser.switch_to_content() # Long tap on the image inside the browser content image = self.marionette.find_element('css selector', 'img') Actions(self.marionette).\ press(image).\ wait(3).\ release().\ wait(1).\ perform() activities = Activities(self.marionette) activities.tap_save_image() system = System(self.marionette) system.wait_for_notification_toaster_displayed() system.wait_for_notification_toaster_not_displayed() self.assertEqual(1, len(self.data_layer.sdcard_files('.jpeg')))
def tap_share_button(self): share_button = Wait(self.marionette).until( expected.element_present(*self._share_thumbnail_locator)) Wait(self.marionette).until(expected.element_displayed(share_button)) share_button.tap() from gaiatest.apps.system.regions.activities import Activities return Activities(self.marionette)
def tap_change_wallpaper(self): change_wallpaper = Wait(self.marionette).until( expected.element_present(*self._change_wallpaper_button_locator)) Wait(self.marionette).until( expected.element_displayed(change_wallpaper)) change_wallpaper.tap() from gaiatest.apps.system.regions.activities import Activities return Activities(self.marionette)
def tap_share_button(self): self.marionette.switch_to_frame( self.marionette.find_element(*self._active_view_locator)) self.marionette.switch_to_shadow_root( self.marionette.find_element( *self._cover_image_shadow_dom_locator)) self.marionette.find_element(*self._cover_share_locator).tap() from gaiatest.apps.system.regions.activities import Activities return Activities(self.marionette)
def long_press_contextmenu_body(self): self.wait_for_condition(lambda m: m.find_element( *self._contextmenu_body_locator).is_displayed()) contextmenu_body = self.marionette.find_element( *self._contextmenu_body_locator) Actions(self.marionette).press(contextmenu_body).wait( 1).release().perform() from gaiatest.apps.system.regions.activities import Activities return Activities(self.marionette)
def tap_picture(self): self.marionette.find_element(*self._thumbnail_photo_locator).tap() from gaiatest.apps.system.regions.activities import Activities return Activities(self.marionette)
def tap_share_button(self): self.tap_cover_in_player_view() self.marionette.find_element(*self._cover_share_locator).tap() from gaiatest.apps.system.regions.activities import Activities return Activities(self.marionette)
def tap_options(self): self.marionette.find_element(*self._options_button_locator).tap() from gaiatest.apps.messages.regions.activities import Activities return Activities(self.marionette)
def tap_attachment(self): self.marionette.find_element(*self._attach_button_locator).tap() from gaiatest.apps.system.regions.activities import Activities return Activities(self.marionette)
def pick_wallpaper(self): self.marionette.find_element(*self._wallpaper_pick_locator).tap() return Activities(self.marionette)