def test_multiple_icons(self): comm.setUp() comm.create(self) os.chdir('org.xwalk.test') jsonfile = open( comm.ConstPath + "/../tools/org.xwalk.test/app/manifest.json", "r") jsons = jsonfile.read() jsonfile.close() jsonDict = json.loads(jsons) jsonDict["icons"] = [{ "src": "icon.png", "sizes": "72x72" }, { "src": "../../../icon/icon.gif", "sizes": "82x82" }, { "src": "../../../icon/icon.jpg", "sizes": "97x97" }, { "src": "../../../icon/icon.bmp", "sizes": "117x117" }] json.dump( jsonDict, open(comm.ConstPath + "/../tools/org.xwalk.test/app/manifest.json", "w")) buildcmd = comm.HOST_PREFIX + comm.PackTools + "crosswalk-app build" buildstatus = os.system(buildcmd) comm.run(self) comm.clear("org.xwalk.test") if comm.SHELL_FLAG == "False": os.system('adb start-server') self.assertEquals(buildstatus, 0)
def test_build_release_provison(self): comm.setUp() comm.create(self) os.chdir('org.xwalk.test') buildcmd = comm.PackTools + 'crosswalk-app build release --ios-provison "ios"' comm.build(self, buildcmd) comm.clear("org.xwalk.test")
def test_update_app_version_twodot(self): comm.setUp() comm.create(self) os.chdir('org.xwalk.test') jsonfile = open(comm.ConstPath + "/../tools/org.xwalk.test/app/manifest.json", "r") jsons = jsonfile.read() jsonfile.close() jsonDict = json.loads(jsons) jsonDict["xwalk_app_version"] = "0.0.1" json.dump(jsonDict, open(comm.ConstPath + "/../tools/org.xwalk.test/app/manifest.json", "w")) with open(comm.ConstPath + "/../tools/org.xwalk.test/app/manifest.json") as json_file: data = json.load(json_file) buildcmd = comm.HOST_PREFIX + comm.PackTools + "crosswalk-app build" buildstatus = os.popen(buildcmd).readlines() index = 0 for x in range(len(buildstatus),0,-1): index = x -1 if buildstatus[index].find("Using android:versionCode") != -1: break versionCode = buildstatus[index].strip(" *\nUsing android:versionCode")[1:-1] root = ElementTree.parse(comm.ConstPath + "/../tools/org.xwalk.test/prj/android/AndroidManifest.xml").getroot() attributes = root.attrib for x in attributes.keys(): if x.find("versionCode") != -1: versionCode_xml = attributes[x] break comm.clear("org.xwalk.test") self.assertEquals(data['xwalk_app_version'].strip(os.linesep), "0.0.1") self.assertEquals(versionCode, versionCode_xml)
def test_update_app_version(self): comm.setUp() comm.create(self) os.chdir('org.xwalk.test') jsonfile = open(comm.ConstPath + "/../tools/org.xwalk.test/app/manifest.json", "r") jsons = jsonfile.read() jsonfile.close() jsonDict = json.loads(jsons) jsonDict["xwalk_app_version"] = "0.0.1" json.dump(jsonDict, open(comm.ConstPath + "/../tools/org.xwalk.test/app/manifest.json", "w")) with open(comm.ConstPath + "/../tools/org.xwalk.test/app/manifest.json") as json_file: data = json.load(json_file) buildcmd = comm.HOST_PREFIX + comm.PackTools + "crosswalk-app build" buildstatus = os.system(buildcmd) root = ElementTree.parse(comm.ConstPath + "/../tools/org.xwalk.test/prj/android/AndroidManifest.xml").getroot() attributes = root.attrib for x in attributes.keys(): if x.find("versionName") != -1: versionName_xml = attributes[x] break comm.run(self) comm.clear("org.xwalk.test") if comm.SHELL_FLAG == "False": os.system('adb start-server') self.assertEquals(data['xwalk_app_version'].strip("\n\t"), "0.0.1") self.assertEquals(buildstatus, 0) self.assertEquals(data['xwalk_app_version'].strip("\n\t"), versionName_xml)
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_update_name(self): comm.setUp() comm.create(self) os.chdir('org.xwalk.test') jsonfile = open( comm.ConstPath + "/../tools/org.xwalk.test/app/manifest.json", "r") jsons = jsonfile.read() jsonfile.close() jsonDict = json.loads(jsons) jsonDict["name"] = "org.example.test" json.dump( jsonDict, open(comm.ConstPath + "/../tools/org.xwalk.test/app/manifest.json", "w")) buildcmd = comm.HOST_PREFIX + comm.PackTools + "crosswalk-app build" comm.build(self, buildcmd) root = ElementTree.parse( comm.ConstPath + "/../tools/org.xwalk.test/prj/android/AndroidManifest.xml" ).getroot() application_attributes = root.find('application').attrib for x in application_attributes.keys(): if x.find("label") != -1: application_xml = application_attributes[x] break activity_attributes = root.find('application').find('activity').attrib for y in activity_attributes.keys(): if y.find("label") != -1: activity_xml = activity_attributes[y] break comm.clear("org.xwalk.test") self.assertEquals(application_xml, "org.example.test") self.assertEquals(activity_xml, "org.example.test")
def test_build(self): comm.setUp() app_name = "remotedebugging" cmd_create = "bin/create " + app_name + " com.example." + app_name + " " + app_name comm.create(cmd_create, app_name, self) cmd_build = "./cordova/build --debug" comm.build(cmd_build, app_name, self)
def test_versionCode_normal(self): comm.setUp() comm.create(self) os.chdir('org.xwalk.test') buildcmd = comm.HOST_PREFIX + comm.PackTools + "crosswalk-app build" buildstatus = os.popen(buildcmd).readlines() index = 0 for x in range(len(buildstatus), 0, -1): index = x - 1 if buildstatus[index].find("Using android:versionCode") != -1: break versionCode = buildstatus[index].strip( " *\nUsing android:versionCode")[1:-1] root = ElementTree.parse( comm.ConstPath + "/../tools/org.xwalk.test/prj/android/AndroidManifest.xml" ).getroot() attributes = root.attrib for x in attributes.keys(): if x.find("versionCode") != -1: versionCode_xml = attributes[x] break comm.run(self) comm.clear("org.xwalk.test") if comm.SHELL_FLAG == "False": os.system('adb start-server') self.assertEquals(versionCode, versionCode_xml)
def test_build_normal(self): comm.setUp() comm.create(self) os.chdir('org.xwalk.test') buildcmd = comm.HOST_PREFIX + comm.PackTools + "crosswalk-app build" comm.build(self, buildcmd) comm.clear("org.xwalk.test")
def test_build_missing_so_file(self): comm.setUp() comm.create(self) os.chdir('org.xwalk.test') if comm.ARCH == "x86": os.remove( os.getcwd() + '/prj/android/xwalk_core_library/libs/armeabi-v7a/libxwalkcore.so') buildcmd = comm.HOST_PREFIX + comm.PackTools + "crosswalk-app build" buildstatus = os.system(buildcmd) self.assertEquals(buildstatus, 0) pkgs = os.listdir(os.getcwd()) armLength = 0 for i in range(len(pkgs)): if pkgs[i].endswith(".apk") and "arm" in pkgs[i]: armLength = armLength + 1 self.assertEquals(armLength, 0) else: os.remove( os.getcwd() + '/prj/android/xwalk_core_library/libs/x86/libxwalkcore.so') buildcmd = comm.HOST_PREFIX + comm.PackTools + "crosswalk-app build" buildstatus = os.system(buildcmd) self.assertEquals(buildstatus, 0) pkgs = os.listdir(os.getcwd()) x86Length = 0 for i in range(len(pkgs)): if pkgs[i].endswith(".apk") and "x86" in pkgs[i]: x86Length = x86Length + 1 self.assertEquals(x86Length, 0) comm.run(self) comm.clear("org.xwalk.test") os.system('adb start-server')
def test_target_build(self): comm.setUp() comm.clear("org.xwalk.test") os.chdir(comm.XwalkPath) comm.create(self) if comm.SHELL_FLAG == "False": cmd = "where android" else: cmd = "which android" (return_code, androidpath) = comm.getstatusoutput(cmd) targetversionpath = os.path.dirname(os.path.dirname(androidpath[0])) os.chdir(targetversionpath) if os.path.exists(os.path.dirname(os.path.dirname(targetversionpath)) + "/platforms/"): shutil.rmtree(os.path.dirname(os.path.dirname(targetversionpath)) + "/platforms/") os.mkdir(os.path.dirname(os.path.dirname(targetversionpath)) + "/platforms/") movepath = os.path.dirname(os.path.dirname(targetversionpath)) if comm.SHELL_FLAG == "False": os.system("xcopy /s /e /i /y platforms\* " + movepath + "\platforms") else: os.system("mv platforms/* " + movepath + "/platforms/") shutil.rmtree("platforms") os.chdir(comm.XwalkPath) os.chdir('org.xwalk.test') buildcmd = comm.HOST_PREFIX + comm.PackTools + "crosswalk-app build" (return_build_code, buildstatus) = comm.getstatusoutput(buildcmd) os.chdir(movepath) os.mkdir(targetversionpath + "/platforms") if comm.SHELL_FLAG == "False": os.system("xcopy /s /e /i /y platforms\* " + targetversionpath + "\platforms") else: os.system("mv platforms/* " + targetversionpath + "/platforms/") shutil.rmtree("platforms") comm.clear("org.xwalk.test") self.assertNotEquals(return_build_code, 0) self.assertIn("project target", buildstatus[0])
def test_update_path(self): comm.setUp() comm.create(self) updatecmd = comm.HOST_PREFIX + comm.PackTools + "crosswalk-app update " + comm.XwalkPath + "org.xwalk.test" return_update_code = os.system(updatecmd) comm.clear("org.xwalk.test") self.assertNotEquals(return_update_code, 0)
def test_update_name(self): comm.setUp() comm.create(self) os.chdir('org.xwalk.test') jsonfile = open(comm.ConstPath + "/../tools/org.xwalk.test/app/manifest.json", "r") jsons = jsonfile.read() jsonfile.close() jsonDict = json.loads(jsons) jsonDict["name"] = "org.example.test" json.dump(jsonDict, open(comm.ConstPath + "/../tools/org.xwalk.test/app/manifest.json", "w")) buildcmd = comm.HOST_PREFIX + comm.PackTools + "crosswalk-app build" comm.build(self, buildcmd) root = ElementTree.parse(comm.ConstPath + "/../tools/org.xwalk.test/prj/android/AndroidManifest.xml").getroot() application_attributes = root.find('application').attrib for x in application_attributes.keys(): if x.find("label") != -1: application_xml = application_attributes[x] break activity_attributes = root.find('application').find('activity').attrib for y in activity_attributes.keys(): if y.find("label") != -1: activity_xml = activity_attributes[y] break comm.clear("org.xwalk.test") self.assertEquals(application_xml, "org.example.test") self.assertEquals(activity_xml, "org.example.test")
def test_build(self): comm.setUp() app_name = "spacedodge" pkg_name = " com.example." + app_name.lower() sample_src_pref = "/tmp/crosswalk-demos/space-dodge-game/base" comm.create(app_name, pkg_name, comm.MODE, sample_src_pref, None, self) comm.build(app_name, False, self)
def test_update_canary(self): comm.setUp() comm.create(self) os.chdir('org.xwalk.test') updatecmd = comm.PackTools + "crosswalk-app update canary" currentVersion = comm.update(self, updatecmd) crosswalklist = urllib2.urlopen( 'https://download.01.org/crosswalk/releases/crosswalk/android/canary/').read() fp = open('test', 'w') fp.write(crosswalklist) fp.close() line = commands.getstatusoutput( "cat test|sed -n '/src\=\"\/icons\/folder.gif\"/=' |sed -n '$p'")[1].strip() cmd = "cat test |sed -n '%dp' |awk -F 'href=' '{print $2}' |awk -F '\"|/' '{print $2}'" % int( line) version = commands.getstatusoutput(cmd)[1] if not '.' in version: line = commands.getstatusoutput( "tac test|sed -n '/src\=\"\/icons\/folder.gif\"/=' |sed -n '2p'")[1].strip() cmd = "tac test |sed -n '%dp' |awk -F 'href=' '{print $2}' |awk -F '\"|/' '{print $2}'" % int( line) version = commands.getstatusoutput(cmd)[1] commands.getstatusoutput("rm -rf test") comm.clear("org.xwalk.test") self.assertEquals(currentVersion, version)
def test_build(self): comm.setUp() app_name = "gallery" pkg_name = " com.example." + app_name.lower() sample_src_pref = "/tmp/crosswalk-demos/Gallery" comm.create(app_name, pkg_name, comm.MODE, sample_src_pref, None, self) comm.build(app_name, False, self)
def test_update_app_version(self): comm.setUp() comm.create(self) os.chdir('org.xwalk.test') jsonfile = open( comm.ConstPath + "/../tools/org.xwalk.test/app/manifest.json", "r") jsons = jsonfile.read() jsonfile.close() jsonDict = json.loads(jsons) jsonDict["xwalk_app_version"] = "0.0.1" json.dump( jsonDict, open(comm.ConstPath + "/../tools/org.xwalk.test/app/manifest.json", "w")) with open(comm.ConstPath + "/../tools/org.xwalk.test/app/manifest.json") as json_file: data = json.load(json_file) buildcmd = comm.HOST_PREFIX + comm.PackTools + "crosswalk-app build" buildstatus = os.system(buildcmd) root = ElementTree.parse( comm.ConstPath + "/../tools/org.xwalk.test/prj/android/AndroidManifest.xml" ).getroot() attributes = root.attrib for x in attributes.keys(): if x.find("versionName") != -1: versionName_xml = attributes[x] break comm.clear("org.xwalk.test") self.assertEquals(data['xwalk_app_version'].strip("\n\t"), "0.0.1") self.assertEquals(buildstatus, 0) self.assertEquals(data['xwalk_app_version'].strip("\n\t"), versionName_xml)
def test_build_release(self): comm.setUp() comm.create(self) os.chdir('org.xwalk.test') buildcmd = comm.PackTools + "crosswalk-app build release" comm.build(self, buildcmd) comm.clear("org.xwalk.test")
def test_build_missing_so_file(self): comm.setUp() comm.create(self) os.chdir('org.xwalk.test') if comm.ARCH == "x86": os.remove( os.getcwd() + '/prj/android/xwalk_core_library/libs/armeabi-v7a/libxwalkcore.so') buildcmd = comm.PackTools + "crosswalk-app build" buildstatus = commands.getstatusoutput(buildcmd) self.assertEquals(buildstatus[0], 0) os.chdir('pkg') pkgs = os.listdir(os.getcwd()) self.assertNotIn("test-debug.armeabi-v7a.apk", pkgs) else: os.remove( os.getcwd() + '/prj/android/xwalk_core_library/libs/x86/libxwalkcore.so') buildcmd = comm.PackTools + "crosswalk-app build" buildstatus = commands.getstatusoutput(buildcmd) self.assertEquals(buildstatus[0], 0) os.chdir('pkg') pkgs = os.listdir(os.getcwd()) self.assertNotIn("test-debug.x86.apk", pkgs) comm.run(self) comm.clear("org.xwalk.test")
def test_update_version(self): comm.setUp() comm.create(self) os.chdir('org.xwalk.test') updatecmd = comm.PackTools + "crosswalk-app update 13.42.319.7" comm.update(self, updatecmd) comm.clear("org.xwalk.test")
def test_update_invalid_channel(self): comm.setUp() comm.create(self) updatecmd = comm.HOST_PREFIX + comm.PackTools + "crosswalk-app update channel org.xwalk.test --windows-crosswalk=" + comm.XwalkPath + comm.windowsCrosswalk (return_update_code, update_output) = comm.getstatusoutput(updatecmd) comm.clear("org.xwalk.test") self.assertIn("ERROR:", update_output[0])
def test_build_release_sdk(self): comm.setUp() comm.create(self) os.chdir('org.xwalk.test') buildcmd = comm.PackTools + "crosswalk-app build release --ios-sdk iphoneos" comm.build(self, buildcmd) comm.clear("org.xwalk.test")
def test_update_version(self): comm.setUp() comm.create(self) os.chdir('org.xwalk.test') updatecmd = comm.HOST_PREFIX + comm.PackTools + "crosswalk-app update 13.42.319.7" comm.update(self, updatecmd) comm.clear("org.xwalk.test")
def test_build_debug_path_webp(self): comm.setUp() comm.create(self) jsonfile = open( comm.ConstPath + "/../tools/org.xwalk.test/app/manifest.json", "r") jsons = jsonfile.read() jsonfile.close() jsonDict = json.loads(jsons) jsonDict["xwalk_android_webp"] = "80 80 100" json.dump( jsonDict, open(comm.ConstPath + "/../tools/org.xwalk.test/app/manifest.json", "w")) if os.path.exists("pkg"): shutil.rmtree("pkg") os.mkdir("pkg") os.chdir('pkg') buildcmd = comm.HOST_PREFIX + comm.PackTools + "crosswalk-app build " + comm.XwalkPath + "org.xwalk.test" comm.build(self, buildcmd) comm.run(self) os.chdir('../') shutil.rmtree("pkg") comm.clear("org.xwalk.test") if comm.SHELL_FLAG == "False": os.system('adb start-server')
def test_build_release_sign(self): comm.setUp() comm.create(self) os.chdir('org.xwalk.test') buildcmd = comm.PackTools + 'crosswalk-app build release --ios-sign "iPhone Developer: M VINCENT DAUBRY (J9TS3TJRYX)"' comm.build(self, buildcmd) comm.clear("org.xwalk.test")
def test_packageID(self): comm.setUp() comm.create(self) os.chdir(comm.TEST_PROJECT_COMM) with open(comm.TEMP_DATA_PATH + comm.TEST_PROJECT_COMM + "/app/manifest.json") as json_file: data = json.load(json_file) comm.cleanTempData(comm.TEST_PROJECT_COMM) self.assertEquals(data["xwalk_package_id"].strip(os.linesep), comm.TEST_PROJECT_COMM)
def test_build(self): comm.setUp() app_name = "privateNotes" pkg_name = " com.example." + app_name sample_src_pref = "/tmp/crosswalk-demos/sample-my-private-notes/www" extra_plugin = "https://github.com/01org/AppSecurityApi" comm.create(app_name, pkg_name, comm.MODE, sample_src_pref, None, self, extra_plugin) comm.build(app_name, False, self)
def test_packageID_normal(self): comm.setUp() comm.create(self) os.chdir('org.xwalk.test') with open(comm.ConstPath + "/../tools/org.xwalk.test/app/manifest.json") as json_file: data = json.load(json_file) comm.clear("org.xwalk.test") self.assertEquals(data['xwalk_package_id'].strip(os.linesep), "org.xwalk.test")
def test_create(self): comm.setUp() app_name = "helloworld" 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)
def test_packageID(self): comm.setUp() comm.create(self) os.chdir('org.xwalk.test') with open(comm.ConstPath + "/../tools/org.xwalk.test/app/manifest.json") as json_file: data = json.load(json_file) comm.clear("org.xwalk.test") self.assertEquals(data['xwalk_package_id'].strip(os.linesep), "org.xwalk.test")
def test_update_invalid_version(self): comm.setUp() comm.create(self) os.chdir('org.xwalk.test') updatecmd = comm.PackTools + "crosswalk-app update 0.0.0.0" updatestatus = commands.getstatusoutput(updatecmd) comm.clear("org.xwalk.test") self.assertIn("ERROR:", updatestatus[1])
def test_build_release(self): comm.setUp() comm.create(self) os.chdir('org.xwalk.test') buildcmd = comm.PackTools + "crosswalk-app build release" comm.build(self, buildcmd) comm.run(self) comm.clear("org.xwalk.test")
def test_update_invalid_version(self): comm.setUp() comm.create(self) os.chdir('org.xwalk.test') updatecmd = comm.HOST_PREFIX + comm.PackTools + "crosswalk-app update 0.0.0.0" (return_update_code, update_output) = comm.getstatusoutput(updatecmd) comm.clear("org.xwalk.test") self.assertIn("ERROR:", update_output[0])
def test_build(self): comm.setUp() app_name = "privateNotes" pkg_name = " com.example." + app_name sample_src_pref = "/tmp/crosswalk-demos/sample-my-private-notes/www" extra_plugin = "https://github.com/01org/AppSecurityApi" comm.create(app_name, pkg_name, comm.MODE, sample_src_pref, None, self, extra_plugin) comm.build(app_name, 0, self)
def test_build_normal(self): comm.setUp() comm.create(self) os.chdir(comm.TEST_PROJECT_COMM) buildcmd = "crosswalk-app build" comm.build(self, buildcmd) comm.run(self) comm.cleanTempData(comm.TEST_PROJECT_COMM) comm.delete()
def test_name_chinese(self): comm.setUp() comm.create(self) os.chdir('org.xwalk.test') shutil.copyfile(comm.ConstPath + "/../testapp/manifest_name_chinese/manifest.json", comm.ConstPath + "/../tools/org.xwalk.test/app/manifest.json") buildcmd = comm.PackTools + "crosswalk-app build" buildstatus = os.system(buildcmd) comm.clear("org.xwalk.test") self.assertEquals(buildstatus, 0)
def test_build_release(self): comm.setUp() comm.create(self) os.chdir('org.xwalk.test') buildcmd = comm.HOST_PREFIX + comm.PackTools + "crosswalk-app build release" comm.build(self, buildcmd) comm.run(self) comm.clear("org.xwalk.test") os.system('adb start-server')
def test_name_chinese(self): comm.setUp() comm.create(self) os.chdir('org.xwalk.test') shutil.copyfile(comm.ConstPath + "/../testapp/manifest_name_chinese/manifest.json", comm.ConstPath + "/../tools/org.xwalk.test/app/manifest.json") buildcmd = comm.HOST_PREFIX + comm.PackTools + "crosswalk-app build" buildstatus = os.system(buildcmd) comm.clear("org.xwalk.test") self.assertEquals(buildstatus, 0)
def test_update_toplevel_dir(self): comm.setUp() comm.create(self) os.chdir('org.xwalk.test/pkg') updatecmd = comm.PackTools + "crosswalk-app update" updatestatus = commands.getstatusoutput(updatecmd) print updatestatus[1] comm.clear("org.xwalk.test") self.assertNotEquals(updatestatus[0], 0)
def test_update_toplevel_dir(self): comm.setUp() comm.create(self) os.chdir('org.xwalk.test/app') updatecmd = comm.HOST_PREFIX + comm.PackTools + "crosswalk-app update" (return_update_code, update_output) = comm.getstatusoutput(updatecmd) print update_output[0] comm.clear("org.xwalk.test") self.assertNotEquals(return_update_code, 0)
def test_name_chinese(self): comm.setUp() comm.create(self) os.chdir(comm.TEST_PROJECT_COMM) shutil.copyfile(comm.TEMP_DATA_PATH + "/../testapp/manifest_name_chinese/manifest.json", comm.TEMP_DATA_PATH + comm.TEST_PROJECT_COMM + "/app/manifest.json") buildcmd = "crosswalk-app build" buildstatus = os.system(buildcmd) comm.run(self) comm.cleanTempData(comm.TEST_PROJECT_COMM) self.assertEquals(buildstatus, 0)
def test_packageID(self): comm.setUp() comm.create(self) os.chdir(comm.TEST_PROJECT_COMM) with open(comm.TEMP_DATA_PATH + comm.TEST_PROJECT_COMM + "/app/manifest.json") as json_file: data = json.load(json_file) comm.cleanTempData(comm.TEST_PROJECT_COMM) self.assertEquals(data['xwalk_package_id'].strip(os.linesep), comm.TEST_PROJECT_COMM)
def test_build_normal(self): comm.setUp() comm.create(self) os.chdir('org.xwalk.test') buildcmd = comm.HOST_PREFIX + comm.PackTools + "crosswalk-app build" comm.build(self, buildcmd) comm.run(self) comm.clear("org.xwalk.test") if comm.SHELL_FLAG == "False": os.system('adb start-server')
def test_versionCode_normal(self): comm.setUp() comm.create(self) os.chdir('org.xwalk.test') with open(comm.ConstPath + "/../tools/org.xwalk.test/app/manifest.json") as json_file: data = json.load(json_file) buildcmd = comm.HOST_PREFIX + comm.PackTools + "crosswalk-app build" appVersion = comm.build(self, buildcmd) comm.clear("org.xwalk.test") self.assertEquals(data['xwalk_app_version'].strip(os.linesep), appVersion)
def test_update_currentVersion(self): comm.setUp() comm.create(self) os.chdir('org.xwalk.test') updatecmd = comm.PackTools + "crosswalk-app update 13.42.319.7" comm.update(self, updatecmd) newupdatecmd = comm.PackTools + "crosswalk-app update 13.42.319.7" updatestatus = commands.getstatusoutput(newupdatecmd) self.assertIn("Using cached", updatestatus[1]) comm.clear("org.xwalk.test")
def test_update_currentVersion(self): comm.setUp() comm.create(self) os.chdir('org.xwalk.test') updatecmd = comm.HOST_PREFIX + comm.PackTools + "crosswalk-app update 13.42.319.7" comm.update(self, updatecmd) newupdatecmd = comm.HOST_PREFIX + comm.PackTools + "crosswalk-app update 13.42.319.7" (return_update_code, update_output) = comm.getstatusoutput(newupdatecmd) comm.clear("org.xwalk.test") self.assertIn("Using cached", update_output[0])
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)