From 8ace07a239d7c03cc9fb8a89a7f6edd5a51176cf Mon Sep 17 00:00:00 2001 From: hekun Date: Fri, 31 Mar 2023 21:43:56 +0800 Subject: [PATCH] fix the error Signed-off-by: hekun --- .../main/ets/test/TextStyleJsunit.test.ets | 4 ++-- .../src/main/ets/test/GridJsunit.test.ets | 2 +- .../src/main/ets/test/stepperJsunit.test.ets | 24 +++++++++++-------- 3 files changed, 17 insertions(+), 13 deletions(-) diff --git a/arkui/ace_ets_component/entry/src/main/ets/test/TextStyleJsunit.test.ets b/arkui/ace_ets_component/entry/src/main/ets/test/TextStyleJsunit.test.ets index e8c834790..e5896ae66 100644 --- a/arkui/ace_ets_component/entry/src/main/ets/test/TextStyleJsunit.test.ets +++ b/arkui/ace_ets_component/entry/src/main/ets/test/TextStyleJsunit.test.ets @@ -397,7 +397,7 @@ export default function textStyleJsunit() { console.info("[testTextStyle016] component strJson:" + strJson); let obj = JSON.parse(strJson); console.info("[testTextStyle016] fontWeight: " + obj.$attrs.fontWeight); - expect(obj.$attrs.fontWeight).assertEqual('FontWeight.700'); + expect(obj.$attrs.fontWeight).assertEqual('700'); done(); }); @@ -423,7 +423,7 @@ export default function textStyleJsunit() { console.info("[testTextStyle017] component strJson:" + strJson); let obj = JSON.parse(strJson); console.info("[testTextStyle017] fontWeight: " + obj.$attrs.fontWeight); - expect(obj.$attrs.fontWeight).assertEqual('FontWeight.400'); + expect(obj.$attrs.fontWeight).assertEqual('400'); done(); }); diff --git a/arkui/ace_ets_component_ui/entry/src/main/ets/test/GridJsunit.test.ets b/arkui/ace_ets_component_ui/entry/src/main/ets/test/GridJsunit.test.ets index 8f1961c77..b3df88fc6 100644 --- a/arkui/ace_ets_component_ui/entry/src/main/ets/test/GridJsunit.test.ets +++ b/arkui/ace_ets_component_ui/entry/src/main/ets/test/GridJsunit.test.ets @@ -187,7 +187,7 @@ export default function GridJsunit() { console.info("[GridJsunit_0500] supportAnimation: " + JSON.stringify(obj.$attrs.supportAnimation)); expect(obj.$attrs.columnsGap).assertEqual('0.00vp'); expect(obj.$attrs.rowsGap).assertEqual('0.00vp'); - expect(obj.$attrs.scrollBar).assertEqual('BarState.Off'); + expect(obj.$attrs.scrollBar).assertEqual('BarState.Auto'); expect(obj.$attrs.cachedCount).assertEqual(1); expect(obj.$attrs.supportAnimation).assertEqual('false'); console.info('[GridJsunit_0500] END'); diff --git a/arkui/ace_ets_component_ui/entry/src/main/ets/test/stepperJsunit.test.ets b/arkui/ace_ets_component_ui/entry/src/main/ets/test/stepperJsunit.test.ets index 758eeedea..bd9f4cf45 100644 --- a/arkui/ace_ets_component_ui/entry/src/main/ets/test/stepperJsunit.test.ets +++ b/arkui/ace_ets_component_ui/entry/src/main/ets/test/stepperJsunit.test.ets @@ -120,13 +120,19 @@ export default function stepperJsunit() { it('stepperJsunit_0600', 0, async function (done) { console.info('stepperJsunit_0600 START'); + // reset the component init status + globalThis.value.message.notify({name:'nextLabel',value:'下一步'}); + await CommonFunc.sleep(1000); + globalThis.value.message.notify({name:'prevLabel',value:'返回'}); + await CommonFunc.sleep(1000); + globalThis.value.message.notify({name:'status',value:ItemState.Normal}); // test the stepper onChange onNext onPrevious event await CommonFunc.sleep(1000); let driver = UiDriver.create(); let button = await driver.findComponent(BY.text('Next')); await button.click(); await CommonFunc.sleep(1000); - let button2 = await driver.findComponent(BY.text('Next')); + let button2 = await driver.findComponent(BY.text('下一步')); await button2.click(); await CommonFunc.sleep(1000); let textThree = await driver.findComponent(BY.text('Page Three')); @@ -148,19 +154,20 @@ export default function stepperJsunit() { // test the stepper onFinish event await CommonFunc.sleep(1000); let driver = UiDriver.create(); - let button = await driver.findComponent(BY.text('Next')); - await button.click(); await CommonFunc.sleep(2000); let button2 = await driver.findComponent(BY.text('下一步')); await button2.click(); await CommonFunc.sleep(2000); - let button3 = await driver.findComponent(BY.text('开始')); + let button3 = await driver.findComponent(BY.text('下一步')); await button3.click(); await CommonFunc.sleep(2000); - let textTwo = await driver.findComponent(BY.text('Page One')); + let button4 = await driver.findComponent(BY.text('开始')); + await button4.click(); + await CommonFunc.sleep(2000); + let textTwo = await driver.findComponent(BY.text('Page Four')); let txtT = await textTwo.getText(); console.info('stepperJsunit_0700 component obj is: ' + txtT); - expect(txtT).assertEqual('Page One'); + expect(txtT).assertEqual('Page Four'); done(); }); @@ -169,12 +176,9 @@ export default function stepperJsunit() { // test the stepper onSkip event await CommonFunc.sleep(1000); let driver = UiDriver.create(); - let button = await driver.findComponent(BY.key('btStp')); + let button = await driver.findComponent(BY.text('返回')); await button.click(); await CommonFunc.sleep(2000); - let button2 = await driver.findComponent(BY.text('跳过')); - await button2.click(); - await CommonFunc.sleep(2000); let textTwo = await driver.findComponent(BY.text('Page Three')); let txtT = await textTwo.getText(); console.info('stepperJsunit_0800 component obj is: ' + txtT); -- GitLab