def test_WallpaperSet_PNGImage(self):
        """
        test_WallpaperSet_PNGImage

        Steps:
        1. Open a PNG picture by Gallery app
        PNG 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 PNG picture can set as wallpaper successfully. DUT has no crash or freeze.
        """
        print "[RunTest]: %s" % self.__str__()

        print """[Step] 1. Open a PNG picture by Gallery app
            PNG 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.WallpaperSetter(self.pic_path)
#         time.sleep(10)
        self.photosImpl.set_picture_as_wallpaper()
        if "com.android.launcher3" not in pkgmgr.get_packages():
            launch_aosp_home()
        print """[Step] 3. Back the home UI to check the wallpaer after setting
            The PNG picture can set as wallpaper successfully. DUT has no crash or freeze."""
        self.qrcodeImpl.verify_qrcode_marked_image(self.qrcode)
Esempio n. 2
0
    def test_Cardview_Recents(self):
        """
        test_Cardview_Recents

        Steps:
        1. launch 5 apps 
        # change to 5 apps due to some of apps in step are not preinstalled.
            all launch successfully
        2. launch Recents to swtich between different app
            Check CardView in Recents are working correctly
        """
        print "[RunTest]: %s" % self.__str__()

        print "[Init APP]"
        print "Init Photos"
        g_common_obj.launch_app_am(
            " com.google.android.apps.photos",
            "com.google.android.apps.photos.home.HomeActivity")
        time.sleep(2)
        self.photos.stop_photos_am()
        time.sleep(1)
        print "Init Calendar"
        g_common_obj.launch_app_am("com.google.android.calendar",
                                   "com.android.calendar.AllInOneActivity")
        if not self.d(description="Create new event and more").exists:
            for _ in range(0, 3):
                if self.d(description="next page").exists:
                    self.d(description="next page").click.wait()
            if self.d(text="Got it").exists:
                self.d(text="Got it").click.wait()
        g_common_obj.stop_app_am("com.google.android.calendar")
        time.sleep(2)
        print """[Step] 1. launch 5 apps
            all launch successfully"""
        for each in self.actor_apps.split(','):
            if "com.android.launcher3" not in pkgmgr.get_packages():
                launch_aosp_home()
            self.systemui.launch_desk_app(each)
            time.sleep(2)

        print """[Step] 2. launch Recents to swtich between different app
            Check CardView in Recents are working correctly"""
        for each in self.actor_apps.split(','):
            self.systemui.switch_recent_app(each)
            time.sleep(2)
Esempio n. 3
0
    def test_shadow_sampleapkelevationbasic(self):
        """
        refer TC test_Shadow_SampleAPKElevationBasic
        """
        print "[RunTest]: %s" % self.__str__()
        # install apk if not exists in package list
        if self.basic_pkg_name not in pkgmgr.get_packages():
            apk_path = get_resource_from_atifactory(self.case_cfg,
                                                    'ElevationBasic', 'apk')
            pkgmgr.apk_install(apk_path)
        # launch app
        run_cmd = "am start -S -n %s/%s" % (self.basic_pkg_name,
                                            self.activity_name)
        g_common_obj.adb_cmd_capture_msg(run_cmd)
        sleep(2)
        # screen capture before operation
        sx, sy, ex, ey = self.d.info["displayWidth"] / 2, \
                         0, \
                         self.d.info["displayWidth"], \
                         self.d.info["displayHeight"]
        img_before = multi_display.get_screenshot_multidisplay_croped(
            0, sx, sy, ex, ey)

        # define operation type
        def long_tap_content():
            d = g_common_obj.get_device()
            d(resourceId="com.example.android.elevationbasic:id/floating_shape_2"
              ).long_click()

        # start test
        thread = threading.Timer(1.5, long_tap_content)
        thread.start()
        # screen capture after operation
        sleep(2)
        img_after = multi_display.get_screenshot_multidisplay_croped(
            0, sx, sy, ex, ey)
        assert compare_pic.compare_pic(
            img_before, img_after) > 4, "No diff after operation"
Esempio n. 4
0
 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)