From 5b9957a30095091f1b7833221be1f575abc7e8b6 Mon Sep 17 00:00:00 2001 From: ywx1211260 Date: Thu, 12 Jan 2023 20:36:07 +0800 Subject: [PATCH] revise_file Signed-off-by: ywx1211260 --- .../entry/src/main/ets/test/ImageJsunit.test.ets | 4 ++-- .../entry/src/main/ets/test/ButtonJsunit.test.ets | 2 +- .../entry/src/main/ets/MainAbility/pages/web.ets | 6 +++--- .../entry/src/main/ets/test/Utils.ets | 12 ++++++++++++ .../entry/src/main/ets/test/WebJsunit.test.ets | 4 ++-- 5 files changed, 20 insertions(+), 8 deletions(-) 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 3b298bc4f..8fd4a9ce5 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 20eef4a66..3450568b9 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/entry/src/main/ets/MainAbility/pages/web.ets b/arkui/ace_ets_web_dev_three/entry/src/main/ets/MainAbility/pages/web.ets index e41915a0b..89e54c67e 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 1a90ba6ae..e7eedc742 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 84590803c..3223204a8 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,''); }) /* -- GitLab