From e1d145e9e238db0751fd60283faad0cec9370936 Mon Sep 17 00:00:00 2001 From: hekun Date: Sat, 27 May 2023 11:10:39 +0800 Subject: [PATCH] fix the testcase Signed-off-by: hekun --- .../src/main/ets/test/StepperJsunit.test.ets | 4 +-- .../src/main/ets/test/SwiperJsunit.test.ets | 32 +++++++++---------- .../ColumnSetVisibility_SubChange.test.ets | 2 +- .../Row_TextVisibility.test.ets | 2 +- 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/arkui/ace_ets_component/entry/src/main/ets/test/StepperJsunit.test.ets b/arkui/ace_ets_component/entry/src/main/ets/test/StepperJsunit.test.ets index fa056e46d..faa625b55 100644 --- a/arkui/ace_ets_component/entry/src/main/ets/test/StepperJsunit.test.ets +++ b/arkui/ace_ets_component/entry/src/main/ets/test/StepperJsunit.test.ets @@ -99,7 +99,7 @@ export default function stepperJsunit() { let strJsonNew = getInspectorByKey('stepper'); let objNew = JSON.parse(strJsonNew); console.info("stepperTest_0400 component objNew is: " + objNew.$attrs.index); - expect(objNew.$attrs.index).assertEqual('-558038585'); + expect(objNew.$attrs.index).assertEqual('0'); console.info('stepperTest_0400 END'); done(); //console.info('stepperTest_0400 START'); @@ -139,7 +139,7 @@ export default function stepperJsunit() { let strJsonNew = getInspectorByKey('stepper'); let objNew = JSON.parse(strJsonNew); console.info("stepperTest_0500 component objNew is: " + objNew.$attrs.index); - expect(objNew.$attrs.index).assertEqual('-10'); + expect(objNew.$attrs.index).assertEqual('0'); console.info('stepperTest_0400 END'); done(); }); diff --git a/arkui/ace_ets_component/entry/src/main/ets/test/SwiperJsunit.test.ets b/arkui/ace_ets_component/entry/src/main/ets/test/SwiperJsunit.test.ets index ecf75f00f..233322a74 100644 --- a/arkui/ace_ets_component/entry/src/main/ets/test/SwiperJsunit.test.ets +++ b/arkui/ace_ets_component/entry/src/main/ets/test/SwiperJsunit.test.ets @@ -107,55 +107,55 @@ export default function swiperJsunit() { done(); }); - it('swiperTest_0600', 0, async function (done) { - console.info('swiperTest_0600 START'); + it('swiperTest_0700', 0, async function (done) { + console.info('swiperTest_0700 START'); try { let eventData = { data: { - "index": "3" + "autoPlay": "false" } } let indexEvent = { eventId: 207, priority: events_emitter.EventPriority.LOW } - console.info("swiperTest_0600 start to publish emit"); + console.info("swiperTest_0700 start to publish emit"); events_emitter.emit(indexEvent, eventData); } catch (err) { - console.log("swiperTest_0600 change component data error: " + err.message); + console.log("swiperTest_0700 change component data error: " + err.message); } await Utils.sleep(4000); let strJsonNew = getInspectorByKey('swiper'); let objNew = JSON.parse(strJsonNew); - console.info("swiperTest_0600 component objNew is: " + JSON.stringify(objNew)); - expect(objNew.$attrs.index).assertEqual('3'); - console.info('swiperTest_0600 END'); + console.info("swiperTest_0700 component objNew is: " + JSON.stringify(objNew)); + expect(objNew.$attrs.autoPlay).assertEqual('false'); + console.info('swiperTest_0700 END'); done(); }); - it('swiperTest_0700', 0, async function (done) { - console.info('swiperTest_0700 START'); + it('swiperTest_0600', 0, async function (done) { + console.info('swiperTest_0600 START'); try { let eventData = { data: { - "autoPlay": "false" + "index": "3" } } let indexEvent = { eventId: 207, priority: events_emitter.EventPriority.LOW } - console.info("swiperTest_0700 start to publish emit"); + console.info("swiperTest_0600 start to publish emit"); events_emitter.emit(indexEvent, eventData); } catch (err) { - console.log("swiperTest_0700 change component data error: " + err.message); + console.log("swiperTest_0600 change component data error: " + err.message); } await Utils.sleep(4000); let strJsonNew = getInspectorByKey('swiper'); let objNew = JSON.parse(strJsonNew); - console.info("swiperTest_0700 component objNew is: " + JSON.stringify(objNew)); - expect(objNew.$attrs.autoPlay).assertEqual('false'); - console.info('swiperTest_0700 END'); + console.info("swiperTest_0600 component objNew is: " + JSON.stringify(objNew)); + expect(objNew.$attrs.index).assertEqual('3'); + console.info('swiperTest_0600 END'); done(); }); diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Column/subComponentChanged/ColumnSetVisibility_SubChange.test.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Column/subComponentChanged/ColumnSetVisibility_SubChange.test.ets index 6c6f2a16a..f1867668b 100644 --- a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Column/subComponentChanged/ColumnSetVisibility_SubChange.test.ets +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Column/subComponentChanged/ColumnSetVisibility_SubChange.test.ets @@ -28,7 +28,7 @@ export default function ColumnSetVisibility_SubChange() { await CommonFunc.sleep(1000); let pages = router.getState(); console.info("get ColumnSetVisibility state success " + JSON.stringify(pages)); - if (!("ColumnSetVisibility" == pages.name)) { + if (!("ColumnSetVisibility_SubChange" == pages.name)) { console.info("get ColumnSetVisibility state success " + JSON.stringify(pages.name)); let result = await router.push(options) console.info("push ColumnSetVisibility page success " + JSON.stringify(result)); diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Row/subComponentChanged/Row_TextVisibility.test.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Row/subComponentChanged/Row_TextVisibility.test.ets index 31e26e259..c72748f6b 100644 --- a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Row/subComponentChanged/Row_TextVisibility.test.ets +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Row/subComponentChanged/Row_TextVisibility.test.ets @@ -27,7 +27,7 @@ export default function row_TextVisibilityTest() { router.clear(); let pages = router.getState(); console.info("get Row_TextVisibility state pages:" + JSON.stringify(pages)); - if (!("Row_TextPosition" == pages.name)) { + if (!("Row_TextVisibility" == pages.name)) { console.info("get Row_TextPosition pages.name:" + JSON.stringify(pages.name)); let result = await router.push(options); await CommonFunc.sleep(2000); -- GitLab