diff --git a/arkui/ace_ets_component_three/entry/src/main/ets/MainAbility/pages/shape.ets b/arkui/ace_ets_component_three/entry/src/main/ets/MainAbility/pages/shape.ets index 62ff1c185d4755a63582e1444cfe2c867f3b07a4..caf822a9c25a898cd309b6fcddb415c078771439 100644 --- a/arkui/ace_ets_component_three/entry/src/main/ets/MainAbility/pages/shape.ets +++ b/arkui/ace_ets_component_three/entry/src/main/ets/MainAbility/pages/shape.ets @@ -41,7 +41,7 @@ struct ShapeExample { this.strokeLineJoin = eventData.data.strokeLineJoin; } if (eventData.data.strokeMiterLimit != null) { - this.strokeMiterLimit = parseInt(eventData.data.strokeMiterLimit); + this.strokeMiterLimit = eventData.data.strokeMiterLimit; } if (eventData.data.strokeOpacity != null) { this.strokeOpacity = parseInt(eventData.data.strokeOpacity); diff --git a/arkui/ace_ets_component_three/entry/src/main/ets/test/ShapeJsunit.test.ets b/arkui/ace_ets_component_three/entry/src/main/ets/test/ShapeJsunit.test.ets index 1146c787a6917e6a772ab776d45e1613668e6beb..e5f0dbf4dcabf7c480ac39fdbfecb1e227433f26 100644 --- a/arkui/ace_ets_component_three/entry/src/main/ets/test/ShapeJsunit.test.ets +++ b/arkui/ace_ets_component_three/entry/src/main/ets/test/ShapeJsunit.test.ets @@ -400,7 +400,59 @@ export default function shapeJsunit() { var strJson = getInspectorByKey('shape'); var obj = JSON.parse(strJson); console.info("shapeTest_2100 component obj is: " + JSON.stringify(obj.$attrs.strokeMiterLimit)); - expect(obj.$attrs.strokeMiterLimit).assertEqual('4.000000'); + expect(parseInt(obj.$attrs.strokeMiterLimit)).assertEqual(4); + done(); + }); + + it('shapeTest_3200', 0, async function (done) { + console.info('shapeTest_3200 START'); + await Utils.sleep(1000); + try { + var eventData = { + data: { + "strokeMiterLimit": 1, + } + } + var innerEvent = { + eventId: 192, + priority: events_emitter.EventPriority.LOW + } + console.info("shapeTest_3200 start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.log("shapeTest_3200 change component color error: " + err.message); + } + await Utils.sleep(2000); + var strJson = getInspectorByKey('shape'); + var obj = JSON.parse(strJson); + console.info("shapeTest_3200 component obj is: " + JSON.stringify(obj.$attrs.strokeMiterLimit)); + expect(parseInt(obj.$attrs.strokeMiterLimit)).assertEqual(1); + done(); + }); + + it('shapeTest_3300', 0, async function (done) { + console.info('shapeTest_3300 START'); + await Utils.sleep(1000); + try { + var eventData = { + data: { + "strokeMiterLimit": 0.5, + } + } + var innerEvent = { + eventId: 192, + priority: events_emitter.EventPriority.LOW + } + console.info("shapeTest_3300 start to publish emit"); + events_emitter.emit(innerEvent, eventData); + } catch (err) { + console.log("shapeTest_3300 change component color error: " + err.message); + } + await Utils.sleep(2000); + var strJson = getInspectorByKey('shape'); + var obj = JSON.parse(strJson); + console.info("shapeTest_3300 component obj is: " + JSON.stringify(obj.$attrs.strokeMiterLimit)); + expect(parseInt(obj.$attrs.strokeMiterLimit)).assertEqual(1); done(); }); @@ -410,7 +462,7 @@ export default function shapeJsunit() { try { var eventData = { data: { - "strokeMiterLimit": 'aaa11111', + "strokeMiterLimit": '11111', } } var innerEvent = { @@ -426,7 +478,7 @@ export default function shapeJsunit() { var strJson = getInspectorByKey('shape'); var obj = JSON.parse(strJson); console.info("shapeTest_2200 component obj is: " + JSON.stringify(obj.$attrs.strokeMiterLimit)); - expect(obj.$attrs.strokeMiterLimit).assertEqual('4.000000'); + expect(parseInt(obj.$attrs.strokeMiterLimit)).assertEqual(11111); done(); }); @@ -478,7 +530,7 @@ export default function shapeJsunit() { var strJson = getInspectorByKey('shape'); var obj = JSON.parse(strJson); console.info("shapeTest_2000 component obj is: " + JSON.stringify(obj.$attrs.strokeMiterLimit)); - expect(obj.$attrs.strokeMiterLimit).assertEqual('5.000000'); + expect(obj.$attrs.strokeMiterLimit).assertEqual('4.000000'); done(); }); 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 d9d34d5d96370652153528b2604f2b2944ebff82..1586f424b152e28ecd2a2c599419a91550626862 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 @@ -29,6 +29,7 @@ struct SliderExample { @State inSetValueTwo: number = 40 @State vOutSetValueOne: number = 40 @State vInSetValueOne: number = 40 + @State vInSetValueOne1: number = 40 @State vOutSetValueTwo: number = 40 @State vInSetValueTwo: number = 40 @State blockColor: string = "#191970" @@ -205,7 +206,7 @@ struct SliderExample { Text(this.modeT).fontSize(9).fontColor(0xCCCCCC).width('50%').margin(15).key('modeT') Row() { Slider({ - value: this.vInSetValueOne, + value: this.vInSetValueOne1, style: this.style, direction: this.directionT, reverse: this.reverse,// 竖向的Slider默认是上端是min值,下端是max值,因此想要从下往上滑动,需要设置reverse为true @@ -214,7 +215,7 @@ struct SliderExample { step:this.step }).showTips(true) .onChange((value: number, mode: SliderChangeMode) => { - this.vInSetValueOne = value + this.vInSetValueOne1 = value console.info('value:' + value + 'm`ode:' + mode.toString()) }).key('sliderConstructor') 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 8b6e23961896dd50823f6cb43534861225baecaf..5e68af5818af1f3662cbe7c34baccb69ca0b86d6 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 @@ -103,7 +103,7 @@ struct StepperExample { // 第三个步骤页 StepperItem() { Column() { - Text('Page Three') + Text('Page Three').key('pageThree') .itemTextStyle() Button('change status:' + this.thirdState) .backgroundColor('#007dFF') @@ -116,7 +116,7 @@ struct StepperExample { // 第四个步骤页 StepperItem() { Column() { - Text('Page Four') + Text('Page Four').key('pageFour') .itemTextStyle() }.itemStyle() } 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 b3df88fc6dfabc553be3113de0a4ed5910bffa2f..7d3508a970c2b2b710a986a9444e6e6505d5bfdd 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 @@ -61,7 +61,7 @@ export default function GridJsunit() { console.info("[GridJsunit_0100] component obj2 is: " + JSON.stringify(obj2)); expect(obj2.$attrs.scrollBar).assertEqual('BarState.Off'); expect(obj2.$attrs.scrollBarColor).assertEqual('#FF808080'); - expect(obj2.$attrs.scrollBarWidth).assertEqual('20.00px'); + expect(obj2.$attrs.scrollBarWidth).assertEqual('20.00vp'); console.info('[GridJsunit_0100] END'); done(); }); @@ -95,7 +95,7 @@ export default function GridJsunit() { let obj2 = JSON.parse(strJson2); console.info("[GridJsunit_0200] component obj2 is: " + JSON.stringify(obj2)); expect(obj2.$attrs.scrollBarColor).assertEqual('#FF000000'); - expect(obj2.$attrs.scrollBarWidth).assertEqual('30.00px'); + expect(obj2.$attrs.scrollBarWidth).assertEqual('30.00vp'); console.info('[GridJsunit_0200] END'); done(); }); @@ -123,14 +123,14 @@ export default function GridJsunit() { console.info("[GridJsunit_0300] component obj is: " + JSON.stringify(obj)); expect(obj.$attrs.columnsGap).assertEqual('0.00vp'); expect(obj.$attrs.rowsGap).assertEqual('0.00vp'); - expect(obj.$attrs.cachedCount).assertEqual(0); + expect(obj.$attrs.cachedCount).assertEqual(1); await CommonFunc.sleep(1000); let strJson2 = getInspectorByKey('grid2'); let obj2 = JSON.parse(strJson2); console.info("[GridJsunit_0300] component obj2 is: " + JSON.stringify(obj2)); expect(obj2.$attrs.scrollBar).assertEqual('BarState.Off'); expect(obj2.$attrs.scrollBarColor).assertEqual('#FF000000'); - expect(obj2.$attrs.scrollBarWidth).assertEqual('-10.00px'); + expect(obj2.$attrs.scrollBarWidth).assertEqual('4.00vp'); console.info('[GridJsunit_0300] END'); done(); }); @@ -224,10 +224,10 @@ export default function GridJsunit() { globalThis.value.message.notify({name:'rowsTemplate',value:''}) await CommonFunc.sleep(1000); let gridItem1 = CommonFunc.getComponentRect('0'); - let bottom = gridItem1.bottom + let left1 = gridItem1.left let gridItem2 = CommonFunc.getComponentRect('4'); - let top = gridItem2.top - expect(bottom).assertEqual(top); + let left2 = gridItem2.left + expect(left1).assertEqual(left2); console.info('[GridJsunit_0700] END'); done(); }); @@ -241,10 +241,10 @@ export default function GridJsunit() { await CommonFunc.sleep(1000); let driver = await UiDriver.create() let gridItem1 = CommonFunc.getComponentRect('0'); - let right = gridItem1.right + let top1 = gridItem1.top let gridItem2 = CommonFunc.getComponentRect('4'); - let left = gridItem2.left - expect(right).assertEqual(left); + let top2 = gridItem2.top + expect(top1).assertEqual(parseInt(top2)); console.info('[GridJsunit_0800] END'); done(); }); diff --git a/arkui/ace_ets_component_ui/entry/src/main/ets/test/TextInputJsunit.test.ets b/arkui/ace_ets_component_ui/entry/src/main/ets/test/TextInputJsunit.test.ets index 4a49a62bad7fe522f1829a4f94169c75b3b8036a..f7dd6ea33a63d070614ac2b776ee3440dff8879f 100644 --- a/arkui/ace_ets_component_ui/entry/src/main/ets/test/TextInputJsunit.test.ets +++ b/arkui/ace_ets_component_ui/entry/src/main/ets/test/TextInputJsunit.test.ets @@ -267,7 +267,7 @@ export default function TextInputJsunit() { console.info("[TextInputJsunit_0500] textAlign: " + JSON.stringify(obj.$attrs.textAlign)); expect(obj.$attrs.placeholder).assertEqual(''); expect(obj.$attrs.type).assertEqual('InputType.Normal'); - expect(obj.$attrs.placeholderColor).assertEqual('#FF008000'); + expect(obj.$attrs.placeholderColor).assertEqual('#FF000000'); expect(obj.$attrs.placeholderFont).assertEqual('{"style":"FontStyle.Normal","size":"18.00fp","weight":"500","fontFamily":"sans-serif"}'); expect(obj.$attrs.enterKeyType).assertEqual('EnterKeyType.Done'); expect(obj.$attrs.caretColor).assertEqual('#FF00007B'); diff --git a/arkui/ace_ets_component_ui/entry/src/main/ets/test/sliderJsunit.test.ets b/arkui/ace_ets_component_ui/entry/src/main/ets/test/sliderJsunit.test.ets index fb1efd7d1283495a4d0a3c02ecfd5106d02005b4..061b31d7979df42db70978ff005b0569075ee5dc 100644 --- a/arkui/ace_ets_component_ui/entry/src/main/ets/test/sliderJsunit.test.ets +++ b/arkui/ace_ets_component_ui/entry/src/main/ets/test/sliderJsunit.test.ets @@ -204,7 +204,7 @@ export default function sliderJsunit() { let strJson1 = getInspectorByKey('modeT'); let obj1 = JSON.parse(strJson1); console.info("[sliderJsunit_0800] obj1: " + JSON.stringify(obj1)); - expect(obj1.$attrs.content).assertEqual('mode'); + expect(obj1.$attrs.content).assertEqual('2'); done(); });