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
    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'
Exemplo n.º 3
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'
    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'