diff --git a/arkui/ace_ets_component_four/entry/src/main/ets/test/ImageJsunit.test.ets b/arkui/ace_ets_component_four/entry/src/main/ets/test/ImageJsunit.test.ets index 3b298bc4f018bcd67e16a731a91193842a07fe55..8fd4a9ce5d8ce9a8c6649fb2dd5df574c5d88d3d 100644 --- a/arkui/ace_ets_component_four/entry/src/main/ets/test/ImageJsunit.test.ets +++ b/arkui/ace_ets_component_four/entry/src/main/ets/test/ImageJsunit.test.ets @@ -66,12 +66,12 @@ export default function imageJsunit() { let obj = JSON.parse(strJson); console.info("imageTest_0200 obj.$attrs.src is: " + obj.$attrs.src); console.info("imageTest_0200 obj.obj.$type is: " + obj.$type); - var res = obj.$attrs.src.indexOf('RAWFILE/test.png'); + var res = obj.$attrs.src.indexOf('rawfile/test.png'); console.info("imageTest_0200 result is: " + res); var sres = obj.$attrs.src.slice(res, res + 16); console.info("imageTest_0200 slice result is: " + sres); expect(obj.$type).assertEqual('Image'); - expect(obj.$attrs.src.slice(res, res + 16)).assertEqual('RAWFILE/test.png'); + expect(obj.$attrs.src.slice(res, res + 16)).assertEqual('rawfile/test.png'); console.info('imageTest_0200 END'); done(); }); diff --git a/arkui/ace_ets_component_three/entry/src/main/ets/test/ButtonJsunit.test.ets b/arkui/ace_ets_component_three/entry/src/main/ets/test/ButtonJsunit.test.ets index 20eef4a668ce2d3fbd3489fc81823c779626b565..3450568b97d9e245e658c6c6cce5dc442dad2932 100644 --- a/arkui/ace_ets_component_three/entry/src/main/ets/test/ButtonJsunit.test.ets +++ b/arkui/ace_ets_component_three/entry/src/main/ets/test/ButtonJsunit.test.ets @@ -70,7 +70,7 @@ export default function buttonJsunit() { let obj = JSON.parse(strJson); console.info("[testButton02] component obj is: " + JSON.stringify(obj)); expect(obj.$type).assertEqual('Button'); - expect(obj.$attrs.type).assertEqual('ButtonType.Capsule'); + expect(obj.$attrs.type).assertEqual('ButtonType.Normal'); done(); }); diff --git a/arkui/ace_ets_web_dev_three/Test.json b/arkui/ace_ets_web_dev_three/Test.json index bd2f19203a23a4bdc76acf6b1b5135c861e3568b..757a5a6c56634e14680b75efdb71b641cb99eb2f 100644 --- a/arkui/ace_ets_web_dev_three/Test.json +++ b/arkui/ace_ets_web_dev_three/Test.json @@ -6,7 +6,7 @@ "bundle-name": "com.open.harmony.acewebthreetest", "module-name": "phone", "shell-timeout": "600000", - "testcase-timeout": 70000 + "testcase-timeout": "70000" }, "kits": [{ "test-file-name": [ diff --git a/arkui/ace_ets_web_dev_three/entry/src/main/ets/MainAbility/pages/web.ets b/arkui/ace_ets_web_dev_three/entry/src/main/ets/MainAbility/pages/web.ets index 733738bd58a9423d581314c88a8a0554b01c2680..b1efacd6cf3f473afafc52aaf63980ea594f2353 100644 --- a/arkui/ace_ets_web_dev_three/entry/src/main/ets/MainAbility/pages/web.ets +++ b/arkui/ace_ets_web_dev_three/entry/src/main/ets/MainAbility/pages/web.ets @@ -72,7 +72,7 @@ struct Index { case "emitLoadUrl":{ try { setTimeout(()=>{ - this.controller.loadUrl('www.baidu.com'); + this.controller.loadUrl($rawfile("index.html")); setTimeout(()=>{ let title = this.controller.getTitle(); Utils.emitEvent(title,1) @@ -150,7 +150,7 @@ struct Index { this.controller.onInactive(); setTimeout(()=>{ setTimeout(()=>{ - this.controller.loadUrl("file:///data/storage/el1/bundle/phone/resources/rawfile/index.html") + this.controller.loadUrl("resource://rawfile/index.html") },3000) var title4 = this.controller.getTitle(); Utils.emitEvent(title4,7) @@ -263,7 +263,7 @@ struct Index { } case "emitSearchAllAsync":{ try { - this.controller.loadUrl("file:///data/storage/el1/bundle/phone/resources/rawfile/index.html") + this.controller.loadUrl("resource://rawfile/index.html") setTimeout(()=>{ this.controller.searchAllAsync("首页"); },3000) diff --git a/arkui/ace_ets_web_dev_three/entry/src/main/ets/test/Utils.ets b/arkui/ace_ets_web_dev_three/entry/src/main/ets/test/Utils.ets index 1a90ba6aedd9cd4c5662f10bd0f033f6136cb61a..e7eedc7421fadf7558662f1d82589be6af11f058 100644 --- a/arkui/ace_ets_web_dev_three/entry/src/main/ets/test/Utils.ets +++ b/arkui/ace_ets_web_dev_three/entry/src/main/ets/test/Utils.ets @@ -29,9 +29,13 @@ export default class Utils { console.info(`[${testCaseName}] START`); try{ let callBack=(backData)=>{ + try{ console.info(`${testCaseName} get result is:`+JSON.stringify(backData)); expect(backData.data.ACTION).assertEqual(expectedValue); console.info(`[${testCaseName}] END`); + }catch(err){ + console.info(`[${testCaseName}] err:`+JSON.stringify(err)); + } done() } let innerEvent = { @@ -64,10 +68,14 @@ export default class Utils { console.info(`[${testCaseName}] START`); try{ let callBack=(backData)=>{ + try{ console.info(`${testCaseName} get result is:`+JSON.stringify(backData)); expect(backData.data.actualValue).assertLarger(backData.data.expectedValue-100); expect(backData.data.actualValue).assertLess(backData.data.expectedValue-(-100)); console.info(`[${testCaseName}] END`); + }catch(err){ + console.info(`[${testCaseName}] err:`+JSON.stringify(err)); + } done() } let innerEvent = { @@ -101,9 +109,13 @@ export default class Utils { console.info(`[${testCaseName}] START`); try{ let callBack=(backData)=>{ + try{ console.info(`${testCaseName} get result is:`+JSON.stringify(backData)); expect(backData.data.ACTION).assertContain(expectedValue); console.info(`[${testCaseName}] END`); + }catch(err){ + console.info(`[${testCaseName}] err:`+JSON.stringify(err)); + } done() } let innerEvent = { diff --git a/arkui/ace_ets_web_dev_three/entry/src/main/ets/test/WebJsunit.test.ets b/arkui/ace_ets_web_dev_three/entry/src/main/ets/test/WebJsunit.test.ets index 84590803c90186935de4d466783720487fe5a37f..3223204a80f2794df6cbd340d047db37941a354f 100644 --- a/arkui/ace_ets_web_dev_three/entry/src/main/ets/test/WebJsunit.test.ets +++ b/arkui/ace_ets_web_dev_three/entry/src/main/ets/test/WebJsunit.test.ets @@ -51,7 +51,7 @@ export default function webJsunit() { */ it('LoadUrl',0,async function(done){ emitKey="emitLoadData"; - Utils.registerContainEvent("LoadUrl","百度一下,你就知道",1,done); + Utils.registerContainEvent("LoadUrl","index",1,done); sendEventByKey('webcomponent',10,''); }) /* @@ -71,7 +71,7 @@ export default function webJsunit() { */ it('Backward',0,async function(done){ emitKey="emitForward"; - Utils.registerEvent("Backward","百度一下,你就知道",3,done); + Utils.registerEvent("Backward","index",3,done); sendEventByKey('webcomponent',10,''); }) /*