class ImageViewing(UIATestBase):
    def setUp(self):
        print "[Setup]:%s" % self.__class__.__name__
        super(ImageViewing, self).setUp()
        self.device = g_common_obj.get_device()
        self.photos = get_photo_implement()
        self.qrcodeImpl = QRcode()
        self.wallpaper = WallpaperImpl()

        self.photos.rm_delete_photos()
        self.photos.refresh_sdcard()

        self.qrcode = "GIFPICTURE"
        config = TestConfig()
        cfg_file = 'tests.tablet.artifactory.conf'
        cfg_arti = config.read(cfg_file, 'artifactory')
        config_handle = ConfigHandle()
        cfg_arti["location"] = config_handle.read_configuration(
            'artifactory', 'location', '/etc/oat/', 'sys.conf')

        cfg = config.read(cfg_file, 'qrcode_marked_image')
        self.qrcode = cfg.get("screenshot_imageview_qrcode")
        print "[Debug] qrcode:%s" % (self.qrcode)
        arti = Artifactory(cfg_arti.get('location'))
        pic_name = cfg.get("screenshot_imageview_image")
        file_path = arti.get(pic_name)
        g_common_obj.adb_cmd_common('push ' + file_path + ' /sdcard/Pictures')
        self.photos.refresh_sdcard()

    def tearDown(self):
        print "[tearDown]:%s" % self.__class__.__name__
        self.photos.rm_delete_photos()
        self.photos.refresh_sdcard()
        super(ImageViewing, self).tearDown()

    def test_AppTransparency_ImageViewing(self):
        ''' refer TC test_AppTransparency_ImageViewing
        '''
        print "[RunTest]: %s" % self.__str__()
        self.photos.launch_photos_am()
        self.photos.open_a_picture()
        if self.device(
                resourceId=
                "com.google.android.apps.photos:id/photos_overflow_icon"):
            self.device(
                resourceId=
                "com.google.android.apps.photos:id/photos_overflow_icon"
            ).click.wait()
        if self.device(resourceId=
                       "com.google.android.apps.photos:id/actionbar_overflow"):
            self.device(
                resourceId="com.google.android.apps.photos:id/actionbar_overflow"
            ).click.wait()
        time.sleep(1)
        self.qrcodeImpl.verify_qrcode_marked_image(self.qrcode,
                                                   set_wallpaper=False)
        g_common_obj.assert_exp_happens()
        self.photos.stop_photos_am()
Exemple #2
0
class ImageViewByWebBrowser(UIATestBase):
    @classmethod
    def setUpClass(self):
        """
        set environment
        """
        super(ImageViewByWebBrowser, self).setUpClass()
        self.photos = get_photo_implement()
        self._qrcode = QRcode()
        self._chrome = ChromeExtendImpl()
        self.photos.rm_delete_photos()
        config = TestConfig()
        cfg_file = 'tests.tablet.artifactory.conf'
        cfg_arti = config.read(cfg_file, 'artifactory')
        config_handle = ConfigHandle()
        cfg_arti["location"] = config_handle.read_configuration(
            'artifactory', 'location', '/etc/oat/', 'sys.conf')
        cfg = config.read(cfg_file, 'qrcode_marked_image')
        arti = Artifactory(cfg_arti.get('location'))
        pic_name = cfg.get("bmp01")
        self.pic_name1 = pic_name.split("/")[-1]
        self.qrcode1 = cfg.get("bmp01_qrcode")
        file_path = arti.get(pic_name)
        self.photos.deploy_photo_content(local_file=file_path)

        pic_name = cfg.get("bmp02")
        self.pic_name2 = pic_name.split("/")[-1]
        self.qrcode2 = cfg.get("bmp02_qrcode")
        file_path = arti.get(pic_name)
        self.photos.deploy_photo_content(local_file=file_path)

        self._chrome.launch()
        self._chrome.chrome_setup()

    def setUp(self):
        super(ImageViewByWebBrowser, self).setUp()
        self._test_name = __name__
        print "[Setup]: %s" % self._test_name
        self._imageviewer = ImageDetails()

    def tearDown(self):
        print "[Teardown]: %s" % self._test_name
        super(ImageViewByWebBrowser, self).tearDown()
        self.photos.rm_delete_photos()

    def test_ImageView_ByWebBrowser_BMP(self):
        ''' refer TC test_ImageView_ByWebBrowser_BMP
        '''
        print "[RunTest]: %s" % self.__str__()
        pics = {self.pic_name1: self.qrcode1, self.pic_name2: self.qrcode2}
        for p in pics.keys():
            self._chrome.launch()
            self._chrome.open_website("file:///mnt/sdcard/Pictures/%s" % p)
            time.sleep(5)
            self.photos.refresh_sdcard()
            self.photos.open_image_command("/sdcard/Download/%s" % p)
            self._qrcode.verify_qrcode_marked_image(pics[p], False)
            g_common_obj.assert_exp_happens()
class ComposeUI(UIATestBase):

    def setUp(self):
        super(ComposeUI, self).setUp()
        self._test_name = __name__
        self.device = g_common_obj.get_device()
        print "[Setup]: %s" % self._test_name
        self._composeui = ComposeUiImpl()
        self._imageviewer = ImageDetails()
        self.photos = PhotosExtendImpl()
        self.photosImpl = get_photo_implement()
        self.qrcodeImpl = QRcode()
        g_common_obj.root_on_device()
        g_common_obj.remount_device()
        self.photosImpl.rm_delete_photos()
        self.photosImpl.refresh_sdcard()
        self.photos.clean()

        self.qrcode = "GIFPICTURE"
        config = TestConfig()
        cfg_file = 'tests.tablet.artifactory.conf'
        cfg_arti = config.read(cfg_file, 'artifactory')
        config_handle = ConfigHandle()
        cfg_arti["location"] = config_handle.read_configuration('artifactory', 'location', '/etc/oat/', 'sys.conf')

        cfg = config.read(cfg_file, 'qrcode_marked_image')
        self.qrcode = cfg.get("screenshot_edit_qrcode")
        print "[Debug] qrcode:%s" % (self.qrcode)
        arti = Artifactory(cfg_arti.get('location'))
        pic_name = cfg.get("screenshot_edit_image")
        file_path = arti.get(pic_name)
        g_common_obj.adb_cmd_common('push ' + file_path + ' /sdcard/Pictures')
        self.photosImpl.refresh_sdcard()
        special_actions.setup()
        self.photos.setup()

    def tearDown(self):
        print "[Teardown]: %s" % self._test_name
        super(ComposeUI, self).tearDown()
        self.photosImpl.rm_delete_photos()
        self.photosImpl.refresh_sdcard()
        clearTmpDir()

    def test_screenshot_imageedit(self):
        ''' refer TC test_screenshot_imageedit
        '''
        print "[RunTest]: %s" % self.__str__()
        self.photosImpl.launch_photos_am()
        self._composeui.addeffects_check_screenshot()
        self.device.press.back()
        time.sleep(2)
        self.photosImpl.open_a_picture()
        self.qrcodeImpl.verify_qrcode_marked_image(self.qrcode, set_wallpaper=False)
        self.photosImpl.stop_photos_am()
class ComposeUI(UIATestBase):

    def setUp(self):
        super(ComposeUI, self).setUp()
        self._test_name = __name__
        print "[Setup]: %s" % self._test_name
        self._composeui = ComposeUiImpl()
        self.photos = get_photo_implement()
        self.qrcodeImpl = QRcode()
        self.photosImpl = get_photo_implement()
        self.photosImpl.rm_delete_photos()
        self.photosImpl.refresh_sdcard()
#         self.photos.clean()

        self.qrcode = "GIFPICTURE"
        config = TestConfig()
        cfg_file = 'tests.tablet.artifactory.conf'
        cfg_arti = config.read(cfg_file, 'artifactory')
        config_handle = ConfigHandle()
        cfg_arti["location"] = config_handle.read_configuration('artifactory', 'location', '/etc/oat/', 'sys.conf')

        cfg = config.read(cfg_file, 'qrcode_marked_image')
        self.qrcode = cfg.get("screenshot_imageview_qrcode")
        print "[Debug] qrcode:%s" % (self.qrcode)
        arti = Artifactory(cfg_arti.get('location'))
        pic_name = cfg.get("screenshot_imageview_image")
        file_path = arti.get(pic_name)
        g_common_obj.adb_cmd_common('push ' + file_path + ' /sdcard/Pictures')
        self.pic_path = '/sdcard/Pictures/' + os.path.basename(file_path)
        self.photosImpl.refresh_sdcard()
        special_actions.setup()

    def tearDown(self):
        print "[Teardown]: %s" % self._test_name
        super(ComposeUI, self).tearDown()
        self.photosImpl.rm_delete_photos()
        self.photosImpl.refresh_sdcard()

    def test_screenshot_imageviewing(self):
        ''' refer TC test_screenshot_imageviewing
        '''
        print "[RunTest]: %s" % self.__str__()
#         self.photosImpl.launch_photos_am()
#         self.photosImpl.open_a_picture()
        self.photos.open_image_command(self.pic_path)
        time.sleep(3)
        self.qrcodeImpl.verify_qrcode_marked_image(self.qrcode, set_wallpaper=False)
        self.photosImpl.stop_photos_am()
class WallpaperSetBMPImageTest(UIATestBase):
    @classmethod
    def setUpClass(cls):
        print "[setUpClass]: %s" % cls.__name__
        super(WallpaperSetBMPImageTest, cls).setUpClass()
        cls.d = g_common_obj.get_device()
        g_common_obj.root_on_device()
#         g_common_obj.remount_device()

    def setUp(self):
        print "[Setup]:%s" % self.__class__.__name__
        super(WallpaperSetBMPImageTest, self).setUp()

        self.photos = PhotosExtendImpl()
        self.camera = CameraExtendImpl()
        self.systemui = SystemUiExtendImpl()
        self.photosImpl = get_photo_implement()
        self.qrcodeImpl = QRcode()
        #         self.wallpaper = WallpaperImpl()
        #         self.systemui.unlock_screen()
        #         self.d.screen.on()
        #         self.d.press.menu()

        self.photos.clean()
        self.camera.clean()
        #         self.photosImpl.rm_delete_photos()
        #         self.photosImpl.refresh_sdcard()
        #         self.wallpaper.reset_wallpaper()

        self.qrcode = "GIFPICTURE"
        config = TestConfig()
        cfg_file = 'tests.tablet.artifactory.conf'
        cfg_arti = config.read(cfg_file, 'artifactory')
        config_handle = ConfigHandle()
        cfg_arti["location"] = config_handle.read_configuration(
            'artifactory', 'location', '/etc/oat/', 'sys.conf')

        cfg = config.read(cfg_file, 'qrcode_marked_image')
        self.qrcode = cfg.get("wallpaperset_bmp_qrcode")
        print "[Debug] qrcode:%s" % (self.qrcode)
        arti = Artifactory(cfg_arti.get('location'))
        pic_name = cfg.get("wallpaperset_bmp_image")
        file_path = arti.get(pic_name)
        g_common_obj.adb_cmd_common('push ' + file_path + ' /sdcard/Pictures')
        self.photosImpl.refresh_sdcard()
        special_actions.setup()

        self.mark_time = logcat.get_device_time_mark()

    def tearDown(self):
        print "[tearDown]:%s" % self.__class__.__name__
        self.photosImpl.rm_delete_photos()
        self.photosImpl.refresh_sdcard()
        #         fatal_msg = logcat.get_device_log(self.mark_time, filters='*:F')
        #         assert len(fatal_msg) == 0,\
        #             "occurred Fatal error during testing:\n%s" % (fatal_msg)
        super(WallpaperSetBMPImageTest, self).tearDown()

    @classmethod
    def tearDownClass(cls):
        print "[tearDownClass]: %s" % cls.__name__
        super(WallpaperSetBMPImageTest, cls).tearDownClass()

    def test_WallpaperSet_BMPImage(self):
        """
        test_WallpaperSet_BMPImage

        Steps:
        1. Open a BMP picture by Gallery app
        BMP image display is OK.
        2. Select "Set as..." Wallpaper option and crop the picture
        Select wallpaper option and crop the picture are OK.
        3. Back the home UI to check the wallpaer after setting
        The BMP picture can set as wallpaper successfully. DUT has no crash or freeze.
        """
        print "[RunTest]: %s" % self.__str__()

        print """[Step] 1. Open a BMP picture by Gallery app
            BMP image display is OK."""
        self.photosImpl.launch_photos_am()
        self.photosImpl.open_a_picture()
        print """[Step] 2. Select "Set as..." Wallpaper option and crop the picture
            Select wallpaper option and crop the picture are OK."""
        self.photosImpl.set_picture_as_wallpaper()
        print """[Step] 3. Back the home UI to check the wallpaer after setting
            The BMP picture can set as wallpaper successfully. DUT has no crash or freeze."""
        self.qrcodeImpl.verify_qrcode_marked_image(self.qrcode)
Exemple #6
0
class ImageView(UIATestBase):

    PHOTO_PATH = "/sdcard/Pictures"
    VIDEO_PATH = "/sdcard/Movies"
    ACCEPTABLE_VALUE = 5

    def setUp(self):
        super(ImageView, self).setUp()
        self._test_name = __name__
        print "[Setup]: %s" % self._test_name
        g_common_obj.root_on_device()
        self.d = g_common_obj.get_device()
        self.photosImpl = get_photo_implement()
        self.qr = QRcode()
        self.photosImpl.rm_delete_photos()
        self.photosImpl.stop_photos_am()

    def tearDown(self):
        print "[Teardown]: %s" % self._test_name
        super(ImageView, self).tearDown()
        self.photosImpl.rm_delete_photos()
        remove_aosp_launcher()

    def test_MoreThan10JPEGImagesOfDifferentResolution(self):
        print "[RunTest]: %s" % self.__str__()
        try:
            self.photosImpl.deploy_photo_content("PicturesFolder",
                                                 "jpg_10resolution",
                                                 self.PHOTO_PATH)
            self.photosImpl.refresh_sdcard()
            self.photosImpl.launch_photos_am()
            self.photosImpl.open_a_picture()
            for _ in range(9):
                self.d().swipe.left(steps=10)
                time.sleep(2)
        except:
            raise Exception("Test failed!")

    def test_MoreThan10BMPImages(self):
        print "[RunTest]: %s" % self.__str__()
        try:
            self.photosImpl.deploy_photo_content("PicturesFolder",
                                                 "bmp_10resolution",
                                                 self.PHOTO_PATH)
            self.photosImpl.refresh_sdcard()
            self.photosImpl.launch_photos_am()
            self.photosImpl.open_a_picture()
            for _ in range(9):
                self.d().swipe.left(steps=10)
                time.sleep(2)
        except:
            raise Exception("Test failed!")

    def test_MoreThan10BMPImagesOfDifferentResolution(self):
        print "[RunTest]: %s" % self.__str__()
        try:
            self.photosImpl.deploy_photo_content("PicturesFolder",
                                                 "bmp_10resolution",
                                                 self.PHOTO_PATH)
            self.photosImpl.refresh_sdcard()
            self.photosImpl.launch_photos_am()
            self.photosImpl.open_a_picture()
            for _ in range(9):
                self.d().swipe.left(steps=10)
                time.sleep(2)
        except:
            raise Exception("Test failed!")

    def test_MoreThan10GIFImagesOfDifferentResolution(self):
        print "[RunTest]: %s" % self.__str__()
        try:
            self.photosImpl.deploy_photo_content("PicturesFolder",
                                                 "gif_10resolution",
                                                 self.PHOTO_PATH)
            self.photosImpl.refresh_sdcard()
            self.photosImpl.launch_photos_am()
            self.photosImpl.open_a_picture()
            for _ in range(9):
                self.d().swipe.left(steps=10)
                time.sleep(2)
        except:
            raise Exception("Test failed!")

    def test_MoreThan10PNGImagesOfDifferentResolution(self):
        print "[RunTest]: %s" % self.__str__()
        try:
            self.photosImpl.deploy_photo_content("PicturesFolder",
                                                 "png_10resolution",
                                                 self.PHOTO_PATH)
            self.photosImpl.refresh_sdcard()
            self.photosImpl.launch_photos_am()
            self.photosImpl.open_a_picture()
            for _ in range(9):
                self.d().swipe.left(steps=10)
                time.sleep(2)
        except:
            raise Exception("Test failed!")

    def test_MoreThan10PNGImages(self):
        print "[RunTest]: %s" % self.__str__()
        try:
            self.photosImpl.deploy_photo_content("PicturesFolder",
                                                 "png_10resolution",
                                                 self.PHOTO_PATH)
            self.photosImpl.refresh_sdcard()
            self.photosImpl.launch_photos_am()
            self.photosImpl.open_a_picture()
            for _ in range(9):
                self.d().swipe.left(steps=10)
                time.sleep(2)
        except:
            raise Exception("Test failed!")

    def test_MoreThan10WBMPImagesOfDifferentResolution(self):
        print "[RunTest]: %s" % self.__str__()
        try:
            self.photosImpl.deploy_photo_content("PicturesFolder",
                                                 "wbmp_10resolution",
                                                 self.PHOTO_PATH)
            self.photosImpl.refresh_sdcard()
            self.photosImpl.launch_photos_am()
            self.photosImpl.open_a_picture()
            for _ in range(9):
                self.d().swipe.left(steps=10)
                time.sleep(2)
        except:
            raise Exception("Test failed!")

    def test_MoreThan10WEBPImagesOfDifferentResolution(self):
        print "[RunTest]: %s" % self.__str__()
        try:
            self.photosImpl.deploy_photo_content("PicturesFolder",
                                                 "webp_10resolution",
                                                 self.PHOTO_PATH)
            self.photosImpl.refresh_sdcard()
            self.photosImpl.launch_photos_am()
            self.photosImpl.open_a_picture()
            for _ in range(9):
                self.d().swipe.left(steps=10)
                time.sleep(2)
        except:
            raise Exception("Test failed!")

    def test_AddDisplayEffect_DragProgressBar(self):
        print "[RunTest]: %s" % self.__str__()
        self.photosImpl.deploy_photo_content("Pictures", "picture_004",
                                             self.PHOTO_PATH)
        self.photosImpl.refresh_sdcard()
        self.photosImpl.launch_photos_am()
        self.photosImpl.open_a_picture()
        allEffects = PARENT_EFFECTS + LIGHT_CHILD_EFFECTS + COLOR_CHILD_EFFECTS
        useEffects = []
        loopNum = 5
        for _ in range(loopNum):
            index = random.randint(0, len(allEffects) - 1)
            useEffects.append(allEffects[index])
        useEffects.sort()
        for useEffect in useEffects:
            MinOrMax = [0, 100]
            index = random.randint(0, len(MinOrMax) - 1)
            effectVolume = MinOrMax[index]
            self.photosImpl.change_display_effect(effType=useEffect,
                                                  effVol=effectVolume)
        self.photosImpl.save_changes()
        assert self.photosImpl.check_saved_pic_result(picPath=self.PHOTO_PATH) >= self.ACCEPTABLE_VALUE,\
            "Failed! No effects on the saving pic."

    def test_ImageEdit_AddSaturationEffect(self):
        print "[RunTest]: %s" % self.__str__()
        self.photosImpl.deploy_photo_content("Pictures", "picture_004",
                                             self.PHOTO_PATH)
        self.photosImpl.refresh_sdcard()
        self.photosImpl.launch_photos_am()
        self.photosImpl.open_a_picture()
        # ---------------Grag to left or right---------------
        index = random.randint(0, 1)
        if index == 0:
            effectVolume = random.randint(0, 49)
        else:
            effectVolume = random.randint(50, 100)
        self.photosImpl.change_display_effect(effType='Saturation',
                                              effVol=effectVolume)
        self.photosImpl.save_changes()
        assert self.photosImpl.check_saved_pic_result(picPath=self.PHOTO_PATH) > 0, \
            "Failed! No effects on the saving pic."

    def test_ImageEdit_AddShadowEffect(self):
        print "[RunTest]: %s" % self.__str__()
        self.photosImpl.deploy_photo_content("Pictures", "picture_004",
                                             self.PHOTO_PATH)
        self.photosImpl.refresh_sdcard()
        self.photosImpl.launch_photos_am()
        self.photosImpl.open_a_picture()
        # ---------------Grag to left or right---------------
        effectVolume = [0, 100][random.randint(0, 1)]
        self.photosImpl.change_display_effect(effType='Shadows',
                                              effVol=effectVolume)
        self.photosImpl.save_changes()
        assert self.photosImpl.check_saved_pic_result(picPath=self.PHOTO_PATH) >= self.ACCEPTABLE_VALUE, \
            "Failed! No effects on the saving pic."

    def test_ImageEdit_AddVignetteEffect_BlueImageEditingAndSwitching(self):
        from testlib.graphics.extend_systemui_impl import SystemUiExtendImpl
        print "[RunTest]: %s" % self.__str__()
        self.photosImpl.deploy_photo_content("Pictures", "picture_blue",
                                             self.PHOTO_PATH)
        self.photosImpl.refresh_sdcard()
        settings_pkgName = "com.android.settings"
        g_common_obj.adb_cmd_capture_msg(
            "am start %s" % settings_pkgName)  # launch settings app previously
        self.photosImpl.launch_photos_am()
        self.photosImpl.open_a_picture()
        self.photosImpl.change_display_effect(effType='Vignette', effVol=100)
        SystemUiExtendImpl().switch_recent_app(name='Settings')
        SystemUiExtendImpl().switch_recent_app(name='Photos')
        time.sleep(2)
        self.photosImpl.save_changes()
        assert self.photosImpl.check_saved_pic_result(picPath=self.PHOTO_PATH) >= self.ACCEPTABLE_VALUE, \
            "Failed! No effects on the saving pic."

    def test_ImageEdit_BMP_CancelEdit(self):
        print "[RunTest]: %s" % self.__str__()
        try:
            self.photosImpl.deploy_photo_content("Pictures", "picture_001",
                                                 self.PHOTO_PATH)
            self.photosImpl.refresh_sdcard()
            self.photosImpl.launch_photos_am()
            self.photosImpl.open_a_picture()
            self.photosImpl.change_display_effect(effVol=100)
            self.photosImpl.undo_edit()
        except:
            raise Exception("Test failed!")

    def test_ImageEdit_BMP_Zoom_ByGesture(self):
        print "[RunTest]: %s" % self.__str__()
        try:
            self.photosImpl.deploy_photo_content("Pictures", "picture_001",
                                                 self.PHOTO_PATH)
            self.photosImpl.refresh_sdcard()
            self.photosImpl.launch_photos_am()
            self.photosImpl.open_a_picture()
            self.photosImpl.pic_zoom_out(300)
        except:
            raise Exception("Test failed!")

    def test_ImageEdit_EditPNGImage_CancelEdit(self):
        print "[RunTest]: %s" % self.__str__()
        try:
            self.photosImpl.deploy_photo_content("Pictures", "picture_004",
                                                 self.PHOTO_PATH)
            self.photosImpl.refresh_sdcard()
            self.photosImpl.launch_photos_am()
            self.photosImpl.open_a_picture()
            self.photosImpl.change_display_effect(effVol=100)
            self.photosImpl.undo_edit()
        except:
            raise Exception("Test failed!")

    def test_ImageEdit_GIF_Zoom_ByGesture(self):
        print "[RunTest]: %s" % self.__str__()
        try:
            self.photosImpl.deploy_photo_content("Pictures", "picture_002",
                                                 self.PHOTO_PATH)
            self.photosImpl.refresh_sdcard()
            self.photosImpl.launch_photos_am()
            self.photosImpl.open_a_picture()
            self.photosImpl.pic_zoom_in(300)
        except:
            raise Exception("Test failed!")

    def test_ImageEdit_JPEG_Rotate_LeftRight(self):
        print "[RunTest]: %s" % self.__str__()
        try:
            self.photosImpl.deploy_photo_content("Pictures", "picture_003",
                                                 self.PHOTO_PATH)
            self.photosImpl.refresh_sdcard()
            self.photosImpl.launch_photos_am()
            self.photosImpl.open_a_picture()
            self.photosImpl.click_crop_tools()
            time.sleep(1)
            for _ in range(4):
                self.photosImpl.rotate_90_degrees()
                time.sleep(.5)
        except:
            raise Exception("Test failed!")

    def test_ImageEdit_JPG_Rotate(self):
        print "[RunTest]: %s" % self.__str__()
        self.photosImpl.deploy_photo_content("Pictures", "picture_003",
                                             self.PHOTO_PATH)
        self.photosImpl.refresh_sdcard()
        self.photosImpl.launch_photos_am()
        self.photosImpl.open_a_picture()
        self.photosImpl.click_crop_tools()
        time.sleep(1)
        # --------Rotate left or right--------
        i = [1, 3][random.randint(0, 1)]
        for _ in range(i):
            self.photosImpl.rotate_90_degrees()
        self.photosImpl.save_picture_after_rotation()
        assert self.photosImpl.check_saved_pic_result(picPath=self.PHOTO_PATH) >= self.ACCEPTABLE_VALUE, \
            "Failed! No effects on the saving pic."

    def test_ImageEdit_JPG_Zoom_ByBoth(self):
        print "[RunTest]: %s" % self.__str__()
        try:
            self.photosImpl.deploy_photo_content("Pictures", "picture_003",
                                                 self.PHOTO_PATH)
            self.photosImpl.refresh_sdcard()
            self.photosImpl.launch_photos_am()
            self.photosImpl.open_a_picture()
            self.photosImpl.view_a_picture_fullscreen()
            self.photosImpl.pic_zoom_in(300)
            self.photosImpl.pic_zoom_out(300)
        except:
            raise Exception("Test failed!")

    def test_ImageEdit_PNG_AddShadowEffect_2MBImage(self):
        print "[RunTest]: %s" % self.__str__()
        self.photosImpl.deploy_photo_content("Pictures", "picture_004",
                                             self.PHOTO_PATH)
        self.photosImpl.refresh_sdcard()
        self.photosImpl.launch_photos_am()
        self.photosImpl.open_a_picture()
        self.photosImpl.change_display_effect(effType='Shadows', effVol=100)
        self.photosImpl.save_changes()
        assert self.photosImpl.check_saved_pic_result(picPath=self.PHOTO_PATH) >= self.ACCEPTABLE_VALUE, \
            "Failed! No effects on the saving pic."

    def test_ImageEdit_PNG_Rotate(self):
        print "[RunTest]: %s" % self.__str__()
        self.photosImpl.deploy_photo_content("Pictures", "picture_004",
                                             self.PHOTO_PATH)
        self.photosImpl.refresh_sdcard()
        self.photosImpl.launch_photos_am()
        self.photosImpl.open_a_picture()
        self.photosImpl.click_crop_tools()
        time.sleep(1)
        # --------Rotate left or right--------
        i = [1, 3][random.randint(0, 1)]
        for _ in range(i):
            self.photosImpl.rotate_90_degrees()
        self.photosImpl.save_picture_after_rotation()
        assert self.photosImpl.check_saved_pic_result(picPath=self.PHOTO_PATH) >= self.ACCEPTABLE_VALUE, \
            "Failed! No effects on the saving pic."

    def test_ImageEdit_PNG_SaveEdit(self):
        print "[RunTest]: %s" % self.__str__()
        self.photosImpl.deploy_photo_content("Pictures", "picture_004",
                                             self.PHOTO_PATH)
        self.photosImpl.refresh_sdcard()
        self.photosImpl.launch_photos_am()
        self.photosImpl.open_a_picture()
        self.photosImpl.change_display_effect(effVol=100)
        self.photosImpl.save_changes()
        assert self.photosImpl.check_saved_pic_result(picPath=self.PHOTO_PATH) >= self.ACCEPTABLE_VALUE, \
            "Failed! No effects on the saving pic."

    def test_ImageEdit_PNG_Zoom_ByGesture(self):
        print "[RunTest]: %s" % self.__str__()
        try:
            self.photosImpl.deploy_photo_content("Pictures", "picture_004",
                                                 self.PHOTO_PATH)
            self.photosImpl.refresh_sdcard()
            self.photosImpl.launch_photos_am()
            self.photosImpl.open_a_picture()
            self.photosImpl.pic_zoom_out(300)
        except:
            raise Exception("Test failed!")

    def test_ImageEdit_Rotate90degree_SaveImage(self):
        print "[RunTest]: %s" % self.__str__()
        self.photosImpl.deploy_photo_content("Pictures", "picture_blue",
                                             self.PHOTO_PATH)
        self.photosImpl.refresh_sdcard()
        self.photosImpl.launch_photos_am()
        self.photosImpl.open_a_picture()
        self.photosImpl.click_crop_tools()
        time.sleep(1)
        self.photosImpl.rotate_90_degrees()
        self.photosImpl.save_picture_after_rotation()
        assert self.photosImpl.check_saved_pic_result(picPath=self.PHOTO_PATH) > 0, \
            "Failed! No effects on the saving pic."

    def test_ImageEdit_WBMP_Rotate(self):
        print "[RunTest]: %s" % self.__str__()
        self.photosImpl.deploy_photo_content("Pictures", "picture_006",
                                             self.PHOTO_PATH)
        self.photosImpl.refresh_sdcard()
        self.photosImpl.launch_photos_am()
        self.photosImpl.open_a_picture()
        self.photosImpl.click_crop_tools()
        time.sleep(1)
        # --------Rotate left or right--------
        i = [1, 3][random.randint(0, 1)]
        for _ in range(i):
            self.photosImpl.rotate_90_degrees()
        self.photosImpl.save_picture_after_rotation()
        assert self.photosImpl.check_saved_pic_result_by_screenshot(self.PHOTO_PATH) >= self.ACCEPTABLE_VALUE, \
            "Failed! No effects on the saving pic."

    def test_ImageEdit_WEBP_Rotate(self):
        print "[RunTest]: %s" % self.__str__()
        self.photosImpl.deploy_photo_content("Pictures", "picture_007",
                                             self.PHOTO_PATH)
        self.photosImpl.refresh_sdcard()
        self.photosImpl.launch_photos_am()
        self.photosImpl.open_a_picture()
        self.photosImpl.click_crop_tools()
        time.sleep(1)
        # --------Rotate left or right--------
        i = [1, 3][random.randint(0, 1)]
        for _ in range(i):
            self.photosImpl.rotate_90_degrees()
        self.photosImpl.save_picture_after_rotation()
        assert self.photosImpl.check_saved_pic_result_by_screenshot(self.PHOTO_PATH) >= self.ACCEPTABLE_VALUE, \
            "Failed! No effects on the saving pic."

    def test_ImageEdit_WEBP_Zoom_ByGesture(self):
        print "[RunTest]: %s" % self.__str__()
        try:
            self.photosImpl.deploy_photo_content("Pictures", "picture_007",
                                                 self.PHOTO_PATH)
            self.photosImpl.refresh_sdcard()
            self.photosImpl.launch_photos_am()
            self.photosImpl.open_a_picture()
            self.photosImpl.pic_zoom_in(300)
        except:
            raise Exception("Test failed!")

    def test_ImageEdit_BWeffect_MoreThan5MB(self):
        print "[RunTest]: %s" % self.__str__()
        self.photosImpl.deploy_photo_content("Pictures", "picture_morethan5mb",
                                             self.PHOTO_PATH)
        self.photosImpl.refresh_sdcard()
        self.photosImpl.launch_photos_am()
        self.photosImpl.open_a_picture()
        for eff in ['Whites', 'Blacks']:
            self.photosImpl.change_display_effect(effType=eff, effVol=100)
        self.photosImpl.save_changes()
        assert self.photosImpl.check_saved_pic_result(picPath=self.PHOTO_PATH) >= self.ACCEPTABLE_VALUE, \
            "Failed! No effects on the saving pic."

    def test_ImageEdit_BMP_Check4M(self):
        print "[RunTest]: %s" % self.__str__()
        try:
            self.photosImpl.deploy_photo_content("Pictures", "picture_bmp4mb",
                                                 self.PHOTO_PATH)
            self.photosImpl.refresh_sdcard()
            self.photosImpl.launch_photos_am()
            self.photosImpl.open_a_picture()
            self.photosImpl.view_a_picture_fullscreen()
        except:
            raise Exception("Test failed!")

    def test_imagedelete_press_menu_select_photo_delete(self):
        print "[RunTest]: %s" % self.__str__()
        self.photosImpl.deploy_photo_content("Pictures", "picture_bmp4mb",
                                             self.PHOTO_PATH)
        self.photosImpl.refresh_sdcard()
        bef_del = self.photosImpl.check_pic_number(self.PHOTO_PATH)
        self.photosImpl.launch_photos_am()
        self.photosImpl.open_a_picture()
        self.photosImpl.delete_a_picture()
        aft_del = self.photosImpl.check_pic_number(self.PHOTO_PATH)
        assert bef_del != aft_del, "Fail to delete pic!"

    def test_imageedit_blueimage_addvignetteeffect(self):
        print "[RunTest]: %s" % self.__str__()
        self.photosImpl.deploy_photo_content("Pictures", "picture_blue",
                                             self.PHOTO_PATH)
        self.photosImpl.refresh_sdcard()
        self.photosImpl.launch_photos_am()
        self.photosImpl.open_a_picture()
        self.photosImpl.change_display_effect(effType='Vignette', effVol=100)
        self.photosImpl.save_changes()
        assert self.photosImpl.check_saved_pic_result(picPath=self.PHOTO_PATH) >= self.ACCEPTABLE_VALUE, \
            "Failed! No effects on the saving pic."

    def test_ImageEdit_WBMP_Zoom_ByBoth(self):
        print "[RunTest]: %s" % self.__str__()
        try:
            self.photosImpl.deploy_photo_content("Pictures", "picture_006",
                                                 self.PHOTO_PATH)
            self.photosImpl.refresh_sdcard()
            self.photosImpl.launch_photos_am()
            self.photosImpl.open_a_picture()
            self.photosImpl.view_a_picture_fullscreen()
            self.photosImpl.pic_zoom_in(300)
            self.photosImpl.pic_zoom_out(300)
        except:
            raise Exception("Test failed!")

    def test_imageedit_addeffects_setwallpaper(self):
        print "[RunTest]: %s" % self.__str__()
        if "com.android.launcher3" not in pkgmgr.get_packages():
            launch_aosp_home()
        self.photosImpl.deploy_photo_content("Pictures", "picture_004",
                                             self.PHOTO_PATH)
        self.photosImpl.launch_photos_am()
        self.photosImpl.open_a_picture()
        self.photosImpl.change_display_effect(effType='Vignette', effVol=100)
        self.photosImpl.save_changes()
        self.photosImpl.click_crop_tools()
        self.photosImpl.rotate_right_45_degrees()
        self.photosImpl.save_picture_after_rotation()
        org_image = self.photosImpl.only_pull_saved_pic(self.PHOTO_PATH)
        out_image = self.qr.mark_image_qrcode(str(org_image))
        self.photosImpl.stop_photos_am()
        self.photosImpl.rm_delete_photos()
        self.photosImpl.deploy_photo_content(directory=self.PHOTO_PATH,
                                             local_file=out_image)
        self.photosImpl.launch_photos_am()
        self.photosImpl.open_a_picture()
        self.photosImpl.set_picture_as_wallpaper()
        self.qr.verify_qrcode_marked_image(qrcode="9876543210",
                                           set_wallpaper=True)

    def test_imageedit_addstraighteneffect_lessthan20kb(self):
        print "[RunTest]: %s" % self.__str__()
        self.photosImpl.deploy_photo_content("Pictures", "picture_blue",
                                             self.PHOTO_PATH)
        self.photosImpl.refresh_sdcard()
        self.photosImpl.launch_photos_am()
        self.photosImpl.open_a_picture()
        self.photosImpl.click_crop_tools()
        time.sleep(1)
        # --------Rotate left or right--------
        i = [1, 3][random.randint(0, 1)]
        for _ in range(i):
            self.photosImpl.rotate_90_degrees()
        self.photosImpl.save_picture_after_rotation()
        assert self.photosImpl.check_saved_pic_result(picPath=self.PHOTO_PATH) > 0, \
            "Failed! No effects on the saving pic."

    def test_MoreThan1000Images(self):
        from testlib.graphics.common import busybox_obj
        from testlib.util.config import TestConfig

        print "[RunTest]: %s" % self.__str__()
        # Prepare for 1000 imgs.
        self.photosImpl.deploy_photo_content("Pictures",
                                             "picture_morethan1000",
                                             self.PHOTO_PATH)
        pics = TestConfig().read(
            CONFIG_FILE, "Pictures").get("picture_morethan1000").split('/')[-1]
        busybox_obj.setup()
        cmd = "busybox tar xvf %s/%s -C %s" % (self.PHOTO_PATH, pics,
                                               self.PHOTO_PATH)
        chk_cmd = "\'ls %s/1000/ | grep -c png\'" % self.PHOTO_PATH
        clean_cmd = "rm -rf %s/%s" % (self.PHOTO_PATH, pics)
        busybox_obj.adb_busybox_cmd(cmd)
        rst = 0
        while rst != 1000:
            rst = int(g_common_obj.adb_cmd_capture_msg(chk_cmd))
            time.sleep(5)
        else:
            print "1000 pic prepared."
        g_common_obj.adb_cmd_capture_msg(clean_cmd)
        time.sleep(3)
        self.photosImpl.refresh_sdcard()
        time.sleep(10)
        try:
            self.photosImpl.launch_photos_am()
            self.photosImpl.open_a_picture('1000')
            self.d.press.back()
            _index = random.randint(1, 30)
            sw_num = random.randint(1, 5)
            for i in range(sw_num):
                self.d().swipe.up()
                time.sleep(1)
            self.d(index=_index).click.wait()
        except:
            raise Exception("Test failed!")

    def test_ImageEdit_Add_Effect_Rotate(self):
        print "[RunTest]: %s" % self.__str__()
        try:
            self.photosImpl.deploy_photo_content("Pictures", "picture_004",
                                                 self.PHOTO_PATH)
            self.photosImpl.refresh_sdcard()
            self.photosImpl.launch_photos_am()
            self.photosImpl.open_a_picture()
            self.photosImpl.change_display_effect(effType='Vignette',
                                                  effVol=80)
            adb32.screen_rotation(1)
            adb32.screen_rotation(0)
        except:
            raise Exception("Test failed!")
        finally:
            adb32.screen_rotation(0)

    def test_ImageEdit_AddStraightenEffect(self):
        print "[RunTest]: %s" % self.__str__()
        self.photosImpl.deploy_photo_content("Pictures", "picture_004",
                                             self.PHOTO_PATH)
        self.photosImpl.refresh_sdcard()
        self.photosImpl.launch_photos_am()
        self.photosImpl.open_a_picture()
        self.photosImpl.click_crop_tools()
        self.photosImpl.rotate_right_45_degrees()
        self.photosImpl.save_picture_after_rotation()
        assert self.photosImpl.check_saved_pic_result(picPath=self.PHOTO_PATH) > self.ACCEPTABLE_VALUE, \
            "Failed! No effects on the saving pic."

    def test_ImageEdit_AddVignetteEffect(self):
        print "[RunTest]: %s" % self.__str__()
        self.photosImpl.deploy_photo_content("Pictures", "picture_004",
                                             self.PHOTO_PATH)
        self.photosImpl.refresh_sdcard()
        self.photosImpl.launch_photos_am()
        self.photosImpl.open_a_picture()
        self.photosImpl.change_display_effect(effType='Vignette', effVol=80)
        self.photosImpl.save_changes()
        assert self.photosImpl.check_saved_pic_result(picPath=self.PHOTO_PATH) >= self.ACCEPTABLE_VALUE, \
            "Failed! No effects on the saving pic."

    def test_ImageEdit_BMP_Check1K(self):
        print "[RunTest]: %s" % self.__str__()
        try:
            self.photosImpl.deploy_photo_content("Pictures", "picture_bmp1k",
                                                 self.PHOTO_PATH)
            self.photosImpl.refresh_sdcard()
            self.photosImpl.launch_photos_am()
            self.photosImpl.open_a_picture()
        except:
            raise Exception("Test failed!")

    def test_ImageEdit_BMP_Crop(self):
        print "[RunTest]: %s" % self.__str__()
        self.photosImpl.deploy_photo_content("Pictures", "picture_001",
                                             self.PHOTO_PATH)
        self.photosImpl.refresh_sdcard()
        self.photosImpl.launch_photos_am()
        self.photosImpl.open_a_picture()
        self.photosImpl.click_crop_tools()
        self.photosImpl.rotate_right_45_degrees()
        self.photosImpl.save_picture_after_rotation()
        assert self.photosImpl.check_saved_pic_result_by_screenshot(self.PHOTO_PATH) > self.ACCEPTABLE_VALUE, \
            "Failed! No effects on the saving pic."

    def test_ImageEdit_BMP_SaveEdit(self):
        print "[RunTest]: %s" % self.__str__()
        self.photosImpl.deploy_photo_content("Pictures", "picture_001",
                                             self.PHOTO_PATH)
        self.photosImpl.refresh_sdcard()
        self.photosImpl.launch_photos_am()
        self.photosImpl.open_a_picture()
        self.photosImpl.change_display_effect(effType='Vignette', effVol=88)
        self.photosImpl.save_changes()
        assert self.photosImpl.check_saved_pic_result_by_screenshot(self.PHOTO_PATH) > self.ACCEPTABLE_VALUE, \
            "Failed! No effects on the saving pic."

    def test_ImageEdit_CorpUprightRectangular(self):
        print "[RunTest]: %s" % self.__str__()
        self.photosImpl.deploy_photo_content("Pictures", "picture_004",
                                             self.PHOTO_PATH)
        self.photosImpl.refresh_sdcard()
        self.photosImpl.launch_photos_am()
        self.photosImpl.open_a_picture()
        self.photosImpl.click_crop_tools()
        self.photosImpl.crop_to_center(start_corner="left_bottom")
        self.photosImpl.save_picture_after_rotation()
        assert self.photosImpl.check_saved_pic_result(picPath=self.PHOTO_PATH) >= self.ACCEPTABLE_VALUE, \
            "Failed! No effects on the saving pic."

    def test_ImageEdit_CropMoreThan8times_Rotate(self):
        print "[RunTest]: %s" % self.__str__()
        try:
            self.photosImpl.deploy_photo_content("Pictures", "picture_004",
                                                 self.PHOTO_PATH)
            self.photosImpl.refresh_sdcard()
            self.photosImpl.launch_photos_am()
            self.photosImpl.open_a_picture()
            self.photosImpl.click_crop_tools()
            for i in range(9):
                self.photosImpl.rotate_90_degrees()
                time.sleep(.5)
            self.photosImpl.save_picture_after_rotation()
            assert self.photosImpl.check_saved_pic_result(picPath=self.PHOTO_PATH) > 0, \
                "Failed! No effects on the saving pic."
        except:
            raise Exception("Test failed in round 1.")
        self.photosImpl.rm_delete_photos()

        try:
            adb32.screen_rotation(1)
            self.photosImpl.deploy_photo_content("Pictures", "picture_004",
                                                 self.PHOTO_PATH)
            self.photosImpl.refresh_sdcard()
            self.photosImpl.launch_photos_am()
            self.photosImpl.open_a_picture()
            self.photosImpl.click_crop_tools()
            for i in range(9):
                self.photosImpl.rotate_90_degrees()
                time.sleep(.5)
            self.photosImpl.save_picture_after_rotation()
            assert self.photosImpl.check_saved_pic_result(picPath=self.PHOTO_PATH) > 0, \
                "Failed! No effects on the saving pic."
        except:
            raise Exception("Test failed in round 2.")
        finally:
            adb32.screen_rotation(0)

    def test_ImageEdit_JPG_1K_Check(self):
        print "[RunTest]: %s" % self.__str__()
        try:
            self.photosImpl.deploy_photo_content("Pictures", "picture_jpg1k",
                                                 self.PHOTO_PATH)
            self.photosImpl.refresh_sdcard()
            self.photosImpl.launch_photos_am()
            self.photosImpl.open_a_picture()
        except:
            raise Exception("Test failed!")

    def test_ImageEdit_JPG_2M_Check(self):
        print "[RunTest]: %s" % self.__str__()
        try:
            self.photosImpl.deploy_photo_content("Pictures", "picture_jpg2m",
                                                 self.PHOTO_PATH)
            self.photosImpl.refresh_sdcard()
            self.photosImpl.launch_photos_am()
            self.photosImpl.open_a_picture()
        except:
            raise Exception("Test failed!")

    def test_ImageEdit_JPG_CancelEdit(self):
        print "[RunTest]: %s" % self.__str__()
        try:
            self.photosImpl.deploy_photo_content("Pictures", "picture_003",
                                                 self.PHOTO_PATH)
            self.photosImpl.refresh_sdcard()
            self.photosImpl.launch_photos_am()
            self.photosImpl.open_a_picture()
            self.photosImpl.change_display_effect(effVol=100)
            self.photosImpl.undo_edit()
        except:
            raise Exception("Test failed!")

    def test_ImageEdit_JPG_Crop(self):
        print "[RunTest]: %s" % self.__str__()
        self.photosImpl.deploy_photo_content("Pictures", "picture_003",
                                             self.PHOTO_PATH)
        self.photosImpl.refresh_sdcard()
        self.photosImpl.launch_photos_am()
        self.photosImpl.open_a_picture()
        self.photosImpl.click_crop_tools()
        self.photosImpl.crop_to_center(start_corner="left_top")
        self.photosImpl.save_picture_after_rotation()
        assert self.photosImpl.check_saved_pic_result(picPath=self.PHOTO_PATH) >= self.ACCEPTABLE_VALUE, \
            "Failed! No effects on the saving pic."

    def test_ImageEdit_JPG_SaveEdit(self):
        print "[RunTest]: %s" % self.__str__()
        self.photosImpl.deploy_photo_content("Pictures", "picture_003",
                                             self.PHOTO_PATH)
        self.photosImpl.refresh_sdcard()
        self.photosImpl.launch_photos_am()
        self.photosImpl.open_a_picture()
        self.photosImpl.change_display_effect(effType='Vignette', effVol=22)
        self.photosImpl.save_changes()
        assert self.photosImpl.check_saved_pic_result(picPath=self.PHOTO_PATH) >= self.ACCEPTABLE_VALUE, \
            "Failed! No effects on the saving pic."

    def test_ImageEdit_PanoramicImage_AddEffect(self):
        print "[RunTest]: %s" % self.__str__()
        self.photosImpl.deploy_photo_content("Pictures", "picture_panoramic",
                                             self.PHOTO_PATH)
        self.photosImpl.refresh_sdcard()
        self.photosImpl.launch_photos_am()
        self.photosImpl.open_a_picture()
        self.photosImpl.change_display_effect(effType='Warmth', effVol=77)
        self.photosImpl.save_changes()
        assert self.photosImpl.check_saved_pic_result(picPath=self.PHOTO_PATH) >= self.ACCEPTABLE_VALUE, \
            "Failed! No effects on the saving pic."

    def test_ImageEdit_PersonFaceImage2MB_AddBWOrSharpnessEffects(self):
        print "[RunTest]: %s" % self.__str__()
        self.photosImpl.deploy_photo_content("Pictures", "picture_face",
                                             self.PHOTO_PATH)
        self.photosImpl.refresh_sdcard()
        self.photosImpl.launch_photos_am()
        self.photosImpl.open_a_picture()
        self.photosImpl.change_display_effect(effType='Blacks', effVol=99)
        self.photosImpl.change_display_effect(effType='Whites', effVol=99)
        self.photosImpl.save_changes()
        assert self.photosImpl.check_saved_pic_result(picPath=self.PHOTO_PATH) >= self.ACCEPTABLE_VALUE, \
            "Failed! No effects on the saving pic."

    def test_ImageEdit_PNG_Crop(self):
        print "[RunTest]: %s" % self.__str__()
        self.photosImpl.deploy_photo_content("Pictures", "picture_004",
                                             self.PHOTO_PATH)
        self.photosImpl.refresh_sdcard()
        self.photosImpl.launch_photos_am()
        self.photosImpl.open_a_picture()
        self.photosImpl.click_crop_tools()
        self.photosImpl.crop_to_center(start_corner="right_top")
        self.photosImpl.save_picture_after_rotation()
        assert self.photosImpl.check_saved_pic_result(picPath=self.PHOTO_PATH) >= self.ACCEPTABLE_VALUE, \
            "Failed! No effects on the saving pic."

    def test_ImageEdit_Rotate_Left(self):
        print "[RunTest]: %s" % self.__str__()
        self.photosImpl.deploy_photo_content("Pictures", "picture_004",
                                             self.PHOTO_PATH)
        self.photosImpl.refresh_sdcard()
        self.photosImpl.launch_photos_am()
        self.photosImpl.open_a_picture()
        self.photosImpl.click_crop_tools()
        self.photosImpl.rotate_90_degrees()
        self.photosImpl.save_picture_after_rotation()
        assert self.photosImpl.check_saved_pic_result(picPath=self.PHOTO_PATH) >= self.ACCEPTABLE_VALUE, \
            "Failed! No effects on the saving pic."

    def test_ImageEdit_Rotate_Right(self):
        print "[RunTest]: %s" % self.__str__()
        self.photosImpl.deploy_photo_content("Pictures", "picture_004",
                                             self.PHOTO_PATH)
        self.photosImpl.refresh_sdcard()
        self.photosImpl.launch_photos_am()
        self.photosImpl.open_a_picture()
        self.photosImpl.click_crop_tools()
        for i in range(3):
            self.photosImpl.rotate_90_degrees()
            time.sleep(.5)
        self.photosImpl.save_picture_after_rotation()
        assert self.photosImpl.check_saved_pic_result(picPath=self.PHOTO_PATH) >= self.ACCEPTABLE_VALUE, \
            "Failed! No effects on the saving pic."

    def test_ImageEdit_ThumbMD_All_Rotate(self):
        print "[RunTest]: %s" % self.__str__()
        try:
            self.photosImpl.deploy_photo_content("PicturesFolder",
                                                 "jpg_10resolution",
                                                 self.PHOTO_PATH)
            self.photosImpl.refresh_sdcard()
            self.photosImpl.launch_photos_am()
            self.photosImpl.open_a_picture()
            adb32.screen_rotation(1)
        except:
            raise Exception("Test failed!")
        finally:
            adb32.screen_rotation(0)

    def test_ImageEdit_ThumbMD_One_Rotate(self):
        print "[RunTest]: %s" % self.__str__()
        try:
            self.photosImpl.deploy_photo_content("Pictures", "picture_004",
                                                 self.PHOTO_PATH)
            self.photosImpl.refresh_sdcard()
            self.photosImpl.launch_photos_am()
            self.photosImpl.open_a_picture()
            adb32.screen_rotation(1)
        except:
            raise Exception("Test failed!")
        finally:
            adb32.screen_rotation(0)

    def test_ImageView_Webp_Check(self):
        print "[RunTest]: %s" % self.__str__()
        try:
            self.photosImpl.deploy_photo_content("Pictures", "picture_007",
                                                 self.PHOTO_PATH)
            self.photosImpl.refresh_sdcard()
            self.photosImpl.launch_photos_am()
            self.photosImpl.open_a_picture()
        except:
            raise Exception("Test failed!")

    def test_ImageView_Webp_Thumbnail_LPCheck(self):
        print "[RunTest]: %s" % self.__str__()
        try:
            self.photosImpl.deploy_photo_content("Pictures", "picture_webp2m",
                                                 self.PHOTO_PATH)
            self.photosImpl.refresh_sdcard()
            self.photosImpl.launch_photos_am()
            self.photosImpl.open_a_picture()
            self.photosImpl.view_a_picture_fullscreen()
        except:
            raise Exception("Test failed!")

    def test_ImageView_Wbmp_2K_Check(self):
        print "[RunTest]: %s" % self.__str__()
        try:
            self.photosImpl.deploy_photo_content("Pictures", "picture_wbmp2k",
                                                 self.PHOTO_PATH)
            self.photosImpl.refresh_sdcard()
            self.photosImpl.launch_photos_am()
            self.photosImpl.open_a_picture()
        except:
            raise Exception("Test failed!")

    def test_ImageView_Wbmp_300K_Check(self):
        print "[RunTest]: %s" % self.__str__()
        try:
            self.photosImpl.deploy_photo_content("Pictures",
                                                 "picture_wbmp300k",
                                                 self.PHOTO_PATH)
            self.photosImpl.refresh_sdcard()
            self.photosImpl.launch_photos_am()
            self.photosImpl.open_a_picture()
        except:
            raise Exception("Test failed!")

    def test_ImageView_Webp_1K_Check(self):
        print "[RunTest]: %s" % self.__str__()
        try:
            self.photosImpl.deploy_photo_content("Pictures", "picture_webp1k",
                                                 self.PHOTO_PATH)
            self.photosImpl.refresh_sdcard()
            self.photosImpl.launch_photos_am()
            self.photosImpl.open_a_picture()
        except:
            raise Exception("Test failed!")

    def test_ImageView_Webp_2M_Check(self):
        print "[RunTest]: %s" % self.__str__()
        try:
            self.photosImpl.deploy_photo_content("Pictures", "picture_webp2m",
                                                 self.PHOTO_PATH)
            self.photosImpl.refresh_sdcard()
            self.photosImpl.launch_photos_am()
            self.photosImpl.open_a_picture()
        except:
            raise Exception("Test failed!")

    def test_ImageEdit_BMP_Check8M(self):
        print "[RunTest]: %s" % self.__str__()
        try:
            self.photosImpl.deploy_photo_content("Pictures", "picture_bmp8mb",
                                                 self.PHOTO_PATH)
            self.photosImpl.refresh_sdcard()
            self.photosImpl.launch_photos_am()
            self.photosImpl.open_a_picture()
        except:
            raise Exception("Test failed!")

    def test_ImageEdit_PNG_AllTransParent_Check(self):
        print "[RunTest]: %s" % self.__str__()
        try:
            self.photosImpl.deploy_photo_content("Pictures",
                                                 "picture_transparent",
                                                 self.PHOTO_PATH)
            self.photosImpl.refresh_sdcard()
            self.photosImpl.launch_photos_am()
            self.photosImpl.open_a_picture()
        except:
            raise Exception("Test failed!")

    def test_MoreThan10GIFImages(self):
        print "[RunTest]: %s" % self.__str__()
        try:
            self.photosImpl.deploy_photo_content("PicturesFolder",
                                                 "gif_10resolution",
                                                 self.PHOTO_PATH)
            self.photosImpl.refresh_sdcard()
            self.photosImpl.launch_photos_am()
            self.photosImpl.open_a_picture()
            self.photosImpl.view_a_picture_fullscreen()
            for _ in range(9):
                self.d().swipe.left(steps=10)
                time.sleep(2)
        except:
            raise Exception("Test failed!")

    def test_MoreThan10JPEGImages(self):
        print "[RunTest]: %s" % self.__str__()
        try:
            self.photosImpl.deploy_photo_content("PicturesFolder",
                                                 "jpg_10resolution",
                                                 self.PHOTO_PATH)
            self.photosImpl.refresh_sdcard()
            self.photosImpl.launch_photos_am()
            self.photosImpl.open_a_picture()
            self.photosImpl.view_a_picture_fullscreen()
            for _ in range(9):
                self.d().swipe.left(steps=10)
                time.sleep(2)
        except:
            raise Exception("Test failed!")

    def test_ImageView_Thumbnail_Mode(self):
        print "[RunTest]: %s" % self.__str__()
        try:
            self.photosImpl.deploy_photo_content("Pictures", "picture_005",
                                                 self.PHOTO_PATH)
            self.photosImpl.refresh_sdcard()
            self.photosImpl.launch_photos_am()
        except:
            raise Exception("Test failed!")

    def test_ImageZoom_JPEG(self):
        print "[RunTest]: %s" % self.__str__()
        try:
            self.photosImpl.deploy_photo_content("Pictures", "picture_004",
                                                 self.PHOTO_PATH)
            self.photosImpl.launch_photos_am()
            self.photosImpl.open_a_picture()
            self.photosImpl.pic_zoom_out(30)
        except:
            raise Exception("Test failed!")