Exemplo n.º 1
0
 def open_album(self, album_item, name=''):
     if self.region.exists(album_item, default_wait_time):
         self.region.doubleClick(album_item)
     elif helper.check_exist_by_cliclick(name):
         helper.click_item_by_cliclick(name)
     else:
         return False, "The specified album doesn't exist"
     return True
Exemplo n.º 2
0
 def download_video(self, item, name=''):
     if self.region.exists(item, default_wait_time):
         self.region.click(item)
     elif helper.check_exist_by_cliclick(name):
         helper.click_item_by_cliclick(name)
     else:
         return False, "Fail to select item before downloading it"
     return self.download_via_bottom_bar()
Exemplo n.º 3
0
 def edit_caption(self, item, name, old_caption_screenshot, new_caption):
     if self.region.exists(item, default_wait_time):
         self.region.click(item)
     elif helper.check_exist_by_cliclick(name):
         helper.click_item_by_cliclick(name)
     else:
         return False, 'Fail to find test clip for rename testing'
     time.sleep(1)
     self.region.click(old_caption_screenshot)
     time.sleep(2)
     type(new_caption)
     type(Key.ENTER)
     return True
Exemplo n.º 4
0
    def share_album(self, album_item, album_name='', share_to_account=account_username2):
        """ Share an album to another account, currently we use default account_username to share """

        helper.log("Switch to album")
        helper.retry(self.switch_to_albums_view)

        # Select an album to share
        helper.log("The created album will be shared")
        if self.region.exists(album_item, default_wait_long_time):
            self.region.click(album_item)
        elif helper.check_exist_by_cliclick(album_name):
            helper.click_item_by_cliclick(album_name)
        else:
            return False, "The album item doesn't exist"
        helper.assert_step(self.share_via_bottom_bar())
        time.sleep(20)
        return self.share_dialog(share_to_account)
Exemplo n.º 5
0
    def add_item_to_album(self, screenshot, name, item_in_album_view=test_album_item, album_name="new"):
        if self.region.exists(screenshot, default_wait_time):
            self.region.click(screenshot)
        else:
            helper.click_item_by_cliclick(name)
        helper.assert_step(self.add_to_album_via_bottom_bar())

        if album_name == 'new':
            self.region.wait(new_album_dialog_button)
            self.region.click(new_album_dialog_button)

            time.sleep(1)
            type("test")

            time.sleep(1)
            type(Key.ENTER)

            if not region.exists(album_item_dialog_icon, default_wait_time):
                type(Key.ESC)
                return False, "Failed to create new album"

            helper.log("Click album icon in dialog")
            self.region.click(album_item_dialog_icon)

            helper.log("Click 'Enter' to add item to album")
            time.sleep(1)
            type(Key.ENTER)
            helper.assert_step(self.switch_to_albums_view())
            if not self.does_exist_in_library(item_in_album_view, "test", default_wait_time):
                return False, "Failed to add item to the new created album"
        else:
            type(album_name)
            time.sleep(1)
            type(Key.ENTER)
            helper.assert_step(self.switch_to_albums_view())
        return True