def test_view_mode(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)

        # Gallery mode view, no date, size, type.
        assert Actions.isObjectExistsID(self, driver,
                                        Locators.FILE_DATE_TEXT_ID) is False
        assert Actions.isObjectExistsID(self, driver,
                                        Locators.FILE_SIZE_TEXT_ID) is False
        assert Actions.isObjectExistsID(self, driver,
                                        Locators.FILE_TYPE_TEXT_ID) is False

        Actions.clickButtonID(self, driver, Locators.VIEW_BUTTON_ID)

        # List mode view
        assert Actions.isObjectExistsID(self, driver,
                                        Locators.FILE_DATE_TEXT_ID) is True
        assert Actions.isObjectExistsID(self, driver,
                                        Locators.FILE_SIZE_TEXT_ID) is True
        assert Actions.isObjectExistsID(self, driver,
                                        Locators.FILE_TYPE_TEXT_ID) is True

        Actions.clickButtonID(self, driver, Locators.VIEW_BUTTON_ID)

        # Gallery mode view
        assert Actions.isObjectExistsID(self, driver,
                                        Locators.FILE_DATE_TEXT_ID) is False
        assert Actions.isObjectExistsID(self, driver,
                                        Locators.FILE_SIZE_TEXT_ID) is False
        assert Actions.isObjectExistsID(self, driver,
                                        Locators.FILE_TYPE_TEXT_ID) is False
    def test_2d_or_3d_is_on(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.BUGS_FOLDER_BUTTON_XP)

        # Test *.mp4 is playing
        Actions.clickButtonXP(self, driver, Locators.V4_TEST_VIDEO)
        # time.sleep(1)
        assert Actions.is3DBacklightOn(self) is True
        # time.sleep(1)
        driver.tap([(150, 150)])
        Actions.clickButtonID(self, driver, Locators.INTERLACE_BUTTON_ID)
        # time.sleep(1)
        assert Actions.is3DBacklightOn(self) is False
Ejemplo n.º 3
0
    def test_explore_page_view(self, driver):
        time.sleep(2)
        Actions.clickButtonXP(self, driver, MainLocators.EXPLORE_BUTTON_XP)

        assert Actions.getTextXP(
            self, driver,
            ExplorePageLocators.TITLE_XP) == StaticData.EXPLORE_PAGE_TITLE
        assert Actions.isObjectExistsID(
            self, driver, ExplorePageLocators.SEARCH_BUTTON_ID) is True
        assert Actions.isObjectExistsID(
            self, driver, ExplorePageLocators.SORT_BUTTON_ID) is True
        assert Actions.isObjectExistsID(
            self, driver, ExplorePageLocators.MENU_BUTTON_ID) is True
        assert Actions.getTextXP(self, driver, ExplorePageLocators.GAMES_TAB_XP
                                 ) == StaticData.EXPLORE_PAGE_GAMES_TAB_NAME
        assert Actions.getTextXP(self, driver, ExplorePageLocators.APPS_TAB_XP
                                 ) == StaticData.EXPLORE_PAGE_APPS_TAB_NAME

        assert Actions.getAttributeValueXP(
            self, driver, ExplorePageLocators.GAMES_TAB_XP,
            'selected') == StaticData.EXPLORE_PAGE_GAMES_TAB_SELECTED
        assert Actions.getAttributeValueXP(
            self, driver, ExplorePageLocators.APPS_TAB_XP,
            'selected') == StaticData.EXPLORE_PAGE_APPS_TAB_NOT_SELECTED
Ejemplo n.º 4
0
    def test_top_picks_editors_choice_blocks(self, driver):
        # Top picks block swipe
        assert Actions.getTextID(
            self, driver, MainLocators.TOP_PICKS_TITLE_ID) == 'Top Picks'
        assert Actions.getFewTextsXP(
            self, driver, MainLocators.OVERALL_TABS_XP) == ['Games', 'Apps']
        # assert Actions.getAttributeValueXP(self, driver, MainLocators.FIRST_TAB_XP, 'selected') == 'true'
        # assert Actions.getAttributeValueXP(self, driver, MainLocators.SECOND_TAB_XP, 'selected') == 'false'
        assert Actions.count_of_elements_id(self, driver,
                                            MainLocators.APP_ICON_ID) == 7
        assert Actions.count_of_elements_id(self, driver,
                                            MainLocators.SUBTITLE_APP_ID) == 7

        Actions.swipeSectionsToLeft(self, driver)

        assert Actions.count_of_elements_id(self, driver,
                                            MainLocators.APP_ICON_ID) == 4
        assert Actions.count_of_elements_id(self, driver,
                                            MainLocators.SUBTITLE_APP_ID) >= 4

        Actions.swipeSectionsToRight(self, driver)

        assert Actions.count_of_elements_id(self, driver,
                                            MainLocators.APP_ICON_ID) == 7
        assert Actions.count_of_elements_id(self, driver,
                                            MainLocators.SUBTITLE_APP_ID) == 7

        # Top picks block click
        Actions.clickButtonXP(self, driver, MainLocators.SECOND_TAB_XP)

        assert Actions.count_of_elements_id(self, driver,
                                            MainLocators.APP_ICON_ID) == 4
        assert Actions.count_of_elements_id(self, driver,
                                            MainLocators.SUBTITLE_APP_ID) >= 4

        Actions.clickButtonXP(self, driver, MainLocators.FIRST_TAB_XP)

        assert Actions.count_of_elements_id(self, driver,
                                            MainLocators.APP_ICON_ID) == 7
        assert Actions.count_of_elements_id(self, driver,
                                            MainLocators.SUBTITLE_APP_ID) == 7

        # Test open app page from top picks block
        assert Actions.isObjectExistsID(
            self, driver, AppPageLocators.GALLERY_BLOCK_ID) is False

        Actions.clickButtonXP(self, driver,
                              MainLocators.APP_TO_OPEN_TOP_PICKS_XP)

        assert Actions.isObjectExistsID(
            self, driver, AppPageLocators.GALLERY_BLOCK_ID) is True

        Actions.clickButtonID(self, driver, AppPageLocators.BACK_BUTTON_ID)

        assert Actions.isObjectExistsID(
            self, driver, AppPageLocators.GALLERY_BLOCK_ID) is False

        Actions.scrollPageToUp(self, driver)

        # Editor's choice block swipe
        assert Actions.getFewTextsXP(self, driver,
                                     MainLocators.OVERALL_TABS_XP) == [
                                         'Games', 'Apps', 'Games', 'Apps'
                                     ]

        assert Actions.count_of_elements_id(self, driver,
                                            MainLocators.APP_ICON_ID) == 13

        Actions.swipeSectionsToLeft(self, driver)

        assert Actions.count_of_elements_id(self, driver,
                                            MainLocators.APP_ICON_ID) == 10

        Actions.swipeSectionsToRight(self, driver)

        assert Actions.count_of_elements_id(self, driver,
                                            MainLocators.APP_ICON_ID) == 13

        # Editor's choice block click
        Actions.clickButtonXP(self, driver, MainLocators.FOURTH_TAB_XP)

        assert Actions.count_of_elements_id(self, driver,
                                            MainLocators.APP_ICON_ID) == 10

        Actions.clickButtonXP(self, driver, MainLocators.THIRD_TAB_XP)

        assert Actions.count_of_elements_id(self, driver,
                                            MainLocators.APP_ICON_ID) == 13

        # Test open app page from editors choice  block
        assert Actions.isObjectExistsID(
            self, driver, AppPageLocators.GALLERY_BLOCK_ID) is False

        Actions.clickButtonXP(self, driver,
                              MainLocators.APP_TO_OPEN_EDITORS_CHOICE_XP)

        assert Actions.isObjectExistsID(
            self, driver, AppPageLocators.GALLERY_BLOCK_ID) is True

        Actions.clickButtonID(self, driver, AppPageLocators.BACK_BUTTON_ID)

        assert Actions.isObjectExistsID(
            self, driver, AppPageLocators.GALLERY_BLOCK_ID) is False
Ejemplo n.º 5
0
    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'
Ejemplo n.º 6
0
    def test_switch_between_folders(self, driver):
        # Start folder is movies
        movies_page_title = Actions.getTextID(self, driver,
                                              Locators.PAGE_TITLE_ID)
        assert movies_page_title == 'Movies'
        Actions.clickButtonXP(self, driver, Locators.MENU_BUTTON_XP)
        Actions.clickButtonXP(self, driver, Locators.DOWNLOADS_BUTTON_XP)
        downloads_page_title = Actions.getTextID(self, driver,
                                                 Locators.PAGE_TITLE_ID)
        assert downloads_page_title == 'Downloads'
        Actions.clickButtonXP(self, driver, Locators.MENU_BUTTON_XP)
        Actions.clickButtonXP(self, driver, Locators.MOVIES_BUTTON_XP)
        Actions.clickButtonXP(self, driver, Locators.MENU_BUTTON_XP)
        Actions.clickButtonXP(self, driver, Locators.CAMERA_BUTTON_XP)
        camera_page_title = Actions.getTextID(self, driver,
                                              Locators.PAGE_TITLE_ID)
        assert camera_page_title == 'Camera'
        Actions.clickButtonXP(self, driver, Locators.MENU_BUTTON_XP)
        Actions.clickButtonXP(self, driver, Locators.MOVIES_BUTTON_XP)
        Actions.clickButtonXP(self, driver, Locators.MENU_BUTTON_XP)
        Actions.clickButtonXP(self, driver, Locators.PICTURES_BUTTON_XP)
        pictures_page_title = Actions.getTextID(self, driver,
                                                Locators.PAGE_TITLE_ID)
        assert pictures_page_title == 'Pictures'
        Actions.clickButtonXP(self, driver, Locators.MENU_BUTTON_XP)
        Actions.clickButtonXP(self, driver, Locators.MOVIES_BUTTON_XP)
        Actions.clickButtonXP(self, driver, Locators.MENU_BUTTON_XP)
        Actions.clickButtonXP(self, driver, Locators.INT_STORAGE_BUTTON_XP)
        intstorage_page_title = Actions.getTextID(self, driver,
                                                  Locators.PAGE_TITLE_ID)
        assert intstorage_page_title == 'Internal Storage'
        Actions.clickButtonXP(self, driver, Locators.MENU_BUTTON_XP)
        Actions.clickButtonXP(self, driver, Locators.MOVIES_BUTTON_XP)
        Actions.clickButtonXP(self, driver, Locators.MENU_BUTTON_XP)
        Actions.clickButtonXP(self, driver, Locators.SD_CARD_BUTTON_XP)
        sdcard_page_title = Actions.getTextID(self, driver,
                                              Locators.PAGE_TITLE_ID)
        assert sdcard_page_title == 'SD Card'

        # Start folder is downloads
        Actions.clickButtonXP(self, driver, Locators.MENU_BUTTON_XP)
        Actions.clickButtonXP(self, driver, Locators.DOWNLOADS_BUTTON_XP)
        Actions.clickButtonXP(self, driver, Locators.MENU_BUTTON_XP)
        Actions.clickButtonXP(self, driver, Locators.MOVIES_BUTTON_XP)
        movies_page_title = Actions.getTextID(self, driver,
                                              Locators.PAGE_TITLE_ID)
        assert movies_page_title == 'Movies'
        Actions.clickButtonXP(self, driver, Locators.MENU_BUTTON_XP)
        Actions.clickButtonXP(self, driver, Locators.DOWNLOADS_BUTTON_XP)
        Actions.clickButtonXP(self, driver, Locators.MENU_BUTTON_XP)
        Actions.clickButtonXP(self, driver, Locators.CAMERA_BUTTON_XP)
        camera_page_title = Actions.getTextID(self, driver,
                                              Locators.PAGE_TITLE_ID)
        assert camera_page_title == 'Camera'
        Actions.clickButtonXP(self, driver, Locators.MENU_BUTTON_XP)
        Actions.clickButtonXP(self, driver, Locators.DOWNLOADS_BUTTON_XP)
        Actions.clickButtonXP(self, driver, Locators.MENU_BUTTON_XP)
        Actions.clickButtonXP(self, driver, Locators.PICTURES_BUTTON_XP)
        pictures_page_title = Actions.getTextID(self, driver,
                                                Locators.PAGE_TITLE_ID)
        assert pictures_page_title == 'Pictures'
        Actions.clickButtonXP(self, driver, Locators.MENU_BUTTON_XP)
        Actions.clickButtonXP(self, driver, Locators.DOWNLOADS_BUTTON_XP)
        Actions.clickButtonXP(self, driver, Locators.MENU_BUTTON_XP)
        Actions.clickButtonXP(self, driver, Locators.INT_STORAGE_BUTTON_XP)
        intstorage_page_title = Actions.getTextID(self, driver,
                                                  Locators.PAGE_TITLE_ID)
        assert intstorage_page_title == 'Internal Storage'
        Actions.clickButtonXP(self, driver, Locators.MENU_BUTTON_XP)
        Actions.clickButtonXP(self, driver, Locators.DOWNLOADS_BUTTON_XP)
        Actions.clickButtonXP(self, driver, Locators.MENU_BUTTON_XP)
        Actions.clickButtonXP(self, driver, Locators.SD_CARD_BUTTON_XP)
        sdcard_page_title = Actions.getTextID(self, driver,
                                              Locators.PAGE_TITLE_ID)
        assert sdcard_page_title == 'SD Card'

        # Start folder is camera
        Actions.clickButtonXP(self, driver, Locators.MENU_BUTTON_XP)
        Actions.clickButtonXP(self, driver, Locators.CAMERA_BUTTON_XP)
        Actions.clickButtonXP(self, driver, Locators.MENU_BUTTON_XP)
        Actions.clickButtonXP(self, driver, Locators.MOVIES_BUTTON_XP)
        movies_page_title = Actions.getTextID(self, driver,
                                              Locators.PAGE_TITLE_ID)
        assert movies_page_title == 'Movies'
        Actions.clickButtonXP(self, driver, Locators.MENU_BUTTON_XP)
        Actions.clickButtonXP(self, driver, Locators.CAMERA_BUTTON_XP)
        Actions.clickButtonXP(self, driver, Locators.MENU_BUTTON_XP)
        Actions.clickButtonXP(self, driver, Locators.DOWNLOADS_BUTTON_XP)
        downloads_page_title = Actions.getTextID(self, driver,
                                                 Locators.PAGE_TITLE_ID)
        assert downloads_page_title == 'Downloads'
        Actions.clickButtonXP(self, driver, Locators.MENU_BUTTON_XP)
        Actions.clickButtonXP(self, driver, Locators.CAMERA_BUTTON_XP)
        Actions.clickButtonXP(self, driver, Locators.MENU_BUTTON_XP)
        Actions.clickButtonXP(self, driver, Locators.PICTURES_BUTTON_XP)
        pictures_page_title = Actions.getTextID(self, driver,
                                                Locators.PAGE_TITLE_ID)
        assert pictures_page_title == 'Pictures'
        Actions.clickButtonXP(self, driver, Locators.MENU_BUTTON_XP)
        Actions.clickButtonXP(self, driver, Locators.CAMERA_BUTTON_XP)
        Actions.clickButtonXP(self, driver, Locators.MENU_BUTTON_XP)
        Actions.clickButtonXP(self, driver, Locators.INT_STORAGE_BUTTON_XP)
        intstorage_page_title = Actions.getTextID(self, driver,
                                                  Locators.PAGE_TITLE_ID)
        assert intstorage_page_title == 'Internal Storage'
        Actions.clickButtonXP(self, driver, Locators.MENU_BUTTON_XP)
        Actions.clickButtonXP(self, driver, Locators.CAMERA_BUTTON_XP)
        Actions.clickButtonXP(self, driver, Locators.MENU_BUTTON_XP)
        Actions.clickButtonXP(self, driver, Locators.SD_CARD_BUTTON_XP)
        sdcard_page_title = Actions.getTextID(self, driver,
                                              Locators.PAGE_TITLE_ID)
        assert sdcard_page_title == 'SD Card'

        # Start folder is pictures
        Actions.clickButtonXP(self, driver, Locators.MENU_BUTTON_XP)
        Actions.clickButtonXP(self, driver, Locators.PICTURES_BUTTON_XP)
        Actions.clickButtonXP(self, driver, Locators.MENU_BUTTON_XP)
        Actions.clickButtonXP(self, driver, Locators.MOVIES_BUTTON_XP)
        movies_page_title = Actions.getTextID(self, driver,
                                              Locators.PAGE_TITLE_ID)
        assert movies_page_title == 'Movies'
        Actions.clickButtonXP(self, driver, Locators.MENU_BUTTON_XP)
        Actions.clickButtonXP(self, driver, Locators.PICTURES_BUTTON_XP)
        Actions.clickButtonXP(self, driver, Locators.MENU_BUTTON_XP)
        Actions.clickButtonXP(self, driver, Locators.DOWNLOADS_BUTTON_XP)
        downloads_page_title = Actions.getTextID(self, driver,
                                                 Locators.PAGE_TITLE_ID)
        assert downloads_page_title == 'Downloads'
        Actions.clickButtonXP(self, driver, Locators.MENU_BUTTON_XP)
        Actions.clickButtonXP(self, driver, Locators.PICTURES_BUTTON_XP)
        Actions.clickButtonXP(self, driver, Locators.MENU_BUTTON_XP)
        Actions.clickButtonXP(self, driver, Locators.CAMERA_BUTTON_XP)
        camera_page_title = Actions.getTextID(self, driver,
                                              Locators.PAGE_TITLE_ID)
        assert camera_page_title == 'Camera'
        Actions.clickButtonXP(self, driver, Locators.MENU_BUTTON_XP)
        Actions.clickButtonXP(self, driver, Locators.PICTURES_BUTTON_XP)
        Actions.clickButtonXP(self, driver, Locators.MENU_BUTTON_XP)
        Actions.clickButtonXP(self, driver, Locators.INT_STORAGE_BUTTON_XP)
        intstorage_page_title = Actions.getTextID(self, driver,
                                                  Locators.PAGE_TITLE_ID)
        assert intstorage_page_title == 'Internal Storage'
        Actions.clickButtonXP(self, driver, Locators.MENU_BUTTON_XP)
        Actions.clickButtonXP(self, driver, Locators.PICTURES_BUTTON_XP)
        Actions.clickButtonXP(self, driver, Locators.MENU_BUTTON_XP)
        Actions.clickButtonXP(self, driver, Locators.SD_CARD_BUTTON_XP)
        sdcard_page_title = Actions.getTextID(self, driver,
                                              Locators.PAGE_TITLE_ID)
        assert sdcard_page_title == 'SD Card'

        # Start folder is internal storage
        Actions.clickButtonXP(self, driver, Locators.MENU_BUTTON_XP)
        Actions.clickButtonXP(self, driver, Locators.INT_STORAGE_BUTTON_XP)
        Actions.clickButtonXP(self, driver, Locators.MENU_BUTTON_XP)
        Actions.clickButtonXP(self, driver, Locators.MOVIES_BUTTON_XP)
        movies_page_title = Actions.getTextID(self, driver,
                                              Locators.PAGE_TITLE_ID)
        assert movies_page_title == 'Movies'
        Actions.clickButtonXP(self, driver, Locators.MENU_BUTTON_XP)
        Actions.clickButtonXP(self, driver, Locators.INT_STORAGE_BUTTON_XP)
        Actions.clickButtonXP(self, driver, Locators.MENU_BUTTON_XP)
        Actions.clickButtonXP(self, driver, Locators.DOWNLOADS_BUTTON_XP)
        downloads_page_title = Actions.getTextID(self, driver,
                                                 Locators.PAGE_TITLE_ID)
        assert downloads_page_title == 'Downloads'
        Actions.clickButtonXP(self, driver, Locators.MENU_BUTTON_XP)
        Actions.clickButtonXP(self, driver, Locators.INT_STORAGE_BUTTON_XP)
        Actions.clickButtonXP(self, driver, Locators.MENU_BUTTON_XP)
        Actions.clickButtonXP(self, driver, Locators.CAMERA_BUTTON_XP)
        camera_page_title = Actions.getTextID(self, driver,
                                              Locators.PAGE_TITLE_ID)
        assert camera_page_title == 'Camera'
        Actions.clickButtonXP(self, driver, Locators.MENU_BUTTON_XP)
        Actions.clickButtonXP(self, driver, Locators.INT_STORAGE_BUTTON_XP)
        Actions.clickButtonXP(self, driver, Locators.MENU_BUTTON_XP)
        Actions.clickButtonXP(self, driver, Locators.PICTURES_BUTTON_XP)
        pictures_page_title = Actions.getTextID(self, driver,
                                                Locators.PAGE_TITLE_ID)
        assert pictures_page_title == 'Pictures'
        Actions.clickButtonXP(self, driver, Locators.MENU_BUTTON_XP)
        Actions.clickButtonXP(self, driver, Locators.INT_STORAGE_BUTTON_XP)
        Actions.clickButtonXP(self, driver, Locators.MENU_BUTTON_XP)
        Actions.clickButtonXP(self, driver, Locators.SD_CARD_BUTTON_XP)
        sdcard_page_title = Actions.getTextID(self, driver,
                                              Locators.PAGE_TITLE_ID)
        assert sdcard_page_title == 'SD Card'

        # Start folder is sd card
        Actions.clickButtonXP(self, driver, Locators.MENU_BUTTON_XP)
        Actions.clickButtonXP(self, driver, Locators.SD_CARD_BUTTON_XP)
        Actions.clickButtonXP(self, driver, Locators.MENU_BUTTON_XP)
        Actions.clickButtonXP(self, driver, Locators.MOVIES_BUTTON_XP)
        movies_page_title = Actions.getTextID(self, driver,
                                              Locators.PAGE_TITLE_ID)
        assert movies_page_title == 'Movies'
        Actions.clickButtonXP(self, driver, Locators.MENU_BUTTON_XP)
        Actions.clickButtonXP(self, driver, Locators.SD_CARD_BUTTON_XP)
        Actions.clickButtonXP(self, driver, Locators.MENU_BUTTON_XP)
        Actions.clickButtonXP(self, driver, Locators.DOWNLOADS_BUTTON_XP)
        downloads_page_title = Actions.getTextID(self, driver,
                                                 Locators.PAGE_TITLE_ID)
        assert downloads_page_title == 'Downloads'
        Actions.clickButtonXP(self, driver, Locators.MENU_BUTTON_XP)
        Actions.clickButtonXP(self, driver, Locators.SD_CARD_BUTTON_XP)
        Actions.clickButtonXP(self, driver, Locators.MENU_BUTTON_XP)
        Actions.clickButtonXP(self, driver, Locators.CAMERA_BUTTON_XP)
        camera_page_title = Actions.getTextID(self, driver,
                                              Locators.PAGE_TITLE_ID)
        assert camera_page_title == 'Camera'
        Actions.clickButtonXP(self, driver, Locators.MENU_BUTTON_XP)
        Actions.clickButtonXP(self, driver, Locators.SD_CARD_BUTTON_XP)
        Actions.clickButtonXP(self, driver, Locators.MENU_BUTTON_XP)
        Actions.clickButtonXP(self, driver, Locators.PICTURES_BUTTON_XP)
        pictures_page_title = Actions.getTextID(self, driver,
                                                Locators.PAGE_TITLE_ID)
        assert pictures_page_title == 'Pictures'
        Actions.clickButtonXP(self, driver, Locators.MENU_BUTTON_XP)
        Actions.clickButtonXP(self, driver, Locators.INT_STORAGE_BUTTON_XP)
        Actions.clickButtonXP(self, driver, Locators.MENU_BUTTON_XP)
        Actions.clickButtonXP(self, driver, Locators.INT_STORAGE_BUTTON_XP)
        intstorage_page_title = Actions.getTextID(self, driver,
                                                  Locators.PAGE_TITLE_ID)
        assert intstorage_page_title == 'Internal Storage'
    def test_sorting(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 DATE DESCENDING
        Actions.clickButtonXP(self, driver, Locators.SORT_BUTTON_XP)
        Actions.clickButtonXP(self, driver, Locators.DATE_DESCENDING_BUTTON_XP)
        file_names_date_desc = Actions.getFewTextsID(
            self, driver, Locators.FILE_NAME_TEXT_ID)
        assert file_names_date_desc == Locators.DATE_DESCENDING_FILE_LIST

        # Test DATE ASCENDING
        Actions.clickButtonXP(self, driver, Locators.SORT_BUTTON_XP)
        Actions.clickButtonXP(self, driver, Locators.DATE_ASCENDING_BUTTON_XP)
        file_names_date_asc = Actions.getFewTextsID(self, driver,
                                                    Locators.FILE_NAME_TEXT_ID)
        assert file_names_date_asc == Locators.DATE_ASCENDING_FILE_LIST

        # Test NAME DESCENDING
        Actions.clickButtonXP(self, driver, Locators.SORT_BUTTON_XP)
        Actions.clickButtonXP(self, driver, Locators.NAME_DESCENDING_BUTTON_XP)
        file_names_name_desc = Actions.getFewTextsID(
            self, driver, Locators.FILE_NAME_TEXT_ID)
        assert file_names_name_desc == Locators.NAME_DESCENDING_FILE_LIST

        # Test NAME ASCENDING
        Actions.clickButtonXP(self, driver, Locators.SORT_BUTTON_XP)
        Actions.clickButtonXP(self, driver, Locators.NAME_ASCENDING_BUTTON_XP)
        file_names_name_asc = Actions.getFewTextsID(self, driver,
                                                    Locators.FILE_NAME_TEXT_ID)
        assert file_names_name_asc == Locators.NAME_ASCENDING_FILE_LIST
    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'
    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'
Ejemplo n.º 10
0
    def test_move_file(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)
        Actions.clickButtonXP(self, driver, Locators.SELECT_ALL_BUTTON_XP)

        count_on_pictures_page_before = Actions.count_of_all_selected(self, driver)

        Actions.clickButtonXP(self, driver, Locators.BACK_BUTTON_IF_SELECTED_XP)
        Actions.clickButtonXP(self, driver, Locators.MENU_BUTTON_XP)
        Actions.clickButtonXP(self, driver, Locators.CAMERA_BUTTON_XP)

        Actions.longtap(self, driver, Locators.FIRST_FILE_FOLDER_XP)
        Actions.clickButtonXP(self, driver, Locators.SUBMENU_BUTTON_XP)
        Actions.clickButtonXP(self, driver, Locators.MOVE_BUTTON_XP)
        Actions.clickButtonID(self, driver, Locators.CANCEL_MOVE_BUTTON_ID)

        assert Actions.isObjectExistsID(self, driver, Locators.IS_SELECTED_FILE_ID) == False

        Actions.longtap(self, driver, Locators.FIRST_FILE_FOLDER_XP)
        Actions.clickButtonXP(self, driver, Locators.SUBMENU_BUTTON_XP)
        Actions.clickButtonXP(self, driver, Locators.MOVE_BUTTON_XP)
        Actions.clickButtonXP(self, driver, Locators.MENU_BUTTON_XP)
        Actions.clickButtonXP(self, driver, Locators.PICTURES_BUTTON_XP)
        Actions.clickButtonID(self, driver, Locators.OK_MOVE_BUTTON_ID)
        driver.lock()
        driver.unlock()
        Actions.clickButtonXP(self, driver, Locators.SUBMENU_BUTTON_XP)
        Actions.clickButtonXP(self, driver, Locators.SELECT_ALL_BUTTON_XP)

        count_on_pictures_page_after = Actions.count_of_all_selected(self, driver)

        assert count_on_pictures_page_before < count_on_pictures_page_after
Ejemplo n.º 11
0
    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
Ejemplo n.º 12
0
    def test_delete_file(self, driver):
        Actions.clickButtonXP(self, driver, Locators.MENU_BUTTON_XP)
        Actions.clickButtonXP(self, driver, Locators.DOWNLOADS_BUTTON_XP)
        Actions.clickButtonXP(self, driver, Locators.SUBMENU_BUTTON_XP)
        Actions.clickButtonXP(self, driver, Locators.SELECT_ALL_BUTTON_XP)

        count_on_downloads_page_before = Actions.count_of_all_selected(self, driver)

        Actions.clickButtonXP(self, driver, Locators.BACK_BUTTON_IF_SELECTED_XP)
        Actions.longtap(self, driver, Locators.FIRST_FILE_FOLDER_XP)
        Actions.clickButtonID(self, driver, Locators.DELETE_BUTTON_IF_SELECTED_ID)

        assert Actions.getTextID(self, driver, Locators.POPUP_NAME_ID) == 'Delete files'

        Actions.clickButtonID(self, driver, Locators.POPUP_SAVE_BUTTON_ID)
        Actions.clickButtonXP(self, driver, Locators.SUBMENU_BUTTON_XP)
        Actions.clickButtonXP(self, driver, Locators.SELECT_ALL_BUTTON_XP)

        count_on_downloads_page_after = Actions.count_of_all_selected(self, driver)

        assert count_on_downloads_page_before > count_on_downloads_page_after