diff --git a/arkui/ace_ets_component_ui/entry/src/main/ets/MainAbility/pages/slider.ets b/arkui/ace_ets_component_ui/entry/src/main/ets/MainAbility/pages/slider.ets index 1586f424b152e28ecd2a2c599419a91550626862..f3da850320096de29c37960326c1540d05dc88be 100644 --- a/arkui/ace_ets_component_ui/entry/src/main/ets/MainAbility/pages/slider.ets +++ b/arkui/ace_ets_component_ui/entry/src/main/ets/MainAbility/pages/slider.ets @@ -206,7 +206,7 @@ struct SliderExample { Text(this.modeT).fontSize(9).fontColor(0xCCCCCC).width('50%').margin(15).key('modeT') Row() { Slider({ - value: this.vInSetValueOne1, + value: this.vInSetValueOne, style: this.style, direction: this.directionT, reverse: this.reverse,// 竖向的Slider默认是上端是min值,下端是max值,因此想要从下往上滑动,需要设置reverse为true @@ -215,7 +215,7 @@ struct SliderExample { step:this.step }).showTips(true) .onChange((value: number, mode: SliderChangeMode) => { - this.vInSetValueOne1 = value + this.vInSetValueOne = value console.info('value:' + value + 'm`ode:' + mode.toString()) }).key('sliderConstructor') @@ -233,7 +233,7 @@ struct SliderExample { Slider().showTips(true) .onChange((value: number, mode: SliderChangeMode) => { - this.vInSetValueOne = value + this.vInSetValueOne1 = value this.modeT = mode.toString() console.info('value:' + value + 'm`ode:' + mode.toString()) }).key('sliderConstructor2') diff --git a/arkui/ace_ets_component_ui/entry/src/main/ets/MainAbility/pages/stepper.ets b/arkui/ace_ets_component_ui/entry/src/main/ets/MainAbility/pages/stepper.ets index 5e68af5818af1f3662cbe7c34baccb69ca0b86d6..5a25eb9bc685af2b9cbe4a40263863e8c9ede5aa 100644 --- a/arkui/ace_ets_component_ui/entry/src/main/ets/MainAbility/pages/stepper.ets +++ b/arkui/ace_ets_component_ui/entry/src/main/ets/MainAbility/pages/stepper.ets @@ -88,7 +88,7 @@ struct StepperExample { // 第二个步骤页 StepperItem() { Column() { - Text('Page Two') + Text('Page Two').key('pageTwo') .itemTextStyle() Button('change status:' + this.secondState) .backgroundColor('#007dFF') 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 7d3508a970c2b2b710a986a9444e6e6505d5bfdd..6eca7be81b1a734d9900117c69d522d94de230f2 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 @@ -143,12 +143,9 @@ export default function GridJsunit() { // Verify onScrollIndex event let grid2 = CommonFunc.getComponentRect('grid2'); let top = grid2.top - let grid2b = CommonFunc.getComponentRect('grid2'); - let bottom = grid2b.bottom - let grid2l = CommonFunc.getComponentRect('grid2'); - let left = grid2l.left - let grid2r = CommonFunc.getComponentRect('grid2'); - let right = grid2r.right + let bottom = grid2.bottom + let left = grid2.left + let right = grid2.right let driver = await UiDriver.create() await driver.swipe(Math.round((right - left) / 2), Math.round(bottom - 10), Math.round((right - left) / 2), Math.round(top + 10)); await driver.swipe(Math.round((right - left) / 2), Math.round(bottom - 10), Math.round((right - left) / 2), Math.round(top + 10)); @@ -166,9 +163,10 @@ export default function GridJsunit() { let button = await driver.findComponent(BY.key('button')); await button.click(); await CommonFunc.sleep(1000); - let button1 = await driver.findComponent(BY.key('button')); - let text3 = await button1.getText(); - expect(text3).assertEqual('clicked'); + let strJson = getInspectorByKey('button'); + let obj = JSON.parse(strJson); + console.info('[GridJsunit_0400] component obj is: ' + obj.$attrs.content); + expect(obj.$attrs.content).assertEqual('clicked'); console.info('[GridJsunit_0400] END'); done(); }); 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 1836627467f9e8bc73d142112b8a467bb124ca6d..53beff716e5a3ca7da3eefa7d442adb5254f3241 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,32 +120,36 @@ 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(); + console.info('stepperJsunit_0600 button click succ'); + await CommonFunc.sleep(1000); + // 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); let button2 = await driver.findComponent(BY.text('下一步')); await button2.click(); + console.info('stepperJsunit_0600 button2 click succ'); await CommonFunc.sleep(1000); - let textThree = await driver.findComponent(BY.text('Page Three')); - let txt = await textThree.getText(); - console.info('stepperJsunit_0700 component obj is: ' + txt); - expect(txt).assertEqual('Page Three'); + let strJson = getInspectorByKey('pageThree'); + let obj = JSON.parse(strJson); + console.info('stepperJsunit_0600 component obj is: ' + obj.$attrs.content); + expect(obj.$attrs.content).assertEqual('Page Three'); // test the previous let button3 = await driver.findComponent(BY.text('返回')); await button3.click(); - let textTwo = await driver.findComponent(BY.text('Page Two')); - let txtT = await textTwo.getText(); - console.info('stepperJsunit_0600 component obj is: ' + txtT); - expect(txtT).assertEqual('Page Two'); + await CommonFunc.sleep(1000); + console.info('stepperJsunit_0600 button3 click succ'); + let strJson1 = getInspectorByKey('pageTwo'); + let obj1 = JSON.parse(strJson1); + console.info('stepperJsunit_0600 component obj1 is: ' + obj1.$attrs.content); + expect(obj1.$attrs.content).assertEqual('Page Two'); done(); }); @@ -157,17 +161,20 @@ export default function stepperJsunit() { await CommonFunc.sleep(2000); let button2 = await driver.findComponent(BY.text('下一步')); await button2.click(); + console.info('stepperJsunit_0700 button2 click succ'); await CommonFunc.sleep(2000); let button3 = await driver.findComponent(BY.text('下一步')); await button3.click(); + console.info('stepperJsunit_0700 button3 click succ'); await CommonFunc.sleep(2000); let button4 = await driver.findComponent(BY.text('开始')); await button4.click(); + console.info('stepperJsunit_0700 button4 click succ'); 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 Four'); + let strJson = getInspectorByKey('pageFour'); + let obj = JSON.parse(strJson); + console.info('stepperJsunit_0700 component obj is: ' + obj.$attrs.content); + expect(obj.$attrs.content).assertEqual('Page Four'); done(); }); @@ -179,10 +186,10 @@ export default function stepperJsunit() { let button = await driver.findComponent(BY.text('返回')); await button.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); - expect(txtT).assertEqual('Page Three'); + let strJson = getInspectorByKey('pageThree'); + let obj = JSON.parse(strJson); + console.info('stepperJsunit_0800 component obj is: ' + obj.$attrs.content); + expect(obj.$attrs.content).assertEqual('Page Three'); done(); }); })