From 0478596d4aca047c3b11b6ebcfd460acf5b95bad Mon Sep 17 00:00:00 2001 From: wang-xupeng2 Date: Sat, 1 Apr 2023 20:09:06 +0800 Subject: [PATCH] update textTwo testcase Signed-off-by: wang-xupeng2 --- .../src/main/ets/test/textTwoJsunit.test.ets | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/arkui/ace_ets_component_ui/entry/src/main/ets/test/textTwoJsunit.test.ets b/arkui/ace_ets_component_ui/entry/src/main/ets/test/textTwoJsunit.test.ets index e37625c31..383dc62cf 100644 --- a/arkui/ace_ets_component_ui/entry/src/main/ets/test/textTwoJsunit.test.ets +++ b/arkui/ace_ets_component_ui/entry/src/main/ets/test/textTwoJsunit.test.ets @@ -50,29 +50,32 @@ export default function textTwoJsunit() { let obj = JSON.parse(strJson); console.info('textTwoJsunit_0100 component obj is: ' + obj.$attrs.decoration); expect(obj.$attrs.decoration).assertEqual('{"type":"TextDecorationType.LineThrough","color":"#FFFFEEAF"}'); + await CommonFunc.sleep(1000); // to modify the atrribute globalThis.value.message.notify({name:'type',value:TextDecorationType.Overline}) - await CommonFunc.sleep(1000); - globalThis.value.message.notify({name:'color',value:Color.Green}) await CommonFunc.sleep(200); + globalThis.value.message.notify({name:'color',value:Color.Green}) + await CommonFunc.sleep(1000); let strJson2 = getInspectorByKey('text1'); let obj2 = JSON.parse(strJson2); console.info('textTwoJsunit_0100 component obj2 is: ' + obj2.$attrs.decoration); expect(obj2.$attrs.decoration).assertEqual('{"type":"TextDecorationType.Overline","color":"#FF008000"}'); + await CommonFunc.sleep(1000); globalThis.value.message.notify({name:'type',value:TextDecorationType.Underline}) - await CommonFunc.sleep(1000); - globalThis.value.message.notify({name:'color',value:'rgb(238, 130, 238)'}) await CommonFunc.sleep(200); + globalThis.value.message.notify({name:'color',value:'rgb(238, 130, 238)'}) + await CommonFunc.sleep(1000); let strJson3 = getInspectorByKey('text1'); let obj3 = JSON.parse(strJson3); console.info('textTwoJsunit_0100 component obj3 is: ' + obj3.$attrs.decoration); expect(obj3.$attrs.decoration).assertEqual('{"type":"TextDecorationType.Underline","color":"#FFEE82EE"}'); + await CommonFunc.sleep(1000); globalThis.value.message.notify({name:'type',value:TextDecorationType.None}) - await CommonFunc.sleep(1000); - globalThis.value.message.notify({name:'color',value:'#FFACEEEE'}) await CommonFunc.sleep(200); + globalThis.value.message.notify({name:'color',value:'#FFACEEEE'}) + await CommonFunc.sleep(1000); let strJson4 = getInspectorByKey('text1'); let obj4 = JSON.parse(strJson4); console.info('textTwoJsunit_0100 component obj4 is: ' + obj4.$attrs.decoration); @@ -85,9 +88,9 @@ export default function textTwoJsunit() { // test the illegal value of decoration await CommonFunc.sleep(1000); globalThis.value.message.notify({name:'type',value:undefined}) - await CommonFunc.sleep(1000); + await CommonFunc.sleep(500); globalThis.value.message.notify({name:'color',value:undefined}) - await CommonFunc.sleep(2000); + await CommonFunc.sleep(1000); let strJson2 = getInspectorByKey('text1'); let obj2 = JSON.parse(strJson2); console.info('textTwoJsunit_0200 component obj2 is: ' + obj2.$attrs.decoration); -- GitLab