Beispiel #1
0
 def cleanMediaFiles(self):
     """
     Used to clean the media files in some folders; eg. /mnt/sdcard/DCIM/Camera
     """
     g_common_obj.stop_app_am(self.PACKAGE_NAME_GMSCAMERA)
     g_common_obj.adb_cmd("pm clear %s" % self.PACKAGE_NAME_GMSCAMERA)
     self.logger.debug("clean media files successfully")
Beispiel #2
0
    def appPrepare(self, model=1):
        self.cfg_file = os.path.join(os.environ.get('TEST_DATA_ROOT', ''), \
            'tests.tablet.mum_auto_drm.conf')
        self.cfg = self.config.read(self.cfg_file, self.case_name)

        self.multimedia_handle = MultiMediaHandle()
        self.multimedia_setting = MultiMediaSetting(self.cfg_file)
        self.multimedia_drm_helper = MultiMediaDRMHelper()

        self.multimedia_setting.install_apk(
            "widevine_apk")  #install widevine apk
        self.widevine_package_name, self.widevine_activity_name = self.multimedia_setting.get_package_and_activity_name(
            "widevine_apk")

        if model == 1:  # play local video mode
            self.dst_path = self.cfg.get("dst_path")
            self.clearResourcefolder()
            self.dst_path = self.multimedia_setting.push_file_new(
                self.cfg.get("src_path"),
                self.dst_path)  #push video file to device
        elif model == 2:  # play network video mode
            self.src_path = self.cfg.get("src_path")

#         g_common_obj.set_vertical_screen()
        g_common_obj.stop_app_am(self.widevine_package_name)
        g_common_obj.adb_cmd_capture_msg("input keyevent 82")  #Unlock screen
Beispiel #3
0
 def openLocation(self):
     self.logger.debug("enter system settings")
     os.system("adb shell am start -W -n %s/%s" %
               (CameraCommon().PACKAGE_NAME_SETTING,
                CameraCommon().ACTIVITY_NAME_SETTING))
     CameraCommon().waitForWidgetToAppear(
         self.ArcSoftCameraWidget().text("Settings"), "Settings page")
     self.d(scrollable=True).scroll.vert.to(textContains="Apps")
     self.ArcSoftCameraWidget().text("Apps").click.wait()
     CameraCommon().waitForWidgetToAppear(
         self.ArcSoftCameraWidget().text("Camera"), "Settings apps page")
     mCameraCount = self.ArcSoftCameraWidget().text("Camera").count
     for i in range(mCameraCount):
         self.ArcSoftCameraWidget().text("Camera")[i].click.wait()
         CameraCommon().waitForWidgetToAppear(
             self.ArcSoftCameraWidget().text("Permissions"), "Permissions")
         self.ArcSoftCameraWidget().text("Permissions").click.wait()
         CameraCommon().waitForWidgetToAppear(
             self.ArcSoftCameraWidget().text("App permissions"),
             "App permissions")
         for j in range(5):
             if self.ArcSoftCameraWidget().text("OFF").exists:
                 self.ArcSoftCameraWidget().text("OFF").click.wait()
         CameraCommon().pressBack(2)
     CameraCommon().pressBack(2)
     g_common_obj.stop_app_am(CameraCommon().PACKAGE_NAME_SETTING)
     self.logger.debug("open arcsoft camera location successfully")
     self.logger.debug("exit system settings")
Beispiel #4
0
 def stopCameraApp(self):
     """
     Used to stop the camera application
     """
     g_common_obj.stop_app_am(self.PACKAGE_NAME_GMSCAMERA)
     #         g_common_obj.adb_cmd("pm clear %s" % self.PACKAGE_NAME_CAMERA)
     self.logger.debug("stop gms camera app successfully")
Beispiel #5
0
 def stop_camera_am():
     """ Stop Camera via adb am command
     """
     print "Stop Camera by adb am"
     g_common_obj.stop_app_am("com.google.android.GoogleCamera")
     PKGname, _ = get_current_focus_window()
     if PKGname == "com.android.camera2":
         g_common_obj.stop_app_am("com.android.camera2")
Beispiel #6
0
 def launch_app_am():
     """
     launchApp by pkgname/activityname
     """
     g_common_obj.stop_app_am(SampleApiDemoImpl.pkg_name)
     g_common_obj.launch_app_am(SampleApiDemoImpl.pkg_name,
                                SampleApiDemoImpl.activity_name)
     print "Launched APIDemo by adb am"
Beispiel #7
0
 def stop_from_am(self, app_name):
     """
         Stop google maps from am
     """
     print "[INFO] Stop Keep from am"
     if app_name == "googlemap":
         g_common_obj.stop_app_am(MapsImpl.googlemap_package)
     elif app_name == "settings":
         g_common_obj.launch_app_am(MapsImpl.setting_package)
 def tearDown(self):
     print "[Teardown]: %s" % self._test_name
     super(Fit, self).tearDown()
     self.photos.rm_delete_photos()
     self.photos.refresh_sdcard()
     g_common_obj.stop_app_am("com.google.android.apps.photos")
     try:
         os.remove(".tmp.png")
     except OSError:
         pass
     adb32.screen_rotation(0)
Beispiel #9
0
 def tearDown(self):
     """
     @summary: tear tearDown
     @return: None
     """
     super(ImageAPITest, self).tearDown()
     print "[Teardown]: %s" % self._test_name
     g_common_obj.stop_exp_handle()
     time.sleep(3)
     g_common_obj.stop_app_am("com.google.android.GoogleCamera")
     g_common_obj.stop_app_am("com.intel.otc.instrument.otcphotos")
Beispiel #10
0
 def setUp(self):
     """
     @summary: set up
     @return: None
     """
     super(VideoEncode, self).setUp()
     self._test_name = __name__
     print "[Setup]: %s" % self._test_name
     g_common_obj.stop_app_am("com.google.android.GoogleCamera")
     # Unlock screen
     g_common_obj.adb_cmd_capture_msg("input keyevent 82")
Beispiel #11
0
 def tearDown(self):
     print "[Teardown]: %s" % self._test_name
     #         super(ComposeUI, self).tearDown()
     #         self._composeui.delete_local_video()
     self.photos.rm_delete_photos()
     self.photos.refresh_sdcard()
     g_common_obj.stop_app_am("com.google.android.apps.photos")
     try:
         os.remove(".tmp.png")
     except OSError:
         pass
Beispiel #12
0
 def tearDown(self):
     """
     @summary: tear tearDown
     @return: None
     """
     super(VideoPlayBack, self).tearDown()
     print "[Teardown]: %s" % self._test_name
     g_common_obj.stop_exp_handle()
     time.sleep(3)
     g_common_obj.stop_app_am(
         "videoplayer.app.instrument.otc.intel.com.otcvideoplayer")
     time.sleep(3)
Beispiel #13
0
 def tearDown(self):
     """
     @summary: tear tearDown
     @return: None
     """
     super(ImageAPITest, self).tearDown()
     print "[Teardown]: %s" % self._test_name
     g_common_obj.stop_exp_handle()
     time.sleep(3)
     g_common_obj.stop_app_am("com.intel.otc.instrument.otcphotos")
     time.sleep(1)
     g_common_obj.adb_cmd_capture_msg(self.video.cfg.get("remove_video"))
 def setUp(self):
     """
     @summary: set up
     @return: None
     """
     super(VideoPlayBackIteration, self).setUp()
     self._test_name = __name__
     print "[Setup]: %s" % self._test_name
     g_common_obj.stop_app_am("com.google.android.apps.plus")
     g_common_obj.stop_app_am("com.google.android.apps.photos")
     # Unlock screen
     g_common_obj.adb_cmd_capture_msg("input keyevent 82")
Beispiel #15
0
 def tearDown(self):
     """
     @summary: tearDown
     @return: None
     """
     super(VideoEncode, self).tearDown()
     print "[Teardown]: %s" % self._test_name
     g_common_obj.stop_exp_handle()
     time.sleep(3)
     g_common_obj.stop_app_am("com.google.android.GoogleCamera")
     time.sleep(3)
     g_common_obj.adb_cmd_capture_msg(" rm -rf /sdcard/DCIM/Camera/*")
     time.sleep(10)
     g_common_obj.adb_cmd_capture_msg(self.video.cfg.get("refresh_sd"))
Beispiel #16
0
 def setUp(self):
     """
     @summary: set up
     @return: None
     """
     super(ImageAPITest, self).setUp()
     self.d = g_common_obj.get_device()
     self._test_name = __name__
     self.x = self.d.info["displayWidth"]
     self.y = self.d.info["displayHeight"]
     print "[Setup]: %s" % self._test_name
     g_common_obj.stop_app_am("com.intel.otc.instrument.otcphotos")
     # Unlock screen
     g_common_obj.adb_cmd_capture_msg("input keyevent 82")
Beispiel #17
0
    def appPrepare(self, model=1):
        self.cfg_file = os.path.join(os.environ.get('TEST_DATA_ROOT', ''), \
            'tests.tablet.mum_auto_drm.conf')
        self.cfg = self.config.read(self.cfg_file, self.case_name)

        self.multimedia_setting = MultiMediaSetting(self.cfg_file)
        self.multimedia_drm_helper = MultiMediaDRMHelper()
        self.multimedia_video_quality_helper = MultiMediaVideoQualityHelper()
        
        self.multimedia_setting.install_apk("netflix_apk")
        self.netflix_package_name, self.netflix_activity_name = self.multimedia_setting.get_package_and_activity_name("netflix_apk")

#         g_common_obj.set_vertical_screen()
        g_common_obj.stop_app_am(self.netflix_package_name)
        SystemUI().unlock_screen()
Beispiel #18
0
 def setUp(self):
     """
     @summary: set up
     @return: None
     """
     super(VideoHeadsetTest, self).setUp()
     self.d = g_common_obj.get_device()
     self._test_name = __name__
     print "[Setup]: %s" % self._test_name
     g_common_obj.stop_app_am("videoplayer.app.instrument.otc.intel.com.otcvideoplayer")
     # Unlock screen
     g_common_obj.adb_cmd_capture_msg("input keyevent 82")
     
     self.hs = Headset("/dev/ttyUSB0")
     self.hs.reset()
Beispiel #19
0
 def init_location(self):
     g_common_obj.adb_cmd(
         "am start -a android.settings.LOCATION_SOURCE_SETTINGS")
     if self.device(text="High accuracy").exists:
         g_common_obj.stop_app_am("com.android.settings")
         return
     elif self.device(text="Mode").exists:
         self.device(text="Mode").click.wait()
     if self.device(text="High accuracy").exists:
         self.device(text="High accuracy").click()
     time.sleep(5)
     if self.device(resourceId="android:id/alertTitle").exists:
         self.device(resourceId="android:id/button1").click()
         time.sleep(3)
     g_common_obj.stop_app_am("com.android.settings")
Beispiel #20
0
 def setUp(self):
     """
     @summary: set up
     @return: None
     """
     super(VideoEncode, self).setUp()
     self.d = g_common_obj.get_device()
     self.x = self.d.info["displayWidth"]
     self.y = self.d.info["displayHeight"]
     self._test_name = __name__
     self.tag = "[Video Encode] "
     logger.debug(self.tag + 'run case name is ' + sys._getframe().f_back.f_code.co_name)
     logger.debug(self.tag + '[Setup]: ' + self._test_name)
     g_common_obj.stop_app_am("com.google.android.GoogleCamera")
     # Unlock screen
     g_common_obj.adb_cmd_capture_msg("input keyevent 82")
Beispiel #21
0
 def app_switch_fix(self):
     """
     @summary: launch some app by adb command
     @return: None
     """
     for i in range (0, len(self.app_package)):
         print self.app_package[i]
         package = self.app_package[i].split('/')
         g_common_obj.launch_app_am(package[0], package[1])
         time.sleep(5)
         self.check_error()
         assert self.focus_window(package[0]), \
         "[FAILURE] Launch %s failed!" % self.app[i]
         g_common_obj.stop_app_am(package[0])
         self.check_error()
         time.sleep(1)
         self.d.press.home()
Beispiel #22
0
 def imageViewWithManyTimes(self, case_name, times):
     print "run case is " + str(case_name)
     self.appPrepare(case_name)
     cpu_1 = self.getCpuConsumption()
     for iteration in range(times):
         logger.debug("Execute {0} times, total {1} times".format(
             iteration + 1, times))
         self.launchPhotoAPP()
         time.sleep(5)
         g_common_obj.stop_app_am("com.intel.otc.instrument.otcphotos")
         time.sleep(4)
     time.sleep(10)
     cpu_2 = self.getCpuConsumption()
     logger.info("cpu_1={0}, cpu_2={1}".format(cpu_1, cpu_2))
     assert cpu_1 + 10 >= cpu_2, "Cpu Consumption error! cpu_1=%s, cpu_2=%s" % (
         cpu_1, cpu_2)
     print "case " + str(case_name) + " is pass"
Beispiel #23
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)
Beispiel #24
0
 def setUp(self):
     """
     @summary: set up
     @return: None
     """
     super(ImageAPITest, self).setUp()
     self.d = g_common_obj.get_device()
     self._test_name = __name__
     self.x = self.d.info["displayWidth"]
     self.y = self.d.info["displayHeight"]
     self.dpx = self.d.info["displaySizeDpX"]
     self.dpy = self.d.info["displaySizeDpY"]
     self.tag = "[Image Decode image_api_test] "
     self.serial = self.d.server.adb.device_serial()
     logger.debug(self.tag + "[Setup]: %s" % self._test_name)
     g_common_obj.stop_app_am("com.intel.otc.instrument.otcphotos")
     # Unlock screen
     g_common_obj.adb_cmd_capture_msg("input keyevent 82")
Beispiel #25
0
    def appPrepare(self, model=1):
        self.cfg_file = os.path.join(os.environ.get('TEST_DATA_ROOT', ''), \
            'tests.tablet.mum_auto_drm.conf')
        self.cfg = self.config.read(self.cfg_file,
                                    self.case_name)  # read config file

        self.multimedia_setting = MultiMediaSetting(self.cfg_file)
        self.multimedia_drm_helper = MultiMediaDRMHelper()
        self.multimedia_video_quality_helper = MultiMediaVideoQualityHelper()

        self.multimedia_setting.install_apk(
            "exoplayer_apk")  #install exoplayer apk
        self.exoplayer_package_name, self.exoplayer_activity_name = self.multimedia_setting.get_package_and_activity_name(
            "exoplayer_apk")  #get app info

        #         g_common_obj.set_vertical_screen()
        g_common_obj.stop_app_am(self.exoplayer_package_name)
        g_common_obj.adb_cmd_capture_msg("input keyevent 82")  #Unlock screen
Beispiel #26
0
    def setUp(self):
        """
        @summary: set up
        @return: None
        """
        super(VideoAPITest, self).setUp()
        self.d = g_common_obj.get_device()
        self._test_name = __name__
        self.x = self.d.info["displayWidth"]
        self.y = self.d.info["displayHeight"]
        print "[Setup]: %s" % self._test_name
        g_common_obj.stop_app_am(
            "videoplayer.app.instrument.otc.intel.com.otcvideoplayer")
        # Unlock screen
        g_common_obj.adb_cmd_capture_msg("input keyevent 82")
        self.cfg_file = os.path.join(os.environ.get('TEST_DATA_ROOT', ''), \
                                'tests.tablet.mum_auto_video.conf')

        self.multimedia_setting = MultiMediaSetting(self.cfg_file)
        self.hardware = self.multimedia_setting.get_paltform_hardware()
        self.tag = "[Decode API] "
Beispiel #27
0
 def tearDown(self):
     print "[Teardown]: %s" % self._test_name
     super(AGPS, self).tearDown()
     g_common_obj.stop_app_am("com.android.settings")
 def stop_app_am():
     """ Stop PicsArtStudio via adb am command
     """
     print "Stop PicsArtStudio by adb am"
     g_common_obj.stop_app_am(PicsArtStudio.pkg_name)
Beispiel #29
0
 def stop_app_am():
     """ Stop FLVVideoPlayer via adb am command
     """
     print "Stop FLVVideoPlayer by adb am"
     g_common_obj.stop_app_am(FLVVideoPlayer.pkg_name)
 def close_kitchensink_app(self):
     g_common_obj.stop_app_am(self.kitchensink_pkg_name)