class ComposeUI(UIATestBase): def setUp(self): super(ComposeUI, self).setUp() self._test_name = __name__ print "[Setup]: %s" % self._test_name self._composeui = ComposeUiImpl() config_handle = ConfigHandle() result = config_handle.check_apps("org.geometerplus.zlibrary.ui.android") if result == 0: self._composeui.install_apk('FBReader') result = config_handle.check_apps("org.geometerplus.fbreader.plugin.pdf") if result == 0: self._composeui.install_apk('PDFplugin') self._composeui.init_local_pdf() def tearDown(self): print "[Teardown]: %s" % self._test_name super(ComposeUI, self).tearDown() self._composeui.uninstall_fbreader_and_pdfplugin() self._composeui.delete_local_pdf() def test_immersemode_fbreader(self): ''' refer TC test_ImmerseMode_FBReader ''' print "[RunTest]: %s" % self.__str__() self._composeui.launch_fbreader_and_pdfplugin() self._composeui.check_notification_in_pdfreader() self._composeui.stop_fbreader_and_pdfplugin()
class ComposeUI(UIATestBase): def setUp(self): super(ComposeUI, self).setUp() self._test_name = __name__ print "[Setup]: %s" % self._test_name self._composeui = ComposeUiImpl() self._fit = FitImpl() config_handle = ConfigHandle() result = config_handle.check_apps("com.mxtech.videoplayer.ad") if result == 0: self._composeui.install_apk('Mxplayer') self._composeui.init_local_video() def tearDown(self): print "[Teardown]: %s" % self._test_name super(ComposeUI, self).tearDown() self._composeui.uninstall_mxtech() self._fit.open_wifi() self._composeui.delete_local_video() def test_immersemode_mxplayer(self): ''' refer TC test_ImmerseMode_MXPlayer ''' print "[RunTest]: %s" % self.__str__() self._composeui.launch_mxtech_am() self._composeui.check_notification_during_playing() self._composeui.stop_mxtech_am()
class SetLiveWallpaperSuspendResume(UIATestBase): def setUp(self): super(SetLiveWallpaperSuspendResume, self).setUp() self._test_name = __name__ self._device = g_common_obj.get_device() print "[Setup]: %s" % self._test_name self._composeui = ComposeUiImpl() self._liveWallpaper = WallpaperImpl() # self._liveWallpaper.reset_wallpaper() config_handle = ConfigHandle() result = config_handle.check_apps("com.android.galaxy4") if result == 0: self._composeui.install_apk('Galaxy4') def tearDown(self): print "[Teardown]: %s" % self._test_name super(SetLiveWallpaperSuspendResume, self).tearDown() # self._liveWallpaper.reset_wallpaper() self._liveWallpaper.stop_settings_am() def test_liveWallpaper_suspendResume(self): ''' refer TC test_LiveWallpaper_SuspendResume ''' print "[RunTest]: %s" % self.__str__() # self._liveWallpaper.set_livewallpaper_by_desktop("Black Hole") self._liveWallpaper.set_livewallpaper_by_Settings() self._device.press.home() time.sleep(5) self._device.screen.off() time.sleep(3) self._device.screen.on() g_common_obj.assert_exp_happens()
class ComposeUI(UIATestBase): def setUp(self): super(ComposeUI, self).setUp() self._test_name = __name__ print "[Setup]: %s" % self._test_name #### Replace with MX # self._flvvideoplayer = FLVVideoPlayer() # self._composeui = ComposeUiImpl() # self.photos = get_photo_implement() # config = TestConfig() # cfg_file = 'tests.tablet.composeui.conf' # cfg_arti = config.read(cfg_file, 'artifactory') # config_handle = ConfigHandle() # cfg_arti["location"] = config_handle.read_configuration('artifactory', 'location', '/etc/oat/', 'sys.conf') # arti = Artifactory(cfg_arti.get('location')) # cfg_apk = config.read(cfg_file, 'FLVplayer') # binary_name = cfg_apk.get("name") # file_path = arti.get(binary_name) # result = config_handle.check_apps("air.br.com.bitlabs.FLVPlayer") # if result == 0: # g_common_obj.adb_cmd_common('install ' + file_path) # self.photos.rm_delete_photos() # self.photos.refresh_sdcard() # self._composeui.init_local_video() self._composeui = ComposeUiImpl() self._fit = FitImpl() config_handle = ConfigHandle() result = config_handle.check_apps("com.mxtech.videoplayer.ad") if result == 0: self._composeui.install_apk('Mxplayer') self._composeui.init_local_video() def tearDown(self): print "[Teardown]: %s" % self._test_name super(ComposeUI, self).tearDown() # self._composeui.delete_local_video() # self._flvvideoplayer.uninstall_app() self._composeui.uninstall_mxtech() self._fit.open_wifi() self._composeui.delete_local_video() def test_VideoPlayer_FLV(self): ''' refer TC test_VideoPlayer_FLV ''' print "[RunTest]: %s" % self.__str__() # self._flvvideoplayer.launch_app_am() # self._flvvideoplayer.play_video() # self._flvvideoplayer.stop_app_am() self._composeui.launch_mxtech_am() self._composeui.check_notification_during_playing() self._composeui.stop_mxtech_am()
class ComposeUI(UIATestBase): def setUp(self): super(ComposeUI, self).setUp() self._test_name = __name__ print "[Setup]: %s" % self._test_name self.d = g_common_obj.get_device() # self.photos = get_photo_implement() self._composeui = ComposeUiImpl() config_handle = ConfigHandle() result = config_handle.check_apps("com.mxtech.videoplayer.ad") if result == 0: self._composeui.install_apk('Mxplayer') self.d.screen.on() self._qr = QRcode() self.extend_photos = PhotosExtendImpl() self.remote_path = self.extend_photos.push_videos( count=1, like='test_video_qr_middle', exts='.mp4')[0] adb32.screen_rotation(0) def tearDown(self): print "[Teardown]: %s" % self._test_name super(ComposeUI, self).tearDown() os.remove("tmp.png") adb32.screen_rotation(0) def test_scaling_rotation_Video(self): ''' refer TC test_Scaling_Rotation_Video ''' print "[RunTest]: %s" % self.__str__() self._composeui.play_video_command_mx(self.remote_path) time.sleep(2) if self.d(textContains="START OVER").exists: self.d(textContains="START OVER").click.wait() for i in [2, 1, 3, 0]: adb32.screen_rotation(i) time.sleep(1) if self.d(resourceId="com.mxtech.videoplayer.ad:id/ui_layout" ).exists: self.d(resourceId="com.mxtech.videoplayer.ad:id/ui_layout" ).pinch.Out(percent=120) time.sleep(2) assert self._qr.decode_image_qrcode( self.d.screenshot("tmp.png") )[1] == "QRCODE_TEST_STRING", "The scaling of video playback failed!" self.d(resourceId="com.mxtech.videoplayer.ad:id/ui_layout" ).pinch.In(percent=70, steps=5) time.sleep(2) assert self._qr.decode_image_qrcode( self.d.screenshot("tmp.png") )[1] == "QRCODE_TEST_STRING", "The scaling of video playback failed!"
class LiveWallpaperPreview(UIATestBase): def setUp(self): super(LiveWallpaperPreview, self).setUp() self._test_name = __name__ self._device = g_common_obj.get_device() print "[Setup]: %s" % self._test_name self._liveWallpaper = WallpaperImpl() self._composeui = ComposeUiImpl() # self._liveWallpaper.reset_wallpaper() self._device = g_common_obj.get_device() config_handle = ConfigHandle() result = config_handle.check_apps("com.android.galaxy4") if result == 0: self._composeui.install_apk('Galaxy4') self.livewallpaper = ["Black Hole"] def tearDown(self): print "[Teardown]: %s" % self._test_name super(LiveWallpaperPreview, self).tearDown() # self._liveWallpaper.reset_wallpaper() self._liveWallpaper.stop_settings_am() def test_LiveWallpaper_PreviewAndSetAs(self): ''' refer TC test_LiveWallpaper_PreviewAndSetAs ''' print "[RunTest]: %s" % self.__str__() self._liveWallpaper.launch_set_livewallpaper_by_Settings() time.sleep(10) # self._device(text="Wallpapers").click.wait() # for i in range (0,len(self.livewallpaper)): # time.sleep(1) # try: # self._device(scrollable=True).scroll.horiz.to(text=self.livewallpaper[i]) # time.sleep(1) # self._device(text=self.livewallpaper[i]).click.wait() # time.sleep(4) # except: # print "Can't find text: " + self.livewallpaper[i] # g_common_obj.assert_exp_happens() # if i !=len(self.livewallpaper): # self._device.press.back() # else: # self._device(text="Set wallpaper").click.wait() # time.sleep(2) # self._device.press.home() # time.sleep(1) # g_common_obj.assert_exp_happens() g_common_obj.assert_exp_happens()
class ComposeUI(UIATestBase): def setUp(self): super(ComposeUI, self).setUp() self._test_name = __name__ print "[Setup]: %s" % self._test_name self._composeui = ComposeUiImpl() config_handle = ConfigHandle() result = config_handle.check_apps("com.intel.aws.workload.applaunch") if result == 0: self._composeui.install_apk('LaunchWorkload') def tearDown(self): print "[Teardown]: %s" % self._test_name super(ComposeUI, self).tearDown() self._composeui.uninstall_workload() def test_applaunchworkload_applaunchtime(self): ''' refer TC test_AppLaunchWorkload_AppLaunchTime ''' print "[RunTest]: %s" % self.__str__() self._composeui.launch_workload_am() self._composeui.test_config_apps() self._composeui.stop_workload_am()