def test_create_folder_select_one_all_about(self, driver): Actions.clickButtonXP(self, driver, Locators.MENU_BUTTON_XP) Actions.clickButtonXP(self, driver, Locators.PICTURES_BUTTON_XP) Actions.clickButtonXP(self, driver, Locators.SUBMENU_BUTTON_XP) # Test about page Actions.clickButtonXP(self, driver, Locators.ABOUT_BUTTON_XP) assert Actions.getTextID(self, driver, Locators.PAGE_TITLE_ID) == 'About' assert Actions.version_text(self, driver) == 'Version:' driver.press_keycode(4) # Test check select all Actions.clickButtonXP(self, driver, Locators.SUBMENU_BUTTON_XP) Actions.clickButtonXP(self, driver, Locators.SELECT_ALL_BUTTON_XP) assert Actions.count_of_selected_on_the_screen(self, driver) > 3 Actions.clickButtonXP(self, driver, Locators.BACK_BUTTON_IF_SELECTED_XP) # Select one Actions.longtap(self, driver, Locators.ONE_IMAGE_TO_SELECT_XP) assert Actions.isObjectExistsID(self, driver, Locators.IS_SELECTED_FILE_ID) == True Actions.clickButtonXP(self, driver, Locators.BACK_BUTTON_IF_SELECTED_XP) # Test create new folder first_file = Actions.getTextXP(self, driver, Locators.FIRST_ITEM_TEXT_PICTURES_PAGE_XP) Actions.clickButtonXP(self, driver, Locators.SUBMENU_BUTTON_XP) Actions.clickButtonXP(self, driver, Locators.NEW_FOLDER_BUTTON_XP) assert Actions.getTextID(self, driver, Locators.POPUP_NAME_ID) == 'Create new folder' Actions.fill_field_id(self, driver) Actions.clickButtonID(self, driver, Locators.POPUP_SAVE_BUTTON_ID) assert Actions.getTextXP(self, driver, Locators.FIRST_ITEM_TEXT_PICTURES_PAGE_XP) != first_file
def test_open_picture_portrait_landscape(self, driver): Actions.clickButtonXP(self, driver, Locators.MENU_BUTTON_XP) Actions.clickButtonXP(self, driver, Locators.SD_CARD_BUTTON_XP) Actions.clickButtonXP(self, driver, Locators.TEST_FOLDER_BUTTON_XP) Actions.clickButtonXP(self, driver, Locators.PICTURES_FOLDER_BUTTON_XP) # Test picture is displayed in PORTRAIT mode assert driver.orientation == 'PORTRAIT' # Test *.jpg is playing Actions.clickButtonXP(self, driver, Locators.JPEG_FILE_XP) time.sleep(1) driver.tap([(150, 150)]) file_name = Actions.getTextID(self, driver, Locators.PICTURE_NAME_ID) assert file_name == 'jpg_test' driver.press_keycode(4) video_page_title = Actions.getTextID(self, driver, Locators.PAGE_TITLE_ID) assert video_page_title == 'Pictures' # Test picture is playing in LANDSCAPE mode driver.orientation = 'LANDSCAPE' assert driver.orientation == 'LANDSCAPE' # Test *.jpg is playing Actions.clickButtonXP(self, driver, Locators.JPEG_FILE_XP) time.sleep(1) driver.tap([(150, 150)]) file_name = Actions.getTextID(self, driver, Locators.PICTURE_NAME_ID) assert file_name == 'jpg_test' driver.press_keycode(4) video_page_title = Actions.getTextID(self, driver, Locators.PAGE_TITLE_ID) assert video_page_title == 'Pictures' driver.orientation = 'PORTRAIT' assert driver.orientation == 'PORTRAIT'
def test_media_files_types(self, driver): #TODO to hadle permissions if Actions.isObjectExistsID(self, driver, Locators.ALLOW_ACCESS_BUTTON_ID) == True: Actions.clickButtonID(self, driver, Locators.ALLOW_ACCESS_BUTTON_ID) Actions.clickButtonXP(self, driver, Locators.MENU_BUTTON_XP) Actions.clickButtonXP(self, driver, Locators.SD_CARD_BUTTON_XP) Actions.clickButtonXP(self, driver, Locators.TEST_FOLDER_BUTTON_XP) Actions.clickButtonXP(self, driver, Locators.VIDEOS_FOLDER_BUTTON_XP) # Test *.mp4 is playing Actions.clickButtonXP(self, driver, Locators.MP4_FILE_XP) time.sleep(1) driver.tap([(150, 150)]) start_time = Actions.getTextID(self, driver, Locators.TIME_POSITION_ID) time.sleep(3) end_time = Actions.getTextID(self, driver, Locators.TIME_POSITION_ID) assert start_time != end_time driver.press_keycode(4) # Test *.mkv is playing Actions.clickButtonXP(self, driver, Locators.MKV_FILE_XP) time.sleep(1) driver.tap([(150, 150)]) start_time = Actions.getTextID(self, driver, Locators.TIME_POSITION_ID) time.sleep(3) end_time = Actions.getTextID(self, driver, Locators.TIME_POSITION_ID) assert start_time != end_time driver.press_keycode(4) # Test *.3gp is playing Actions.clickButtonXP(self, driver, Locators.GP3_FILE_XP) time.sleep(1) driver.tap([(150, 150)]) start_time = Actions.getTextID(self, driver, Locators.TIME_POSITION_ID) time.sleep(3) end_time = Actions.getTextID(self, driver, Locators.TIME_POSITION_ID) assert start_time != end_time driver.press_keycode(4) time.sleep(1) driver.press_keycode(4) Actions.clickButtonXP(self, driver, Locators.PICTURES_FOLDER_BUTTON_XP) # Test *.jpg is playing Actions.clickButtonXP(self, driver, Locators.JPEG_FILE_XP) time.sleep(1) driver.tap([(150, 150)]) file_name = Actions.getTextID(self, driver, Locators.PICTURE_NAME_ID) assert file_name == 'jpg_test' driver.press_keycode(4) # Test *.png is playing Actions.clickButtonXP(self, driver, Locators.PNG_FILE_XP) time.sleep(1) driver.tap([(150, 150)]) file_name = Actions.getTextID(self, driver, Locators.PICTURE_NAME_ID) assert file_name == 'png_test' driver.press_keycode(4) # Test *.webp is playing Actions.clickButtonXP(self, driver, Locators.WEBP_FILE_XP) time.sleep(1) driver.tap([(150, 150)]) file_name = Actions.getTextID(self, driver, Locators.PICTURE_NAME_ID) assert file_name == 'webp_test'
def test_open_video_portrait_landscape(self, driver): Actions.clickButtonXP(self, driver, Locators.MENU_BUTTON_XP) Actions.clickButtonXP(self, driver, Locators.SD_CARD_BUTTON_XP) Actions.clickButtonXP(self, driver, Locators.TEST_FOLDER_BUTTON_XP) Actions.clickButtonXP(self, driver, Locators.VIDEOS_FOLDER_BUTTON_XP) # Test video is playing in PORTRAIT mode assert driver.orientation == 'PORTRAIT' # Test *.mp4 is playing Actions.clickButtonXP(self, driver, Locators.MP4_FILE_XP) time.sleep(1) driver.tap([(150, 150)]) start_time = Actions.getTextID(self, driver, Locators.TIME_POSITION_ID) time.sleep(3) end_time1 = Actions.getTextID(self, driver, Locators.TIME_POSITION_ID) assert start_time != end_time1 driver.orientation = 'LANDSCAPE' assert driver.orientation == 'LANDSCAPE' time.sleep(1) driver.tap([(150, 150)]) start_time = Actions.getTextID(self, driver, Locators.TIME_POSITION_ID) time.sleep(3) end_time2 = Actions.getTextID(self, driver, Locators.TIME_POSITION_ID) assert start_time != end_time2 assert end_time1 <= end_time2 driver.press_keycode(4) video_page_title = Actions.getTextID(self, driver, Locators.PAGE_TITLE_ID) assert video_page_title == 'Video' # Test video is playing in LANDSCAPE mode driver.orientation = 'LANDSCAPE' assert driver.orientation == 'LANDSCAPE' # Test *.mp4 is playing Actions.clickButtonXP(self, driver, Locators.MP4_FILE_XP) time.sleep(1) driver.tap([(150, 150)]) start_time = Actions.getTextID(self, driver, Locators.TIME_POSITION_ID) time.sleep(3) end_time3 = Actions.getTextID(self, driver, Locators.TIME_POSITION_ID) assert start_time != end_time3 driver.orientation = 'PORTRAIT' assert driver.orientation == 'PORTRAIT' time.sleep(1) driver.tap([(150, 150)]) start_time = Actions.getTextID(self, driver, Locators.TIME_POSITION_ID) time.sleep(3) end_time4 = Actions.getTextID(self, driver, Locators.TIME_POSITION_ID) assert start_time != end_time4 assert end_time3 <= end_time4 driver.press_keycode(4) video_page_title = Actions.getTextID(self, driver, Locators.PAGE_TITLE_ID) assert video_page_title == 'Video' # driver.orientation = 'PORTRAIT' assert driver.orientation == 'PORTRAIT'