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 e37625c313ea93fdd4c7fe7ef81a54c9eb2c24b1..383dc62cfc9ada00a53beb1829c13bc30bbba11b 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);