def test_uninstall_withAppRunning(self): comm.setUp() comm.check_appname() cmdfind = "adb -s " + comm.device + \ " shell pm list packages |grep org.crosswalkproject.sample" # print "cmdfind: ", cmdfind pmstatus = commands.getstatusoutput(cmdfind) # print "pmstatus: ", pmstatus if pmstatus[0] != 0: print "Uninstall APK ----------------> %s App haven't installed,"\ " need to install it!" % comm.app_name os.chdir(comm.const_path + "/../testapp/") apk_file = commands.getstatusoutput("ls | grep %s | grep %s" % \ (comm.app_name.lower(), comm.ARCH))[1] cmdinst = "adb -s " + comm.device + " install -r " + apk_file comm.app_install(cmdinst, cmdfind, self) # Make sure the app is running cmd = "adb -s " + comm.device + " shell am start -n "\ "org.crosswalkproject.sample/.%sActivity" % comm.app_name comm.app_launch(cmd, self) time.sleep(2) # Uninstall the app cmduninst = "adb -s " + comm.device + \ " uninstall org.crosswalkproject.sample" comm.app_uninstall(cmduninst, self)
def test_launch(self): comm.setUp() comm.check_appname() cmd = "adb -s " + comm.device + " shell am start -n "\ "org.crosswalkproject.sample/.%sActivity" % comm.app_name print cmd comm.app_launch(cmd, self)
def test_uninstall_withAppRunning(self): comm.setUp() app_name = "Gallery" cmdfind = "adb -s " + comm.device + " shell pm list packages |grep org.xwalk.%s" % ( app_name.lower()) #print "cmdfind: ", cmdfind pmstatus = commands.getstatusoutput(cmdfind) #print "pmstatus: ", pmstatus if pmstatus[0] != 0: print "Uninstall APK ----------------> %s App haven't installed, need to install it!" % app_name os.chdir(comm.const_path + "/../testapp/") apk_file = commands.getstatusoutput("ls | grep %s" % app_name)[1] cmdinst = "adb -s " + comm.device + " install -r " + apk_file comm.app_install(cmdinst, cmdfind, self) # Make sure the app is running cmd = "adb -s " + comm.device + " shell am start -n org.xwalk.%s/.%sActivity" % \ (app_name.lower(), app_name) comm.app_launch(cmd, self) time.sleep(2) # Uninstall the app cmduninst = "adb -s " + comm.device + " uninstall org.xwalk.%s" % ( app_name.lower()) comm.app_uninstall(cmduninst, self)
def test_launch(self): comm.setUp() app_name = "gallery" pkg_name = "com.example." + app_name.lower() if not comm.check_app_installed(pkg_name, self): comm.app_install(app_name, pkg_name, self) comm.app_launch(app_name, pkg_name, self)
def test_launch(self): comm.setUp() app_name = "Eh" pkg_name = "com.mmocny.eh.app" if not comm.check_app_installed(pkg_name, self): comm.app_install(app_name, pkg_name, self) comm.app_launch(app_name, pkg_name, self)
def test_launch(self): comm.setUp() app_name = "CIRC" pkg_name = "com.github.flackr.Circ" if not comm.check_app_installed(pkg_name, self): comm.app_install(app_name, pkg_name, self) comm.app_launch(app_name, pkg_name, self)
def test_launch(self): comm.setUp() app_name = "privateNotes" pkg_name = "com.example." + app_name if not comm.check_app_installed(pkg_name, self): comm.app_install(app_name, pkg_name, self) comm.app_launch(app_name, pkg_name, self)
def test_uninstall_withAppRunning(self): comm.setUp() app_name = "Hangonman" cmdfind = "adb -s " + comm.device + \ " shell pm list packages |grep org.xwalk.%s" % (app_name.lower()) # print "cmdfind: ", cmdfind pmstatus = commands.getstatusoutput(cmdfind) # print "pmstatus: ", pmstatus if pmstatus[0] != 0: print "Uninstall APK ----------------> %s App haven't installed, need to install it!" % app_name os.chdir(comm.const_path + "/../testapp/") apk_file = commands.getstatusoutput("ls | grep %s" % app_name)[1] cmdinst = "adb -s " + comm.device + " install -r " + apk_file comm.app_install(cmdinst, cmdfind, self) # Make sure the app is running cmd = "adb -s " + comm.device + " shell am start -n org.xwalk.%s/.%sActivity" % \ (app_name.lower(), app_name) comm.app_launch(cmd, self) time.sleep(2) # Uninstall the app cmduninst = "adb -s " + comm.device + \ " uninstall org.xwalk.%s" % (app_name.lower()) comm.app_uninstall(cmduninst, self)
def test_launch(self): comm.setUp() app_name = "Gallery" cmd = "adb -s " + comm.device + " shell am start -n org.xwalk.%s/.%sActivity" % \ (app_name.lower(), app_name) #print "cmd: ", cmd comm.app_launch(cmd, self)
def test_multiple_apk_true(self): comm.setUp() app_name = "testMultipleApk" pkg_name = " com.example." + app_name.lower() content = "<a href='http://www.intel.com'>Intel</a>\n</body>" key = "</body>" replace_index_list = [key, content] comm.create( app_name, pkg_name, comm.MODE, None, replace_index_list, self, None, "true") comm.build(app_name, False, self) apk_name_arch = "armv7" if comm.ARCH == "x86": apk_name_arch = "x86" apk_path = os.path.join(os.getcwd(), "android-%s-debug.apk" % apk_name_arch) if not os.path.exists(apk_path): apk_path = os.path.join(os.getcwd(), "%s-%s-debug.apk" % (app_name, apk_name_arch)) print apk_path self.assertTrue(os.path.exists(apk_path)) comm.do_copy(apk_path, os.path.join(comm.testapp_path, "%s.apk" % app_name)) comm.app_install(app_name, pkg_name, self) comm.app_launch(app_name, pkg_name, self) comm.app_uninstall(pkg_name, self) comm.app_stop(pkg_name, self)
def test_launch(self): comm.setUp() app_name = "mobilespec" pkg_name = "org.apache." + app_name.lower() if not comm.check_app_installed(pkg_name, self): comm.app_install(app_name, pkg_name, self) comm.app_launch(app_name, pkg_name, self)
def test_launch(self): comm.setUp() app_name = "Gallery" cmd = "adb -s " + comm.device + " shell am start -n org.xwalk.%s/.%sActivity" % \ (app_name.lower(), app_name) # print "cmd: ", cmd comm.app_launch(cmd, self)
def test_launch(self): comm.setUp() app_name = "helloworld" pkg_name = "com.example." + app_name.lower() if not comm.check_app_installed(pkg_name, self): comm.app_install(app_name, pkg_name, self) comm.app_launch(app_name, pkg_name, self)
def test_stop(self): app_name = "testapp" pkg_name = "org.xwalk." + app_name if not comm.checkInstalled(pkg_name): comm.app_install(app_name, pkg_name, self) comm.app_launch(app_name, pkg_name, self) comm.app_stop(self)
def test_launch(self): comm.setUp() app_name = "gallery" pkg_name = "com.example." + app_name.lower() cmd_launch = "adb -s " + comm.device + " shell am start -n %s/.%s" % \ (pkg_name, app_name) if not comm.check_app_installed(pkg_name, self): comm.app_install(app_name, pkg_name, self) comm.app_launch(cmd_launch, self)
def test_launch(self): comm.setUp() app_name = "mobilespec" pkg_name = "org.apache." + app_name.lower() cmd_launch = "adb -s " + comm.device + " shell am start -n %s/.%s" % \ (pkg_name, app_name) if not comm.check_app_installed(pkg_name, self): comm.app_install(app_name, pkg_name, self) comm.app_launch(cmd_launch, self)
def test_build(self): comm.setUp() app_name = "Demo" pkg_name = "com.example.demo" comm.create(app_name, pkg_name, self) comm.build_maven(app_name, pkg_name, True, self) comm.app_install(app_name, pkg_name, self) comm.app_launch(app_name, pkg_name, self) self.assertTrue(comm.check_app_launched(pkg_name, self)) comm.app_stop(pkg_name, self) comm.app_uninstall(pkg_name, self)
def test_close(self): comm.setUp() app_name = "gallery" pkg_name = "com.example." + app_name.lower() if not comm.check_app_installed(pkg_name, self): comm.app_install(app_name, pkg_name, self) if not comm.check_app_launched(pkg_name, self): print "Close app ---------------->%s App haven't launched, need to launch it!" % app_name comm.app_launch(app_name, pkg_name, self) time.sleep(1) comm.app_stop(pkg_name, self)
def test_build(self): comm.setUp() app_name = "Demo" pkg_name = "com.example.demo" comm.create(app_name, pkg_name, self) comm.build_gradle(app_name, False, False, self) comm.app_install(app_name, pkg_name, self) comm.app_launch(app_name, pkg_name, self) self.assertTrue(comm.check_app_launched(pkg_name, self)) comm.app_stop(pkg_name, self) comm.app_uninstall(pkg_name, self)
def test_close(self): comm.setUp() app_name = "CIRC" pkg_name = "com.github.flackr.Circ" if not comm.check_app_installed(pkg_name, self): comm.app_install(app_name, pkg_name, self) if not comm.check_app_launched(pkg_name, self): print "Close app ---------------->%s App haven't launched, need to launch it!" % app_name comm.app_launch(app_name, pkg_name, self) time.sleep(1) comm.app_stop(pkg_name, self)
def test_close(self): comm.setUp() app_name = "Eh" pkg_name = "com.mmocny.eh.app" if not comm.check_app_installed(pkg_name, self): comm.app_install(app_name, pkg_name, self) if not comm.check_app_launched(pkg_name, self): print "Close app ---------------->%s App haven't launched, need to launch it!" % app_name comm.app_launch(app_name, pkg_name, self) time.sleep(1) comm.app_stop(pkg_name, self)
def test_close(self): comm.setUp() app_name = "mobilespec" pkg_name = "org.apache." + app_name.lower() if not comm.check_app_installed(pkg_name, self): comm.app_install(app_name, pkg_name, self) if not comm.check_app_launched(pkg_name, self): print "Close app ---------------->%s App haven't launched, need to launch it!" % app_name comm.app_launch(app_name, pkg_name, self) time.sleep(1) comm.app_stop(pkg_name, self)
def test_close(self): comm.setUp() app_name = "helloworld" pkg_name = "com.example." + app_name.lower() if not comm.check_app_installed(pkg_name, self): comm.app_install(app_name, pkg_name, self) if not comm.check_app_launched(pkg_name, self): print "Close app ---------------->%s App haven't launched, need to launch it!" % app_name comm.app_launch(app_name, pkg_name, self) time.sleep(1) comm.app_stop(pkg_name, self)
def test_mode_lite(self): comm.setUp() app_name = "modeLite" pkg_name = " com.example." + app_name.lower() comm.create(app_name, pkg_name, comm.MODE, None, None, self, None, None) project_root = os.path.join(comm.tool_path, app_name) comm.replace_key(os.path.join(project_root, 'config.xml'), '<preference name="xwalkMode" value="lite"', '<preference name="xwalkMode" value="embedded"') comm.build(app_name, 0, self, True) comm.app_install(app_name, pkg_name, self) comm.app_launch(app_name, pkg_name, self) comm.app_stop(pkg_name, self) comm.app_uninstall(pkg_name, self)
def test_stop(self): comm.setUp() app_name = "Sysapps" # Find whether the app have launched cmdacti = "adb -s " + comm.device + " shell dumpsys activity activities | grep org.xwalk.%s" % app_name.lower() launched = commands.getstatusoutput(cmdacti) if launched[0] != 0: print "Stop APK ---------------->%s App haven't launched, need to launch it!" % app_name cmdstart = "adb -s " + comm.device + " shell am start -n org.xwalk.%s/.%sActivity" % \ (app_name.lower(), app_name) comm.app_launch(cmdstart, self) time.sleep(1) cmdstop = "adb -s " + comm.device + " shell am force-stop org.xwalk.%s" % app_name.lower() comm.app_stop(cmdstop, self)
def test_uninstall_withAppRunning(self): comm.setUp() app_name = "gallery" pkg_name = "com.example." + app_name.lower() if not comm.check_app_installed(pkg_name, self): comm.app_install(app_name, pkg_name, self) # Make sure the app is running comm.app_launch(app_name, pkg_name, self) time.sleep(2) # Uninstall the app comm.app_uninstall(pkg_name, self)
def test_uninstall_withAppRunning(self): comm.setUp() app_name = "privateNotes" pkg_name = "com.example." + app_name if not comm.check_app_installed(pkg_name, self): comm.app_install(app_name, pkg_name, self) # Make sure the app is running comm.app_launch(app_name, pkg_name, self) time.sleep(2) # Uninstall the app comm.app_uninstall(pkg_name, self)
def test_uninstall_withAppRunning(self): comm.setUp() app_name = "gallery" pkg_name = "com.example." + app_name.lower() cmd_launch = "adb -s " + comm.device + " shell am start -n %s/.%s" % \ (pkg_name, app_name) if not comm.check_app_installed(pkg_name, self): comm.app_install(app_name, pkg_name, self) # Make sure the app is running comm.app_launch(cmd_launch, self) time.sleep(2) # Uninstall the app comm.app_uninstall(pkg_name, self)
def test_stop(self): comm.setUp() app_name = "Webrtc" # Find whether the app have launched cmdacti = "adb -s " + comm.device + " shell dumpsys activity activities | grep org.xwalk.%s" % app_name.lower( ) launched = commands.getstatusoutput(cmdacti) if launched[0] != 0: print "Stop APK ---------------->%s App haven't launched, need to launch it!" % app_name cmdstart = "adb -s " + comm.device + " shell am start -n org.xwalk.%s/.%sActivity" % \ (app_name.lower(), app_name) comm.app_launch(cmdstart, self) time.sleep(1) cmdstop = "adb -s " + comm.device + " shell am force-stop org.xwalk.%s" % app_name.lower( ) comm.app_stop(cmdstop, self)
def test_multiple_apk_true(self): comm.setUp() app_name = "testMultipleApk" pkg_name = " com.example." + app_name.lower() content = "<a href='http://www.intel.com'>Intel</a>\n</body>" key = "</body>" replace_index_list = [key, content] comm.create(app_name, pkg_name, comm.MODE, None, replace_index_list, self, None, "true") comm.build(app_name, 0, self, True) comm.checkFileSize( os.path.join(comm.testapp_path, "%s.apk" % app_name), 10, 15, self) comm.app_install(app_name, pkg_name, self) comm.app_launch(app_name, pkg_name, self) comm.app_stop(pkg_name, self) comm.app_uninstall(pkg_name, self)
def test_close(self): comm.setUp() app_name = "gallery" pkg_name = "com.example." + app_name.lower() if not comm.check_app_installed(pkg_name, self): comm.app_install(app_name, pkg_name, self) # Find whether the app have launched cmd_acti = "adb -s " + comm.device + " shell ps | grep %s" % pkg_name launched = commands.getstatusoutput(cmd_acti) if launched[0] != 0: print "Close app ---------------->%s App haven't launched, need to launch it!" % app_name cmd_start = "adb -s " + comm.device + " shell am start -n %s/.%s" % (pkg_name, app_name) comm.app_launch(cmd_start, self) time.sleep(1) cmd_close = "adb -s " + comm.device + " shell am force-stop %s" % pkg_name comm.app_stop(cmd_close, self)
def test_stop(self): comm.setUp() comm.check_appname() # Find whether the app have launched cmdacti = "adb -s " + comm.device + \ " shell dumpsys activity activities | grep "\ "org.crosswalkproject.sample" launched = commands.getstatusoutput(cmdacti) if launched[0] != 0: print "Stop APK ---------------->%s App haven't launched,"\ " need to launch it!" % comm.app_name cmdstart = "adb -s " + comm.device + " shell am start -n "\ "org.crosswalkproject.sample/.%sActivity" % comm.app_name comm.app_launch(cmdstart, self) time.sleep(1) cmdstop = "adb -s " + comm.device + \ " shell am force-stop org.crosswalkproject.sample"
def test_close(self): comm.setUp() app_name = "gallery" pkg_name = "com.example." + app_name.lower() if not comm.check_app_installed(pkg_name, self): comm.app_install(app_name, pkg_name, self) # Find whether the app have launched cmd_acti = "adb -s " + comm.device + " shell ps | grep %s" % pkg_name launched = commands.getstatusoutput(cmd_acti) if launched[0] != 0: print "Close app ---------------->%s App haven't launched, need to launch it!" % app_name cmd_start = "adb -s " + comm.device + " shell am start -n %s/.%s" % ( pkg_name, app_name) comm.app_launch(cmd_start, self) time.sleep(1) cmd_close = "adb -s " + comm.device + " shell am force-stop %s" % pkg_name comm.app_stop(cmd_close, self)
def test_multiple_apk_false(self): comm.setUp() app_name = "testMultipleApk" pkg_name = " com.example." + app_name.lower() content = "<a href='http://www.intel.com'>Intel</a>\n</body>" key = "</body>" replace_index_list = [key, content] comm.create( app_name, pkg_name, comm.MODE, None, replace_index_list, self, None, "false") comm.build(app_name, 0, self, True, False) comm.checkFileSize(os.path.join(comm.testapp_path, "%s.apk" % app_name), 20, 25, self) comm.app_install(app_name, pkg_name, self) comm.app_launch(app_name, pkg_name, self) comm.app_stop(pkg_name, self) comm.app_uninstall(pkg_name, self)
def test_launch(self): comm.setUp() comm.check_appname() cmd = "adb -s " + comm.device + " shell am start -n " "org.crosswalkproject.sample/.%sActivity" % comm.app_name print cmd comm.app_launch(cmd, self)
def test_launch(self): comm.setUp() app_name = "Spacedodgegame" cmd = "adb -s " + comm.device + " shell am start -n "\ "org.xwalk.%s/.%sActivity" % (app_name.lower(), app_name) comm.app_launch(cmd, self)
def test_launch(self): comm.setUp() app_name = "Hangonman" cmd = "adb -s " + comm.device + " shell am start -n org.xwalk.%s/.%sActivity" % \ (app_name.lower(), app_name) comm.app_launch(cmd, self)