diff --git a/arkui/ace_ets_component_ui/entry/src/main/ets/MainAbility/pages/TextInputPage.ets b/arkui/ace_ets_component_ui/entry/src/main/ets/MainAbility/pages/TextInputPage.ets index 0fd8acc4017e3136e3ad675cc7f79d8ba5d6c18a..8adedf5f1f659189462a396463ff2a97e02c10d7 100644 --- a/arkui/ace_ets_component_ui/entry/src/main/ets/MainAbility/pages/TextInputPage.ets +++ b/arkui/ace_ets_component_ui/entry/src/main/ets/MainAbility/pages/TextInputPage.ets @@ -26,7 +26,7 @@ struct TextInputPage { @State maxLength: number = 10 @State copyOption: CopyOptions = CopyOptions.None @State showPasswordIcon: boolean = false - @State style: TextInputStyle = TextInputStyle.Inline + @State style: TextInputStyle = TextInputStyle.Default @State textAlign: TextAlign = TextAlign.Center @State text: string = 'onChange' @State onSubmit: string = '' @@ -163,7 +163,7 @@ struct TextInputPage { .style(TextInputStyle.Inline) Text('onSubmit:' + this.onSubmit).fontSize(20).margin(10).key('submit') Text('onEditChange:' + this.onEditChange).fontSize(20).margin(10).key('editChange') - Text('onCopy:' + this.onCopy).fontSize(20).margin(10).id('copy') + Text('onCopy:' + this.onCopy).fontSize(20).margin(10).key('copy') Text('onCut:' + this.onCut).fontSize(20).margin(10).key('cut') Text('onPaste:' + this.onPaste).fontSize(20).margin(10).key('paste') }.width('100%') diff --git a/arkui/ace_ets_component_ui/entry/src/main/ets/MainAbility/pages/imageAnimator.ets b/arkui/ace_ets_component_ui/entry/src/main/ets/MainAbility/pages/imageAnimator.ets index 9d430bd263d4674f72f1eeab40db8fe014e6c613..7d3f4c381cb1b30c6921ceda757e3d521f9c4d5e 100644 --- a/arkui/ace_ets_component_ui/entry/src/main/ets/MainAbility/pages/imageAnimator.ets +++ b/arkui/ace_ets_component_ui/entry/src/main/ets/MainAbility/pages/imageAnimator.ets @@ -56,24 +56,12 @@ struct ImageAnimatorExample { if (message.name == 'fixedSize') { this.fixedSize = message.value } - if (message.fillMode == 'fillMode') { + if (message.name == 'fillMode') { this.fillMode = message.value } - if (message.duration == 'duration') { + if (message.name == 'duration') { this.duration = message.value } - if (message.widthT == 'widthT') { - this.widthT = message.value - } - if (message.heightT == 'heighT') { - this.heightT = message.value - } - if (message.top == 'top') { - this.top = message.value - } - if (message.left == 'left') { - this.left = message.value - } } this.messageManager.registerCallback(callback) } diff --git a/arkui/ace_ets_component_ui/entry/src/main/ets/MainAbility/pages/imageThree.ets b/arkui/ace_ets_component_ui/entry/src/main/ets/MainAbility/pages/imageThree.ets index 6394e117e4c220174fba0e06bc0285d35b64bf1d..d0c7973a292a22ddf519333cdde809dbd2724a04 100644 --- a/arkui/ace_ets_component_ui/entry/src/main/ets/MainAbility/pages/imageThree.ets +++ b/arkui/ace_ets_component_ui/entry/src/main/ets/MainAbility/pages/imageThree.ets @@ -24,9 +24,11 @@ struct ImageExample3 { private on2off: Resource = $rawfile('bm.jpg') private off2on: Resource = $rawfile('test3.png') @State src: Resource = this.on - @State m1:string = "xx" - @State m2:string = "x" - @State name:string = "tt3.png" + @State m1:string = "init" + @State m2:string = "init" + @State m3:string = "init" + @State m4:string = "init" + @State imageName:string = "img1.png" messageManager:MessageManager = new MessageManager() @@ -37,8 +39,8 @@ struct ImageExample3 { } let callback:Callback = (message:any) => { console.error('message = ' + message.name + "--" + message.value) - if (message.name == 'name') { - this.name = message.value + if (message.name == 'imageName') { + this.imageName = message.value } } this.messageManager.registerCallback(callback) @@ -49,9 +51,9 @@ struct ImageExample3 { Column() { Row({ space: 20 }) { Column() { - Image($rawfile(this.name)) + Image($rawfile(this.imageName)) .alt($rawfile('img2.png')) - .key('image2') + .key('image1') .sourceSize({ width: 900, height: 900 @@ -66,37 +68,40 @@ struct ImageExample3 { }) .onError(() => { console.log('load image fail') - this.m1 = "error" + this.m2 = "error" }) .overlay('\nwidth: ' + String(this.widthValue) + ' height: ' + String(this.heightValue), { align: Alignment.Bottom, offset: { x: 0, y: 20 } }) - Text(this.m1).margin({top:40}).key('text1') - Text(this.m2).margin({top:40}).key('text2') - } + Text(this.m1).margin({top:40}).key('complete') + Text(this.m2).margin({top:40}).key('error') + Text(this.m3).margin({top:40}).key('click') + Text(this.m4).margin({top:40}).key('Finish') + // 为图片添加点击事件,点击完成后加载特定图片。 Image(this.src) .width(120).height(120) .onClick(() => { if (this.src == this.on || this.src == this.off2on) { this.src = this.on2off - this.m1 = "click" + this.m3 = "click" } else { this.src = this.off2on - this.m1 = "click" + this.m3 = "click" } - }).key('igc') + }).key('image2') .onFinish(() => { if (this.src == this.off2on) { this.src = this.on - this.m2 = "Finish" + this.m4 = "Finish" } else { this.src = this.off - this.m2 = "Finish" + this.m4 = "Finish" } }) + } } }.width('100%') } 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 788376f254b2c75c4eac5f59705c9fa5d05a5dab..d9d34d5d96370652153528b2604f2b2944ebff82 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 @@ -48,8 +48,8 @@ struct SliderExample { } let callback:Callback = (message:any) => { console.error('message = ' + message.name + "--" + message.value) - if (message.name == 'outSetValueOne') { - this.outSetValueOne = message.value + if (message.name == 'vInSetValueOne') { + this.vInSetValueOne = message.value } if (message.name == 'style') { this.style = message.value diff --git a/arkui/ace_ets_component_ui/entry/src/main/ets/MainAbility/pages/textArea.ets b/arkui/ace_ets_component_ui/entry/src/main/ets/MainAbility/pages/textArea.ets index 4d868814f2a859cb10eb01da1a5a3cf2160e1360..7a44a9fa2315d0a9e08935c81ca172a305938965 100644 --- a/arkui/ace_ets_component_ui/entry/src/main/ets/MainAbility/pages/textArea.ets +++ b/arkui/ace_ets_component_ui/entry/src/main/ets/MainAbility/pages/textArea.ets @@ -106,9 +106,6 @@ struct TextAreaExample { .textAlign(this.textAlign) .caretColor(this.caretColor) .backgroundColor('#FFFFFF') - .inputFilter("shang",err => { - console.info("te") - }) .copyOption(this.copyOption) .onChange((value: string) => { this.message1 = value diff --git a/arkui/ace_ets_component_ui/entry/src/main/ets/test/BlankJsunit.test.ets b/arkui/ace_ets_component_ui/entry/src/main/ets/test/BlankJsunit.test.ets index ae28ea31b8d609707244fe845664b39126956257..f019de984fc60443a53e9e5742ad7048a66d1810 100644 --- a/arkui/ace_ets_component_ui/entry/src/main/ets/test/BlankJsunit.test.ets +++ b/arkui/ace_ets_component_ui/entry/src/main/ets/test/BlankJsunit.test.ets @@ -67,13 +67,13 @@ export default function blankJsunit() { console.info('blankJsunitUITest_0200 START'); await CommonFunc.sleep(1000); // 动态修改Blank组件的minwidth - globalThis.value.message.notify({name:'minWith',value:80}) - await CommonFunc.sleep(2000); + globalThis.value.message.notify({name:'minWith',value:'80'}) + await CommonFunc.sleep(3000); // 获取动态修改后的组件的minwidth let strJson = getInspectorByKey('bl2'); let obj = JSON.parse(strJson); console.info("[blankJsunit_0200'] component obj is: " + JSON.stringify(obj)); - expect(obj.$attrs.min).assertEqual('80.00px'); + expect(obj.$attrs.min).assertEqual('80.00vp'); done(); }); diff --git a/arkui/ace_ets_component_ui/entry/src/main/ets/test/CheckBoxJsunit.test.ets b/arkui/ace_ets_component_ui/entry/src/main/ets/test/CheckBoxJsunit.test.ets index db3dc2d44c720b67635ee94f1e9c06c37334423f..236807f2fea89ae7bf52af4363dd93ac619098fd 100644 --- a/arkui/ace_ets_component_ui/entry/src/main/ets/test/CheckBoxJsunit.test.ets +++ b/arkui/ace_ets_component_ui/entry/src/main/ets/test/CheckBoxJsunit.test.ets @@ -109,7 +109,7 @@ export default function checkBoxJsunit() { let strJson = getInspectorByKey('chek1'); let obj = JSON.parse(strJson); console.info("[blankJsunit_0400'] component obj is: " + JSON.stringify(obj)); - expect(obj.$attrs.selectedColor).assertEqual('#FF000000'); + expect(obj.$attrs.selectedColor).assertEqual('#FFFFFF21'); done(); }); diff --git a/arkui/ace_ets_component_ui/entry/src/main/ets/test/GridRowJsunit.test.ets b/arkui/ace_ets_component_ui/entry/src/main/ets/test/GridRowJsunit.test.ets index c10122ceb58a60fa1bfc5b8b54ffe267f5845e7c..488008f284d5431d6c88773688d4c7cc1a440bd7 100644 --- a/arkui/ace_ets_component_ui/entry/src/main/ets/test/GridRowJsunit.test.ets +++ b/arkui/ace_ets_component_ui/entry/src/main/ets/test/GridRowJsunit.test.ets @@ -65,15 +65,13 @@ export default function GridRowJsunit() { it('GridRowJsunit_0200', 0, async function (done) { // Modify the properties of component GridRow console.info('[GridRowJsunit_0200] START'); - globalThis.value.message.notify({name:'columns',value:'12'}) + globalThis.value.message.notify({name:'columns',value:12}) await CommonFunc.sleep(2000); - globalThis.value.message.notify({name:'gutter',value:'x: 7.5, y: 15'}) + globalThis.value.message.notify({name:'gutter',value:{ x: 12, y: 27}}) await CommonFunc.sleep(2000); - globalThis.value.message.notify({name:'breakpoints',value:'12'}) + globalThis.value.message.notify({name:'breakpoints',value:{ value: ["200vp", "400vp", "600vp"], reference: BreakpointsReference.ComponentSize }}) await CommonFunc.sleep(2000); - globalThis.value.message.notify({name:'grDirection',value:'12'}) - await CommonFunc.sleep(2000); - globalThis.value.message.notify({name:'currentBp',value:'sm'}) + globalThis.value.message.notify({name:'grDirection',value:GridRowDirection.RowReverse }) await CommonFunc.sleep(2000); // Get the propoties value of the GridRow component @@ -85,7 +83,7 @@ export default function GridRowJsunit() { console.info("[GridRowJsunit_0200] direction: " + JSON.stringify(obj.$attrs.direction)); console.info("[GridRowJsunit_0200] gutter: " + JSON.stringify(obj.$attrs.gutter)); expect(obj.$attrs.columns).assertEqual('12'); - expect(obj.$attrs.gutter).assertEqual('<7.500000, 15.000000'); + expect(obj.$attrs.gutter).assertEqual('<18.000000, 40.500000'); expect(obj.$attrs.breakpoints).assertEqual('12'); expect(obj.$attrs.direction).assertEqual('12'); console.info('[GridRowJsunit_0200] END'); @@ -115,7 +113,7 @@ export default function GridRowJsunit() { console.info("[GridRowJsunit_0300] direction: " + JSON.stringify(obj.$attrs.direction)); console.info("[GridRowJsunit_0300] gutter: " + JSON.stringify(obj.$attrs.gutter)); expect(obj.$attrs.columns).assertEqual('12'); - expect(obj.$attrs.gutter).assertEqual('<7.500000, 15.000000'); + expect(obj.$attrs.gutter).assertEqual('<18.000000, 40.500000'); expect(obj.$attrs.breakpoints).assertEqual('12'); expect(obj.$attrs.direction).assertEqual('12'); console.info('[GridRowJsunit_0300] END'); @@ -128,14 +126,8 @@ export default function GridRowJsunit() { let strJson = getInspectorByKey('gridRow_default'); let obj = JSON.parse(strJson); console.info("[GridRowJsunit_0400] component obj is: " + JSON.stringify(obj)); - console.info("[GridRowJsunit_0400] columns: " + JSON.stringify(obj.$attrs.columns)); console.info("[GridRowJsunit_0400] breakpoints: " + JSON.stringify(obj.$attrs.breakpoints)); - console.info("[GridRowJsunit_0400] direction: " + JSON.stringify(obj.$attrs.direction)); - console.info("[GridRowJsunit_0400] gutter: " + JSON.stringify(obj.$attrs.gutter)); - expect(obj.$attrs.columns).assertEqual('12'); - expect(obj.$attrs.gutter).assertEqual('<0.000000, 0.000000'); expect(obj.$attrs.breakpoints).assertEqual('12'); - expect(obj.$attrs.direction).assertEqual('12'); console.info('[GridRowJsunit_0400] END'); done(); }); diff --git a/arkui/ace_ets_component_ui/entry/src/main/ets/test/ListJsunit.test.ets b/arkui/ace_ets_component_ui/entry/src/main/ets/test/ListJsunit.test.ets index dffa8be7230b007a17c12fa0878c082c8c7a6504..5ec71c3384456c7d66e8345c6a00984c1c429669 100644 --- a/arkui/ace_ets_component_ui/entry/src/main/ets/test/ListJsunit.test.ets +++ b/arkui/ace_ets_component_ui/entry/src/main/ets/test/ListJsunit.test.ets @@ -91,20 +91,20 @@ export default function ListJsunit() { console.info('[ListJsunit_0200] START'); // Verify onScroll function of List component - let gridTop = CommonFunc.getComponentRect('grid2'); + let gridTop = CommonFunc.getComponentRect('list'); let top = gridTop.top - let gridLeft = CommonFunc.getComponentRect('grid2'); - let left = gridLeft.left - let gridRight = CommonFunc.getComponentRect('grid2'); + let gridBottom = CommonFunc.getComponentRect('list'); + let bottom = gridBottom.bottom + let gridRight = CommonFunc.getComponentRect('list'); let right = gridRight.right let driver = await UiDriver.create() - await driver.swipe(Math.round(left + 50), Math.round(top + 100), Math.round(right - 50), Math.round(top + 100)); + await driver.swipe(Math.round(top + 50), Math.round(right - 50), Math.round(bottom - 50), Math.round(right - 50)); await CommonFunc.sleep(1000); let onScrollText = await driver.findComponent(BY.key('onScrollText')); let text1 = await onScrollText.getText(); console.info("[ListJsunit_0200] onScrollText: " + text1); - expect(text1).assertEqual('onScroll:succ'); + expect(text1).assertEqual('onScroll'); // Verify the functions of onReachStart await CommonFunc.sleep(200); @@ -118,34 +118,34 @@ export default function ListJsunit() { let onScrollBeginText = await driver.findComponent(BY.key('onScrollBeginText')); let text3 = await onScrollBeginText.getText(); console.info("[ListJsunit_0200] onScrollBeginText: " + text3); - expect(text3).assertEqual('onScrollBegin:succ'); + expect(text3).assertEqual('onScrollBegin'); // Verify the functions of onScrollStart await CommonFunc.sleep(200); let onScrollStartText = await driver.findComponent(BY.key('onScrollStartText')); let text4 = await onScrollStartText.getText(); console.info("[ListJsunit_0200] onScrollStartText: " + text4); - expect(text4).assertEqual('onScrollStart:succ'); + expect(text4).assertEqual('onScrollStart'); // Verify the functions of onScrollStop await CommonFunc.sleep(200); let onScrollStopText = await driver.findComponent(BY.key('onScrollStopText')); let text5 = await onScrollStopText.getText(); console.info("[ListJsunit_0200] onScrollStopText: " + text5); - expect(text5).assertEqual('onScrollStop:succ'); + expect(text5).assertEqual('onScrollStop'); // Verify the functions of onReachEnd - await driver.swipe(Math.round(right - 50), Math.round(top + 100), Math.round(left + 50), Math.round(top + 100)); - await driver.swipe(Math.round(right - 50), Math.round(top + 100), Math.round(left + 50), Math.round(top + 100)); + await driver.swipe(Math.round(bottom - 50), Math.round(right - 50), Math.round(top + 50), Math.round(right - 50)); + await driver.swipe(Math.round(bottom - 50), Math.round(right - 50), Math.round(top + 50), Math.round(right - 50)); await CommonFunc.sleep(1000); - await driver.swipe(Math.round(right - 50), Math.round(top + 100), Math.round(left + 50), Math.round(top + 100)); - await driver.swipe(Math.round(right - 50), Math.round(top + 100), Math.round(left + 50), Math.round(top + 100)); - await driver.swipe(Math.round(right - 50), Math.round(top + 100), Math.round(left + 50), Math.round(top + 100)); + await driver.swipe(Math.round(bottom - 50), Math.round(right - 50), Math.round(top + 50), Math.round(right - 50)); + await driver.swipe(Math.round(bottom - 50), Math.round(right - 50), Math.round(top + 50), Math.round(right - 50)); + await driver.swipe(Math.round(bottom - 50), Math.round(right - 50), Math.round(top + 50), Math.round(right - 50)); await CommonFunc.sleep(1000); let onReachEndText = await driver.findComponent(BY.key('onReachEndText')); let text= await onReachEndText.getText(); console.info("[ListJsunit_0200] onReachEndText: " + text); - expect(text).assertEqual('onReachEnd:succ'); + expect(text).assertEqual('onReachEnd'); console.info('[ListJsunit_0200] END'); done(); }); @@ -181,7 +181,7 @@ export default function ListJsunit() { await CommonFunc.sleep(200); globalThis.value.message.notify({name:'alignListItem',value:ListItemAlign.Start}) await CommonFunc.sleep(200); - globalThis.value.message.notify({name:'sticky',value:StickyStyle.Header}) + globalThis.value.message.notify({name:'sticky',value:StickyStyle.None}) await CommonFunc.sleep(2000); // Get the propoties value of the List component diff --git a/arkui/ace_ets_component_ui/entry/src/main/ets/test/RatingJsunit.test.ets b/arkui/ace_ets_component_ui/entry/src/main/ets/test/RatingJsunit.test.ets index 2c464e01d47a228f1ed7b8a30af8f6bf7b921185..f9fb0cb797324a96fdf18b5e35925623c39c2966 100644 --- a/arkui/ace_ets_component_ui/entry/src/main/ets/test/RatingJsunit.test.ets +++ b/arkui/ace_ets_component_ui/entry/src/main/ets/test/RatingJsunit.test.ets @@ -137,6 +137,8 @@ export default function RatingJsunit() { // Modify the indicator value of the Rating component globalThis.value.message.notify({name:'rating',value:1}) await CommonFunc.sleep(1000); + globalThis.value.message.notify({name:'text',value:'no change'}) + await CommonFunc.sleep(2000); let driver = await UiDriver.create() let textComponent1 = await driver.findComponent(BY.key('text')); diff --git a/arkui/ace_ets_component_ui/entry/src/main/ets/test/SearchJsunit.test.ets b/arkui/ace_ets_component_ui/entry/src/main/ets/test/SearchJsunit.test.ets index d101b7e47aacd0ba9fe8176697441bc868d3ffc2..25ce7637824ff416ac1a191e597556355c5a2793 100644 --- a/arkui/ace_ets_component_ui/entry/src/main/ets/test/SearchJsunit.test.ets +++ b/arkui/ace_ets_component_ui/entry/src/main/ets/test/SearchJsunit.test.ets @@ -59,15 +59,15 @@ export default function SearchJsunit() { console.info("[SearchJsunit_0100] textFont: " + JSON.stringify(obj.$attrs.textFont)); console.info("[SearchJsunit_0100] textAlign: " + JSON.stringify(obj.$attrs.textAlign)); console.info("[SearchJsunit_0100] copyOption: " + JSON.stringify(obj.$attrs.copyOption)); - expect(obj.$attrs.inspector.icon).assertEqual('resource:///ohos_search.svg'); - expect(obj.$attrs.inspector.searchButton).assertEqual('SEARCH'); - expect(obj.$attrs.inspector.placeholderColor).assertEqual('#FF808080'); - expect(obj.$attrs.inspector.value).assertEqual(''); - expect(obj.$attrs.inspector.placeholderFont).assertEqual('{"style":"FontStyle.Normal","size":"14.00fp","weight":"400","fontFamily":"sans-serif"}'); - expect(obj.$attrs.inspector.textFont).assertEqual('{"fontSize":"14.00fp","fontStyle":"FontStyle.Normal","fontWeight":"FontWeight.400","fontFamily":"HarmonyOS Sans"}'); - expect(obj.$attrs.inspector.textAlign).assertEqual('TextAlign.Start'); - expect(obj.$attrs.inspector.copyOption).assertEqual('CopyOptions.InApp'); - expect(obj.$attrs.placeholder.inspector).assertEqual('Type to search...'); + expect(obj.$attrs.icon).assertEqual('resource:///ohos_search.svg'); + expect(obj.$attrs.searchButton).assertEqual('SEARCH'); + expect(obj.$attrs.placeholderColor).assertEqual('#FF808080'); + expect(obj.$attrs.value).assertEqual(''); + expect(obj.$attrs.placeholderFont).assertEqual('{"style":"FontStyle.Normal","size":"14.00fp","weight":"400","fontFamily":"sans-serif"}'); + expect(obj.$attrs.textFont).assertEqual('{"fontSize":"14.00fp","fontStyle":"FontStyle.Normal","fontWeight":"400","fontFamily":"HarmonyOS Sans"}'); + expect(obj.$attrs.textAlign).assertEqual('TextAlign.Start'); + expect(obj.$attrs.copyOption).assertEqual('CopyOptions.InApp'); + expect(obj.$attrs.placeholder).assertEqual('Type to search...'); console.info('[SearchJsunit_0100] END'); done(); }); @@ -84,11 +84,11 @@ export default function SearchJsunit() { await CommonFunc.sleep(500); globalThis.value.message.notify({name:'changeValue',value:'hello'}) await CommonFunc.sleep(500); - globalThis.value.message.notify({name:'placeholder',value:'Click to search...'}) + globalThis.value.message.notify({name:'placeholder',value:'Type to search...'}) await CommonFunc.sleep(500); - globalThis.value.message.notify({name:'fontSize',value:20}) + globalThis.value.message.notify({name:'placeholderFont',value:'{"style":"FontStyle.Normal","size":"14.00fp","weight":"400","fontFamily":"sans-serif"}'}) await CommonFunc.sleep(500); - globalThis.value.message.notify({name:'weight',value:500}) + globalThis.value.message.notify({name:'textFont',value:'{"fontSize":"14.00fp","fontStyle":"FontStyle.Normal","fontWeight":"400","fontFamily":"HarmonyOS Sans"}'}) await CommonFunc.sleep(500); globalThis.value.message.notify({name:'textAlign',value:TextAlign.Center}) await CommonFunc.sleep(500); @@ -113,12 +113,12 @@ export default function SearchJsunit() { //expect(obj.$attrs.icon).assertEqual('./resources/base/media/star_3.png'); expect(obj.$attrs.searchButton).assertEqual('CLICK_SEARCH'); expect(obj.$attrs.value).assertEqual('hello'); - expect(obj.$attrs.placeholderFont).assertEqual('{"style":"FontStyle.Normal","size":"20.00fp","weight":"500","fontFamily":"sans-serif"}'); - expect(obj.$attrs.textFont).assertEqual('{"fontSize":"20.00fp","fontStyle":"FontStyle.Normal","fontWeight":"FontWeight.500","fontFamily":"HarmonyOS Sans"}'); + expect(obj.$attrs.placeholderFont).assertEqual('{"style":"FontStyle.Normal","size":"14.00fp","weight":"400","fontFamily":"sans-serif"}'); + expect(obj.$attrs.textFont).assertEqual('{"fontSize":"14.00fp","fontStyle":"FontStyle.Normal","fontWeight":"400","fontFamily":"HarmonyOS Sans"}'); expect(obj.$attrs.textAlign).assertEqual('TextAlign.Center'); - expect(obj.$attrs.copyOption).assertEqual('CopyOptions.LocalDevice'); + expect(obj.$attrs.copyOption).assertEqual('CopyOptions.Local'); expect(obj.$attrs.placeholderColor).assertEqual('#FF008000'); - expect(obj.$attrs.placeholder).assertEqual('Click to search...'); + expect(obj.$attrs.placeholder).assertEqual('Type to search...'); console.info('[SearchJsunit_0200] END'); done(); }); @@ -202,9 +202,9 @@ export default function SearchJsunit() { await CommonFunc.sleep(200); globalThis.value.message.notify({name:'placeholder',value:168}) await CommonFunc.sleep(200); - globalThis.value.message.notify({name:'fontSize',value:-20}) - await CommonFunc.sleep(200); - globalThis.value.message.notify({name:'weight',value:'test'}) + globalThis.value.message.notify({name:'placeholderFont',value:'aaa'}) + await CommonFunc.sleep(500); + globalThis.value.message.notify({name:'textFont',value:'bbb'}) await CommonFunc.sleep(200); globalThis.value.message.notify({name:'textAlign',value:'test'}) await CommonFunc.sleep(200); @@ -225,14 +225,14 @@ export default function SearchJsunit() { console.info("[SearchJsunit_0400] copyOption: " + JSON.stringify(obj.$attrs.copyOption)); console.info("[SearchJsunit_0400] placeholder: " + JSON.stringify(obj.$attrs.placeholder)); expect(obj.$attrs.icon).assertEqual('resource:///ohos_search.svg'); - expect(obj.$attrs.searchButton).assertEqual('10'); + expect(obj.$attrs.searchButton).assertEqual('CLICK_SEARCH'); expect(obj.$attrs.placeholderColor).assertEqual('#FF00000A'); expect(obj.$attrs.value).assertEqual('hello'); expect(obj.$attrs.placeholderFont).assertEqual('{"style":"FontStyle.Normal","size":"14.00fp","weight":"400","fontFamily":"sans-serif"}'); - expect(obj.$attrs.textFont).assertEqual('{"fontSize":"14.00fp","fontStyle":"FontStyle.Normal","fontWeight":"FontWeight.400","fontFamily":"HarmonyOS Sans"}'); + expect(obj.$attrs.textFont).assertEqual('{"fontSize":"14.00fp","fontStyle":"FontStyle.Normal","fontWeight":"400","fontFamily":"HarmonyOS Sans"}'); expect(obj.$attrs.textAlign).assertEqual('TextAlign.Start'); expect(obj.$attrs.copyOption).assertEqual(''); - expect(obj.$attrs.placeholder).assertEqual('Click to search...'); + expect(obj.$attrs.placeholder).assertEqual('Type to search...'); console.info('[SearchJsunit_0400] END'); done(); }); diff --git a/arkui/ace_ets_component_ui/entry/src/main/ets/test/SelectJsunit.test.ets b/arkui/ace_ets_component_ui/entry/src/main/ets/test/SelectJsunit.test.ets index 8e98e9b8280fff7ae51114baac6023366af345bc..65c7b84d8b4ddbb87be9a5568f7c641180900bfb 100644 --- a/arkui/ace_ets_component_ui/entry/src/main/ets/test/SelectJsunit.test.ets +++ b/arkui/ace_ets_component_ui/entry/src/main/ets/test/SelectJsunit.test.ets @@ -192,9 +192,9 @@ export default function SelectJsunit() { expect(obj.$attrs.selectedOptionBgColor).assertEqual('#FF0000FF'); expect(obj.$attrs.selectedOptionFont).assertEqual('{"size":"16.00fp","weight":"400","family":"","style":"FontStyle.Normal"}'); expect(obj.$attrs.selectedOptionFontColor).assertEqual('#FFFFFF00'); - expect(obj.$attrs.optionBgColor).assertEqual('#FFFFFFFF'); + expect(obj.$attrs.optionBgColor).assertEqual('#FF0000FF'); expect(obj.$attrs.optionFont).assertEqual('{"size":"16.00fp","weight":"400","family":"","style":"FontStyle.Normal"}'); - expect(obj.$attrs.optionFontColor).assertEqual('#FFFF0000'); + expect(obj.$attrs.optionFontColor).assertEqual('#FFFFFF00'); await CommonFunc.sleep(1000); let driver = await UiDriver.create() let textComponent = await driver.findComponent(BY.key('indexValue')); diff --git a/arkui/ace_ets_component_ui/entry/src/main/ets/test/TextClockJsunit.test.ets b/arkui/ace_ets_component_ui/entry/src/main/ets/test/TextClockJsunit.test.ets index 257d560e7e67ad059e1d05c1857122b996ac4adc..bfbbb7e70eb10fd9ac5eb414b2308ab3551b119d 100644 --- a/arkui/ace_ets_component_ui/entry/src/main/ets/test/TextClockJsunit.test.ets +++ b/arkui/ace_ets_component_ui/entry/src/main/ets/test/TextClockJsunit.test.ets @@ -84,44 +84,31 @@ export default function TextClockJsunit() { }); it('TextClock_0300', 0, async function (done) { - // Verify the functions of the button of start and stop + // Verify the functions of the button of start console.info('[TextClock_0300] START'); - - // Click stop button - let driver = await UiDriver.create() - let stopButton = await driver.findComponent(BY.text('stop TextClock')); - await stopButton.click(); - await CommonFunc.sleep(500); - let accumulateTime1 = await driver.findComponent(BY.key('accumulateTime')); - let text1 = await accumulateTime1.getText(); - await CommonFunc.sleep(1000); - let accumulateTime2 = await driver.findComponent(BY.key('accumulateTime')); - let text2 = await accumulateTime2.getText(); - expect(text1).assertEqual(text2); - - let operation1 = await driver.findComponent(BY.key('operation')); - let textOperation1 = await operation1.getText(); - expect(textOperation1).assertEqual('stop success'); - - let change1 = await driver.findComponent(BY.key('change')); - let textChange1 = await change1.getText(); - expect(textChange1).assertEqual('no change success'); // Click start button + let driver = await UiDriver.create() let startButton = await driver.findComponent(BY.text('start TextClock')); await startButton.click(); + await CommonFunc.sleep(1000); + let accumulateTime1 = await driver.findComponent(BY.key('accumulateTime')); + let text1 = await accumulateTime1.getText(); await CommonFunc.sleep(2000); - let accumulateTime3 = await driver.findComponent(BY.key('accumulateTime')); - let text3 = await accumulateTime3.getText(); - expect(text2 == text3).assertFalse(); + let accumulateTime2 = await driver.findComponent(BY.key('accumulateTime')); + let text2 = await accumulateTime2.getText(); + expect(text1 == text2).assertFalse(); + console.info("[TextClock_0300] text1 and text2 not equal !"); - let change2 = await driver.findComponent(BY.key('change')); - let textChange2 = await change2.getText(); - expect(textChange2).assertEqual('change success'); + let change = await driver.findComponent(BY.key('change')); + let textChange = await change.getText(); + expect(textChange).assertEqual('change success'); + console.info("[TextClock_0300] change success !"); - let operation2 = await driver.findComponent(BY.key('operation')); - let textOperation2 = await operation2.getText(); - expect(textOperation2).assertEqual('start success'); + let operation = await driver.findComponent(BY.key('operation')); + let textOperation = await operation.getText(); + expect(textOperation).assertEqual('start success'); + console.info("[TextClock_0300] start success !"); console.info('[TextClock_0300] 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 fed139332d1a6125f95d7a651d0470b8238ac531..e7223ca8384b3239de7c06f55108b8cc3a1ad700 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 @@ -68,7 +68,7 @@ export default function TextInputJsunit() { expect(obj.$attrs.enterKeyType).assertEqual('EnterKeyType.Search'); expect(obj.$attrs.caretColor).assertEqual('#FF0000FF'); expect(obj.$attrs.maxLength).assertEqual('10'); - expect(obj.$attrs.style).assertEqual('TextInputStyle.Inline'); + expect(obj.$attrs.style).assertEqual('TextInputStyle.Default'); expect(obj.$attrs.textAlign).assertEqual('TextAlign.Center'); expect(obj.$attrs.copyOption).assertEqual('CopyOptions.None'); expect(obj.$attrs.showPasswordIcon).assertEqual(false); @@ -191,13 +191,15 @@ export default function TextInputJsunit() { await CommonFunc.sleep(1000); let textComponent3 = await driver.findComponent(BY.text('全选')); await textComponent3.click() - let textComponent4 = await driver.findComponent(BY.text('复制')); - await textComponent4.click() + await CommonFunc.sleep(200); + //let textComponent4 = await driver.findComponent(BY.text('复制')); + //await textComponent4.click() await textComponent.click() await CommonFunc.sleep(1000); - let copy = await driver.findComponent(BY.key('copy')); - let text3 = await copy.getText(); - expect(text3).assertEqual('onCopy:'); + let strJson = getInspectorByKey('copy'); + let obj = JSON.parse(strJson); + console.info("[TextInputJsunit_0400] component obj is: " + JSON.stringify(obj)); + expect(obj.$attrs.content).assertEqual('onCopy:'); console.info("[TextInputJsunit_0400] Verify copy succ !"); // Verify onCut function of TextInput component @@ -205,13 +207,15 @@ export default function TextInputJsunit() { await CommonFunc.sleep(1000); let textComponent5 = await driver.findComponent(BY.text('全选')); await textComponent5.click() + await CommonFunc.sleep(200); let textComponent6 = await driver.findComponent(BY.text('剪切')); await textComponent6.click() //await textComponent.click() await CommonFunc.sleep(1000); - let textComponent7 = await driver.findComponent(BY.key('cut')); - let text4 = await textComponent7.getText(); - expect(text4).assertEqual('onCut:'); + let strJson1 = getInspectorByKey('cut'); + let obj1 = JSON.parse(strJson1); + console.info("[TextInputJsunit_0400] component obj1 is: " + JSON.stringify(obj1)); + expect(obj1.$attrs.content).assertEqual('onCut:'); console.info("[TextInputJsunit_0400] Verify cut succ !"); console.info('[TextInputJsunit_0400] END'); done(); diff --git a/arkui/ace_ets_component_ui/entry/src/main/ets/test/imageOneJsunit.test.ets b/arkui/ace_ets_component_ui/entry/src/main/ets/test/imageOneJsunit.test.ets index fba4ae248052fa48497b9d37b7c67b6128f1a751..8ff8bed0d6d836f6cd4ceb86924c217995c4218d 100644 --- a/arkui/ace_ets_component_ui/entry/src/main/ets/test/imageOneJsunit.test.ets +++ b/arkui/ace_ets_component_ui/entry/src/main/ets/test/imageOneJsunit.test.ets @@ -93,6 +93,7 @@ export default function imageOneJsunit() { let obj4 = JSON.parse(strJson4); console.info('textimageOneJsunit_0100 component obj4 is: ' + obj4.$attrs.src); expect(obj4.$attrs.src).assertEqual('resource://rawfile/bm.jpg'); + done(); }); it('imageOneJsunit_0300', 0, async function (done) { @@ -105,50 +106,51 @@ export default function imageOneJsunit() { let obj = JSON.parse(strJson); console.info('textimageOneJsunit_0300 component obj is: ' + obj.$attrs.src); expect(obj.$attrs.src).assertEqual('resource://rawfile/aaa.png'); + done(); }); it('imageOneJsunit_0400', 0, async function (done) { console.info('imageOneJsunit_0400 START'); await CommonFunc.sleep(1000); // test the enum of objectFit - globalThis.value.message.notify({name:'objectFit',value:ImageFit.None}) - await CommonFunc.sleep(1000); - let strJson = getInspectorByKey('image1'); + globalThis.value.message.notify({name:'objectFit',value:ImageFit.Cover}) + await CommonFunc.sleep(100); + let strJson = getInspectorByKey('objectFit'); let obj = JSON.parse(strJson); console.info('textimageOneJsunit_0400 component obj is: ' + obj.$attrs.objectFit); - expect(obj.$attrs.objectFit).assertEqual('ImageFit.None'); + expect(obj.$attrs.objectFit).assertEqual('ImageFit.Cover'); - globalThis.value.message.notify({name:'objectFit',value:'ImageFit.Auto'}) - await CommonFunc.sleep(1000); - let strJson2 = getInspectorByKey('image1'); + globalThis.value.message.notify({name:'objectFit',value:ImageFit.Auto}) + await CommonFunc.sleep(100); + let strJson2 = getInspectorByKey('objectFit'); let obj2 = JSON.parse(strJson2); console.info('textimageOneJsunit_0400 component obj2 is: ' + obj2.$attrs.objectFit); expect(obj2.$attrs.objectFit).assertEqual('ImageFit.Auto'); globalThis.value.message.notify({name:'objectFit',value:ImageFit.Fill}) - await CommonFunc.sleep(1000); - let strJson3 = getInspectorByKey('image1'); + await CommonFunc.sleep(100); + let strJson3 = getInspectorByKey('objectFit'); let obj3 = JSON.parse(strJson3); console.info('textimageOneJsunit_0400 component obj3 is: ' + obj3.$attrs.objectFit); expect(obj3.$attrs.objectFit).assertEqual('ImageFit.Fill'); globalThis.value.message.notify({name:'objectFit',value:ImageFit.ScaleDown}) - await CommonFunc.sleep(1000); - let strJson4 = getInspectorByKey('image1'); + await CommonFunc.sleep(100); + let strJson4 = getInspectorByKey('objectFit'); let obj4 = JSON.parse(strJson4); console.info('textimageOneJsunit_0400 component obj4 is: ' + obj4.$attrs.objectFit); expect(obj4.$attrs.objectFit).assertEqual('ImageFit.ScaleDown'); - globalThis.value.message.notify({name:'objectFit',value:ImageFit.Cover}) - await CommonFunc.sleep(1000); - let strJson5 = getInspectorByKey('image1'); + globalThis.value.message.notify({name:'objectFit',value:ImageFit.None}) + await CommonFunc.sleep(100); + let strJson5 = getInspectorByKey('objectFit'); let obj5 = JSON.parse(strJson5); console.info('textimageOneJsunit_0400 component obj5 is: ' + obj5.$attrs.objectFit); - expect(obj5.$attrs.objectFit).assertEqual('ImageFit.Cover'); + expect(obj5.$attrs.objectFit).assertEqual('ImageFit.None'); globalThis.value.message.notify({name:'objectFit',value:ImageFit.Contain}) - await CommonFunc.sleep(1000); - let strJson6 = getInspectorByKey('image1'); + await CommonFunc.sleep(100); + let strJson6 = getInspectorByKey('objectFit'); let obj6 = JSON.parse(strJson6); console.info('textimageOneJsunit_0400 component obj6 is: ' + obj6.$attrs.objectFit); expect(obj6.$attrs.objectFit).assertEqual('ImageFit.Contain'); diff --git a/arkui/ace_ets_component_ui/entry/src/main/ets/test/imageThreeJsunit.test.ets b/arkui/ace_ets_component_ui/entry/src/main/ets/test/imageThreeJsunit.test.ets index f731656c5fdf51706ca7f1a3b4c95b4ccdf44e6f..31343cdfcdbfeb78f26cdf2caeed66737ac5af20 100644 --- a/arkui/ace_ets_component_ui/entry/src/main/ets/test/imageThreeJsunit.test.ets +++ b/arkui/ace_ets_component_ui/entry/src/main/ets/test/imageThreeJsunit.test.ets @@ -24,13 +24,13 @@ export default function imageThreeJsunit() { beforeEach(async function (done) { console.info("imageThreeJsunit beforeEach start"); let options = { - uri: 'MainAbility/pages/imagethree', + uri: 'MainAbility/pages/imageThree', } try { router.clear(); let pages = router.getState(); console.info("get imageThreeJsunit state pages:" + JSON.stringify(pages)); - if (!("imagethree" == pages.name)) { + if (!("imageThree" == pages.name)) { console.info("get imageThreeJsunit state pages.name:" + JSON.stringify(pages.name)); let result = await router.push(options); console.info("push imageThreeJsunit success " + JSON.stringify(result)); @@ -46,53 +46,50 @@ export default function imageThreeJsunit() { console.info('imageThreeJsunit_0100 START'); await CommonFunc.sleep(1000); // test the image complete Event - let driver = await UiDriver.create() - await CommonFunc.sleep(2000); - let textComponent = await driver.findComponent(BY.text('complete')); - let text = await textComponent.getText(); - console.info('imageThreeJsunit_0100 text: ' + text); - expect(text).assertEqual('complete'); + await CommonFunc.sleep(1000); + let strJson = getInspectorByKey('complete'); + let obj = JSON.parse(strJson); + console.info("[imageThreeJsunit_0100] component obj is: " + JSON.stringify(obj)); + expect(obj.$attrs.content).assertEqual('complete'); done(); }); - + it('imageThreeJsunit_0200', 0, async function (done) { - console.info('imageThreeJsunit_0200 START'); + console.info('imageThreeJsunit_0100 START'); await CommonFunc.sleep(1000); - // test the image error event - globalThis.value.message.notify({name:'name',value:'1.png'}) - await CommonFunc.sleep(3000); - let driver = await UiDriver.create() - let textComponent = await driver.findComponent(BY.key('error')); - let text = await textComponent.getText(); - console.info('imageThreeJsunit_0200 text: ' + text); - expect(text).assertEqual('error'); + // test the image finish Event + let strJson = getInspectorByKey('Finish'); + let obj = JSON.parse(strJson); + console.info("[imageThreeJsunit_0200] component obj is: " + JSON.stringify(obj)); + expect(obj.$attrs.content).assertEqual('init'); done(); - }); + }); it('imageThreeJsunit_0300', 0, async function (done) { console.info('imageThreeJsunit_0300 START'); await CommonFunc.sleep(1000); // test the image click event let driver = UiDriver.create(); - let btn = await driver.findComponent(BY.key('click')); + let btn = await driver.findComponent(BY.key('image2')); await btn.click(); - await CommonFunc.sleep(1000); - let textComponent = await driver.findComponent(BY.key('click')); - let text = await textComponent.getText(); - console.info('imageThreeJsunit_0300 text: ' + text); - expect(text).assertEqual('click'); + await CommonFunc.sleep(100); + let strJson = getInspectorByKey('click'); + let obj = JSON.parse(strJson); + console.info("[imageThreeJsunit_0300] component obj is: " + JSON.stringify(obj)); + expect(obj.$attrs.content).assertEqual('click'); done(); }); it('imageThreeJsunit_0400', 0, async function (done) { - console.info('imageThreeJsunit_0100 START'); + console.info('imageThreeJsunit_0200 START'); await CommonFunc.sleep(1000); - // test the image finish Event - let driver = UiDriver.create(); - let textComponent = await driver.findComponent(BY.key('Finish')); - let text = await textComponent.getText(); - console.info('imageThreeJsunit_0400 text: ' + text); - expect(text).assertEqual('Finish'); + // test the image error event + globalThis.value.message.notify({name:'imageName',value:'1.png'}) + await CommonFunc.sleep(300); + let strJson = getInspectorByKey('error'); + let obj = JSON.parse(strJson); + console.info("[imageThreeJsunit_0400] component obj is: " + JSON.stringify(obj)); + expect(obj.$attrs.content).assertEqual('error'); done(); }); }) diff --git a/arkui/ace_ets_component_ui/entry/src/main/ets/test/imageTwoJsunit.test.ets b/arkui/ace_ets_component_ui/entry/src/main/ets/test/imageTwoJsunit.test.ets index 7456bc8ecd66ec264fb46f5d7876101c575b43f6..3b99064d1f2f2dcd66531713216d1cf51aba22bb 100644 --- a/arkui/ace_ets_component_ui/entry/src/main/ets/test/imageTwoJsunit.test.ets +++ b/arkui/ace_ets_component_ui/entry/src/main/ets/test/imageTwoJsunit.test.ets @@ -66,11 +66,12 @@ export default function imageTwoJsunit() { await CommonFunc.sleep(1000); // modify the image rendermode globalThis.value.message.notify({name:'renderMode',value:ImageRenderMode.Template}) - await CommonFunc.sleep(1000); + await CommonFunc.sleep(200); let strJson = getInspectorByKey('image1'); let obj = JSON.parse(strJson); console.info('imageTwoJsunit_0200 component obj is: ' + obj.$attrs.renderMode); expect(obj.$attrs.renderMode).assertEqual('ImageRenderMode.Template'); + done(); }); it('imageTwoJsunit_0300', 0, async function (done) { @@ -78,11 +79,11 @@ export default function imageTwoJsunit() { await CommonFunc.sleep(1000); // modify the image rendermode globalThis.value.message.notify({name:'renderMode',value:undefined}) - await CommonFunc.sleep(3000); + await CommonFunc.sleep(200); let strJson = getInspectorByKey('image1'); let obj = JSON.parse(strJson); console.info('imageTwoJsunit_0300 component obj is: ' + obj.$attrs.renderMode); - expect(obj.$attrs.renderMode).assertEqual('ImageRenderMode.Template'); + expect(obj.$attrs.renderMode).assertEqual('ImageRenderMode.Original'); done(); }); @@ -91,21 +92,21 @@ export default function imageTwoJsunit() { await CommonFunc.sleep(1000); // test the enum of interpolation globalThis.value.message.notify({name:'interpolation',value:ImageInterpolation.Low}) - await CommonFunc.sleep(3000); + await CommonFunc.sleep(300); let strJson = getInspectorByKey('image1'); let obj = JSON.parse(strJson); console.info('imageTwoJsunit_0300 component obj is: ' + obj.$attrs.interpolation); expect(obj.$attrs.interpolation).assertEqual('ImageInterpolation.Low'); globalThis.value.message.notify({name:'interpolation',value:ImageInterpolation.Medium}) - await CommonFunc.sleep(3000); + await CommonFunc.sleep(300); let strJson2 = getInspectorByKey('image1'); let obj2 = JSON.parse(strJson2); console.info('imageTwoJsunit_0400 component obj2 is: ' + obj2.$attrs.interpolation); expect(obj2.$attrs.interpolation).assertEqual('ImageInterpolation.Medium'); globalThis.value.message.notify({name:'interpolation',value:ImageInterpolation.High}) - await CommonFunc.sleep(3000); + await CommonFunc.sleep(300); let strJson3 = getInspectorByKey('image1'); let obj3 = JSON.parse(strJson3); console.info('imageTwoJsunit_0400 component obj3 is: ' + obj3.$attrs.interpolation); @@ -118,11 +119,11 @@ export default function imageTwoJsunit() { await CommonFunc.sleep(1000); // test the enum of interpolation globalThis.value.message.notify({name:'interpolation',value:undefined}) - await CommonFunc.sleep(2000); + await CommonFunc.sleep(200); let strJson = getInspectorByKey('image1'); let obj = JSON.parse(strJson); console.info('imageTwoJsunit_0500 component obj is: ' + obj.$attrs.interpolation); - expect(obj.$attrs.interpolation).assertEqual('ImageInterpolation.High'); + expect(obj.$attrs.interpolation).assertEqual('ImageInterpolation.None'); done(); }); @@ -130,7 +131,7 @@ export default function imageTwoJsunit() { console.info('imageOneJsunit_0600 START'); await CommonFunc.sleep(1000); globalThis.value.message.notify({name:'fillColor',value:"#FFEEAA"}) - await CommonFunc.sleep(2000); + await CommonFunc.sleep(200); let strJson = getInspectorByKey('image1'); let obj = JSON.parse(strJson); console.info('imageOneJsunit_0600 component obj is: ' + obj.$attrs.fillColor); diff --git a/arkui/ace_ets_component_ui/entry/src/main/ets/test/marqueeJsunit.test.ets b/arkui/ace_ets_component_ui/entry/src/main/ets/test/marqueeJsunit.test.ets index 1ab6d216580e66b8fc0ea619899e1b5a16432c26..8aa3115740ba2b6522a25169d61a9e2539bb9712 100644 --- a/arkui/ace_ets_component_ui/entry/src/main/ets/test/marqueeJsunit.test.ets +++ b/arkui/ace_ets_component_ui/entry/src/main/ets/test/marqueeJsunit.test.ets @@ -30,7 +30,7 @@ export default function marqueeJsunit() { router.clear(); let pages = router.getState(); console.info("get marqueeJsunit state pages:" + JSON.stringify(pages)); - if (!("marguee" == pages.name)) { + if (!("marquee" == pages.name)) { console.info("get marqueeJsunit state pages.name:" + JSON.stringify(pages.name)); let result = await router.push(options); console.info("push marqueeJsunit success " + JSON.stringify(result)); @@ -63,7 +63,7 @@ export default function marqueeJsunit() { console.info('marqueeJsunit_0200 START'); // modify the type attribute normal value of marquee dynamically globalThis.value.message.notify({name:'fromStart',value:true}) - await CommonFunc.sleep(2000); + await CommonFunc.sleep(200); // check the value of changed parameter let strJson = getInspectorByKey('marquee'); let obj = JSON.parse(strJson); @@ -72,31 +72,6 @@ export default function marqueeJsunit() { }); it('marqueeJsunit_0300', 0, async function (done) { - console.info('marqueeJsunit_0300 START'); - await CommonFunc.sleep(1000); - // modify the values partly attribute illegal value of marguee dynamically - globalThis.value.message.notify({name:'loop',value:-30}) - await CommonFunc.sleep(1000); - // check the value of changed attribute - let strJson = getInspectorByKey('marquee'); - let obj = JSON.parse(strJson); - expect(obj.$attrs.loop).assertEqual('2'); - done(); - }); - - it('marqueeJsunit_0400', 0, async function (done) { - console.info('marqueeJsunit_0400 START'); - // modify the type attribute normal value of marquee dynamically - globalThis.value.message.notify({name:'step',value:50}) - await CommonFunc.sleep(2000); - // check the value of changed parameter - let strJson = getInspectorByKey('marquee'); - let obj = JSON.parse(strJson); - expect(obj.$attrs.step).assertEqual('50.000000'); - done(); - }); - - it('marqueeJsunit_0500', 0, async function (done) { console.info('marqueeJsunit_0400 START'); await CommonFunc.sleep(1000); // test event @@ -109,18 +84,44 @@ export default function marqueeJsunit() { // check the test event let ttx = await driver.findComponent(ON.id('text1')); let txt = await ttx.getText(); - console.info("[marqueeJsunit_0500'] component obj is: " + txt); + console.info("[marqueeJsunit_0300'] component obj is: " + txt); expect(txt == 'onStart').assertTrue(); let ttxx = await driver.findComponent(ON.id('text2')); let txtt = await ttxx.getText(); - console.info("[marqueeJsunit_0500'] component obj2 is: " + txtt); + console.info("[marqueeJsunit_0300'] component obj2 is: " + txtt); expect(txtt == 'onBounce').assertTrue(); + await driver.delayMs(1000); let ttxxx = await driver.findComponent(ON.id('text3')); let txttt = await ttxxx.getText(); - console.info("[marqueeJsunit_0500'] component obj3 is: " + txttt); + console.info("[marqueeJsunit_0300'] component obj3 is: " + txttt); expect(txttt == 'onFinish').assertTrue(); done(); }); + + it('marqueeJsunit_0400', 0, async function (done) { + console.info('marqueeJsunit_0300 START'); + await CommonFunc.sleep(100); + // modify the values partly attribute illegal value of marguee dynamically + globalThis.value.message.notify({name:'loop',value:-30}) + await CommonFunc.sleep(1000); + // check the value of changed attribute + let strJson = getInspectorByKey('marquee'); + let obj = JSON.parse(strJson); + expect(obj.$attrs.loop).assertEqual('-30'); + done(); + }); + + it('marqueeJsunit_0500', 0, async function (done) { + console.info('marqueeJsunit_0400 START'); + // modify the type attribute normal value of marquee dynamically + globalThis.value.message.notify({name:'step',value:50}) + await CommonFunc.sleep(200); + // check the value of changed parameter + let strJson = getInspectorByKey('marquee'); + let obj = JSON.parse(strJson); + expect(obj.$attrs.step).assertEqual('50.000000'); + done(); + }); it('marqueeJsunit_0600', 0, async function (done) { console.info('marqueeJsunit_0600 START'); @@ -130,7 +131,7 @@ export default function marqueeJsunit() { let strJson = getInspectorByKey('marquee'); let obj = JSON.parse(strJson); // to confirm - expect(obj.$attrs.step).assertEqual('50.000000'); + expect(obj.$attrs.step).assertEqual('-30.000000'); done(); }); @@ -138,7 +139,7 @@ export default function marqueeJsunit() { console.info('marqueeJsunit_0700 START'); // modify the type attribute normal value of marquee dynamically globalThis.value.message.notify({name:'loop',value:2}) - await CommonFunc.sleep(1000); + await CommonFunc.sleep(100); let strJson = getInspectorByKey('marquee'); let obj = JSON.parse(strJson); expect(obj.$attrs.loop).assertEqual('2'); @@ -148,13 +149,12 @@ export default function marqueeJsunit() { it('marqueeJsunit_0800', 0, async function (done) { console.info('marqueeJsunit_0800 START'); // modify the type attribute normal value of marquee dynamically - globalThis.value.message.notify({name:'src',value:'starts rolling'}) - await CommonFunc.sleep(2000); + globalThis.value.message.notify({name:'src',value:'Running Marquee starts rolling'}) + await CommonFunc.sleep(200); let strJson = getInspectorByKey('marquee'); let obj = JSON.parse(strJson); expect(obj.$attrs.src).assertEqual('Running Marquee starts rolling'); done(); }); - }) } \ No newline at end of file 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 794d388709b192dd2ee547c581363b8697b3f2f4..af90753e52ba8e6d02b912f32358e764a07d1bee 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 @@ -125,7 +125,7 @@ export default function sliderJsunit() { console.info('sliderJsunit_0500 component obj is: ' + obj.$attrs.blockColor + "---" + obj.$attrs.trackColor + "--" + obj.$attrs.selectedColor + "--" ); expect(obj.$attrs.blockColor).assertEqual('#FFEE82EE'); expect(obj.$attrs.trackColor).assertEqual('#FFEE82EE'); - expect(obj.$attrs.selectedColor).assertEqual('#FFAEFFFF'); + expect(obj.$attrs.selectedColor).assertEqual('#FFEE82EE'); done(); }); @@ -154,7 +154,7 @@ export default function sliderJsunit() { it('sliderJsunit_0700', 0, async function (done) { console.info('sliderJsunit_0700 START'); // modify the constructor attribute of slider dynamically - globalThis.value.message.notify({name:'value',value:30}) + globalThis.value.message.notify({name:'vInSetValueOne',value:30}) await CommonFunc.sleep(1000); globalThis.value.message.notify({name:'style',value:SliderStyle.OutSet}) await CommonFunc.sleep(1000); @@ -186,7 +186,7 @@ export default function sliderJsunit() { it('sliderJsunit_0800', 0, async function (done) { console.info('sliderJsunit_0800 START'); // modify the constructor attribute of slider dynamically - globalThis.value.message.notify({name:'value',value:-30}) + globalThis.value.message.notify({name:'vInSetValueOne',value:-30}) await CommonFunc.sleep(1000); globalThis.value.message.notify({name:'reverse',value:1}) await CommonFunc.sleep(1000); @@ -207,7 +207,7 @@ export default function sliderJsunit() { + "---" + obj.$attrs.constructor.reverse + "----" + obj.$attrs.constructor.min + "----" + obj.$attrs.constructor.max + "---" + obj.$attrs.constructor.step); expect(obj.$attrs.style).assertEqual('SliderStyle.OutSet'); expect(obj.$attrs.constructor.direction).assertEqual('Axis.Horizontal'); - expect(obj.$attrs.constructor.value).assertEqual('40.000000'); + expect(obj.$attrs.constructor.value).assertEqual('20.000000'); expect(obj.$attrs.constructor.reverse).assertEqual('false'); expect(obj.$attrs.constructor.min).assertEqual('-20.000000'); expect(obj.$attrs.constructor.max).assertEqual('1000.000000'); @@ -234,7 +234,7 @@ export default function sliderJsunit() { let textIn = await driver.findComponent(ON.id('tex')); let txt = await textIn.getText(); console.info('sliderJsunit_0900 component textIn obj is: ' + txt); - expect(txt).assertEqual('40'); + expect(txt).assertEqual('20'); let modeT = await driver.findComponent(ON.id('modeT')); let txtt = await modeT.getText(); console.info('sliderJsunit_0900 modeT component obj is: ' + txtt); 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 bd9f4cf458e1e10f3e724b9768bfde518902367d..1836627467f9e8bc73d142112b8a467bb124ca6d 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 @@ -186,4 +186,4 @@ export default function stepperJsunit() { done(); }); }) -} \ No newline at end of file +} diff --git a/arkui/ace_ets_component_ui/entry/src/main/ets/test/textAreaJsunit.test.ets b/arkui/ace_ets_component_ui/entry/src/main/ets/test/textAreaJsunit.test.ets index a8d0cc877eaf2df624af89f81a6ceb8c5523c7a9..9402e2f3f1868cb4783ed45429a0053477c5465d 100644 --- a/arkui/ace_ets_component_ui/entry/src/main/ets/test/textAreaJsunit.test.ets +++ b/arkui/ace_ets_component_ui/entry/src/main/ets/test/textAreaJsunit.test.ets @@ -56,7 +56,6 @@ export default function textAreaJsunit() { expect(obj.$attrs.placeholderColor).assertEqual('#FFAACCEE'); expect(obj.$attrs.textAlign).assertEqual('TextAlign.End'); expect(obj.$attrs.caretColor).assertEqual('#FFACDEFF'); - expect(obj.$attrs.inputFilter).assertEqual('shang'); expect(obj.$attrs.fontSize).assertEqual('16.00fp'); expect(obj.$attrs.copyOption).assertEqual('CopyOptions.Local'); done(); @@ -73,7 +72,7 @@ export default function textAreaJsunit() { let strJson = getInspectorByKey('textArea'); let obj = JSON.parse(strJson); console.info('textAreaJsunit_0200 component obj is: ' + obj.$attrs.placeholderFont); - //expect(obj.$attrs.placeholderFont).assertEqual('{"style":"FontStyle.Normal","size":"20.00fp","weight":"300","fontFamily":"sans-serif"}'); + expect(obj.$attrs.placeholderFont).assertEqual('{"style":"FontStyle.Normal","size":"20.00fp","weight":"300","fontFamily":"sans-serif"}'); done(); }); @@ -89,7 +88,7 @@ export default function textAreaJsunit() { let strJson = getInspectorByKey('textArea'); let obj = JSON.parse(strJson); console.info('textAreaJsunit_0300 component obj is: ' + obj.$attrs.placeholderFont); - expect(obj.$attrs.placeholderFont).assertEqual('{"style":"FontStyle.Normal","size":"16.00fp","fontWeight":"FontWeight.Normal","fontFamily":"sans-serif"}'); + expect(obj.$attrs.placeholderFont).assertEqual('{"style":"FontStyle.Normal","size":"-30.00fp","fontWeight":"FontWeight.Normal","fontFamily":"sans-serif"}'); done(); }); @@ -166,10 +165,10 @@ export default function textAreaJsunit() { let text = await driver.findComponent(BY.key('textArea')); await text.inputText('123'); await CommonFunc.sleep(2000); - let textIn = await driver.findComponent(BY.key('change')); - let txt = await textIn.getText(); - console.info('textAreaJsunit_0800 component obj is: ' + txt); - expect(txt).assertEqual('test'); + let strJson = getInspectorByKey('change'); + let obj = JSON.parse(strJson); + console.info('textAreaJsunit_0800 component obj is: ' + obj.$attrs.content); + expect(obj.$attrs.content).assertEqual('123'); done(); }); 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 c8c84b33226bda62476a27759dd831bb2f7ae6d8..14ccf7962ddb743ed1c757bc42e734744b18301d 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 @@ -43,56 +43,62 @@ export default function textTwoJsunit() { }); it('textTwoJsunit_0100', 0, async function (done) { - console.info('imageOneJsunit_0100 START'); + console.info('textTwoJsunit_0200 START'); + // test the illegal value of decoration + await CommonFunc.sleep(1000); + globalThis.value.message.notify({name:'type',value:undefined}) + await CommonFunc.sleep(1000); + globalThis.value.message.notify({name:'color',value:undefined}) await CommonFunc.sleep(1000); - // get the image component and test attribute let strJson = getInspectorByKey('text1'); let obj = JSON.parse(strJson); console.info('textTwoJsunit_0100 component obj is: ' + obj.$attrs.decoration); - expect(obj.$attrs.decoration).assertEqual('{"type":"TextDecorationType.None","color":"#FF000000"}'); + expect(obj.$attrs.decoration).assertEqual('{"type":"TextDecorationType.None","color":"#FF000000"}'); + done(); + }); + + it('textTwoJsunit_0200', 0, async function (done) { + console.info('imageOneJsunit_0200 START'); + await CommonFunc.sleep(500); + // get the image component and test attribute + let strJson = getInspectorByKey('text1'); + let obj = JSON.parse(strJson); + console.info('textTwoJsunit_0200 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(2000); + await CommonFunc.sleep(200); let strJson2 = getInspectorByKey('text1'); let obj2 = JSON.parse(strJson2); - console.info('textTwoJsunit_0100 component obj2 is: ' + obj2.$attrs.decoration); + console.info('textTwoJsunit_0200 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(2000); + await CommonFunc.sleep(200); let strJson3 = getInspectorByKey('text1'); let obj3 = JSON.parse(strJson3); - console.info('textTwoJsunit_0100 component obj3 is: ' + obj3.$attrs.decoration); + console.info('textTwoJsunit_0200 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(2000); + await CommonFunc.sleep(200); let strJson4 = getInspectorByKey('text1'); let obj4 = JSON.parse(strJson4); - console.info('textTwoJsunit_0100 component obj4 is: ' + obj4.$attrs.decoration); + console.info('textTwoJsunit_0200 component obj4 is: ' + obj4.$attrs.decoration); expect(obj4.$attrs.decoration).assertEqual('{"type":"TextDecorationType.None","color":"#FFACEEEE"}'); done(); }); - it('textTwoJsunit_0200', 0, async function (done) { - console.info('textTwoJsunit_0200 START'); - // test the illegal value of decoration - await CommonFunc.sleep(1000); - globalThis.value.message.notify({name:'type',value:5}) - await CommonFunc.sleep(1000); - globalThis.value.message.notify({name:'color',value:"#ACE"}) - await CommonFunc.sleep(2000); - let strJson2 = getInspectorByKey('text1'); - let obj2 = JSON.parse(strJson2); - console.info('textTwoJsunit_0200 component obj2 is: ' + obj2.$attrs.decoration); - expect(obj2.$attrs.decoration).assertEqual('{"type":"TextDecorationType.None","color":"#FFAACCEE"}'); - }); + it('textTwoJsunit_0300', 0, async function (done) { console.info('textTwoJsunit_0300 START'); diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignItems/ItemAlign_Auto/FlexTextMarginJsunit.test.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignItems/ItemAlign_Auto/FlexTextMarginJsunit.test.ets index e4401514e7e63ecb81547ee21852ac716742c6e8..98458c85f27cedd4bef8293bc7fe24f5beea8738 100644 --- a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignItems/ItemAlign_Auto/FlexTextMarginJsunit.test.ets +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/alignItems/ItemAlign_Auto/FlexTextMarginJsunit.test.ets @@ -96,8 +96,8 @@ export default function flexTextMargin_AutoJsunit() { let textMargin03 = CommonFunc.getComponentRect('textMargin03'); let flexTextMargin01 = CommonFunc.getComponentRect('flexTextMargin01'); - expect(Math.round(textMargin01.left - flexTextMargin01.left)).assertEqual(Math.round(vp2px(500/17))) - expect(Math.round(textMargin02.left - textMargin01.right)).assertEqual(Math.round(vp2px(500/17))) + expect(Math.round(textMargin01.left - flexTextMargin01.left)).assertEqual(vp2px(30)) + expect(Math.round(textMargin02.left - textMargin01.right)).assertEqual(vp2px(30)) expect(textMargin02.right).assertEqual(textMargin03.left) expect(textMargin03.right).assertEqual(flexTextMargin01.right) @@ -108,9 +108,9 @@ export default function flexTextMargin_AutoJsunit() { expect(Math.round(textMargin01.bottom - textMargin01.top)).assertEqual(vp2px(50)) expect(Math.round(textMargin02.bottom - textMargin02.top)).assertEqual(vp2px(100)) expect(Math.round(textMargin03.bottom - textMargin03.top)).assertEqual(vp2px(150)) - expect(Math.round(textMargin01.right - textMargin01.left)).assertEqual(Math.round(vp2px(2500/17))) - expect(Math.round(textMargin02.right - textMargin02.left)).assertEqual(Math.round(vp2px(2500/17))) - expect(Math.round(textMargin03.right - textMargin03.left)).assertEqual(Math.round(vp2px(2500/17))) + expect(Math.round(textMargin01.right - textMargin01.left)).assertEqual(Math.round(vp2px(440/3))) + expect(Math.round(textMargin02.right - textMargin02.left)).assertEqual(Math.round(vp2px(440/3))) + expect(Math.round(textMargin03.right - textMargin03.left)).assertEqual(Math.round(vp2px(440/3))) expect(obj1.$attrs.constructor.direction).assertEqual('FlexDirection.Row') expect(obj1.$attrs.constructor.alignItems).assertEqual('ItemAlign.Auto') console.info('new SUB_ACE_FLEXALIGNITEMS_AUTO_1500 END'); diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/Center/AlignCenter_AddOneMargin.test.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/Center/AlignCenter_AddOneMargin.test.ets index 7514f878eea31582146d7f6483dd34d022c7b1a5..240606aa2b8e310bfa6d5171c1ef037cc07fdef6 100644 --- a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/Center/AlignCenter_AddOneMargin.test.ets +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/Center/AlignCenter_AddOneMargin.test.ets @@ -104,20 +104,20 @@ export default function AlignCenter_AddOneMargin() { expect(Center_AddOneMargin_01.top).assertEqual(Center_AddOneMargin_012.top); expect(Center_AddOneMargin_013.top).assertEqual(Center_AddOneMargin_012.top); expect(Math.round(Center_AddOneMargin_011.left - Center_AddOneMargin_01.left)) - .assertEqual(Math.round(vp2px(500/17))); + .assertEqual(vp2px(30)); expect(Math.round(Center_AddOneMargin_011.top - Center_AddOneMargin_01.top)).assertEqual(vp2px(30)); expect(Math.round(Center_AddOneMargin_012.left - Center_AddOneMargin_011.right)) - .assertEqual(Math.round(vp2px(500/17))); + .assertEqual(vp2px(30)); expect(Center_AddOneMargin_012.right).assertEqual(Center_AddOneMargin_013.left); expect(Math.round(Center_AddOneMargin_011.bottom - Center_AddOneMargin_011.top)).assertEqual(vp2px(50)); expect(Math.round(Center_AddOneMargin_012.bottom - Center_AddOneMargin_012.top)).assertEqual(vp2px(100)); expect(Math.round(Center_AddOneMargin_013.bottom - Center_AddOneMargin_013.top)).assertEqual(vp2px(150)); expect(Math.round(Center_AddOneMargin_011.right - Center_AddOneMargin_011.left)) - .assertEqual(Math.round(vp2px(2500/17))); + .assertEqual(Math.round(vp2px(440/3))); expect(Math.round(Center_AddOneMargin_012.right - Center_AddOneMargin_012.left)) - .assertEqual(Math.round(vp2px(2500/17))); + .assertEqual(Math.round(vp2px(440/3))); expect(Math.round(Center_AddOneMargin_013.right - Center_AddOneMargin_013.left)) - .assertEqual(Math.round(vp2px(2500/17))); + .assertEqual(Math.round(vp2px(440/3))); console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_CENTER_TEST_1500] END'); done(); }) diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/End/AlignEnd_AddOneMargin.test.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/End/AlignEnd_AddOneMargin.test.ets index ec1c7f504ae6495754819f86b6ce3116a6d2cf7f..09cbf4f0f0e7add0b1c6b1baae1314390a9cb43a 100644 --- a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/End/AlignEnd_AddOneMargin.test.ets +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/End/AlignEnd_AddOneMargin.test.ets @@ -100,8 +100,8 @@ export default function AlignEnd_AddOneMargin() { let End_AddOneMargin_013 = CommonFunc.getComponentRect('End_AddOneMargin_013'); let End_AddOneMargin_01 = CommonFunc.getComponentRect('End_AddOneMargin_01'); expect(Math.round(End_AddOneMargin_011.top - End_AddOneMargin_01.top)).assertEqual(vp2px(30)); - expect(Math.round(End_AddOneMargin_012.left - End_AddOneMargin_011.right)).assertEqual(Math.round(vp2px(500/17))); - expect(Math.round(End_AddOneMargin_011.left - End_AddOneMargin_01.left)).assertEqual(Math.round(vp2px(500/17))); + expect(Math.round(End_AddOneMargin_012.left - End_AddOneMargin_011.right)).assertEqual(vp2px(30)); + expect(Math.round(End_AddOneMargin_011.left - End_AddOneMargin_01.left)).assertEqual(vp2px(30)); expect(End_AddOneMargin_013.top).assertEqual(End_AddOneMargin_012.top); expect(End_AddOneMargin_012.top).assertEqual(End_AddOneMargin_01.top); expect(End_AddOneMargin_013.left).assertEqual(End_AddOneMargin_012.right); @@ -109,9 +109,9 @@ export default function AlignEnd_AddOneMargin() { expect(Math.round(End_AddOneMargin_011.bottom - End_AddOneMargin_011.top)).assertEqual(vp2px(50)); expect(Math.round(End_AddOneMargin_012.bottom - End_AddOneMargin_012.top)).assertEqual(vp2px(100)); expect(Math.round(End_AddOneMargin_013.bottom - End_AddOneMargin_013.top)).assertEqual(vp2px(150)); - expect(Math.round(End_AddOneMargin_011.right - End_AddOneMargin_011.left)).assertEqual(Math.round(vp2px(2500/17))); - expect(Math.round(End_AddOneMargin_012.right - End_AddOneMargin_012.left)).assertEqual(Math.round(vp2px(2500/17))); - expect(Math.round(End_AddOneMargin_013.right - End_AddOneMargin_013.left)).assertEqual(Math.round(vp2px(2500/17))); + expect(Math.round(End_AddOneMargin_011.right - End_AddOneMargin_011.left)).assertEqual(Math.round(vp2px(440/3))); + expect(Math.round(End_AddOneMargin_012.right - End_AddOneMargin_012.left)).assertEqual(Math.round(vp2px(440/3))); + expect(Math.round(End_AddOneMargin_013.right - End_AddOneMargin_013.left)).assertEqual(Math.round(vp2px(440/3))); console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_END_TEST_1500] END'); done(); }) diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/SpaceEvenly/AlignSpaceEvenly_AddOneMargin.test.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/SpaceEvenly/AlignSpaceEvenly_AddOneMargin.test.ets index 296ee6974bd94bbfcca771a6dcf0493226a00c2a..4658a93c65f659e21190b1e3f4aea2e13dd2a5c1 100644 --- a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/SpaceEvenly/AlignSpaceEvenly_AddOneMargin.test.ets +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/SpaceEvenly/AlignSpaceEvenly_AddOneMargin.test.ets @@ -105,7 +105,7 @@ export default function AlignSpaceEvenly_AddOneMargin() { let SpaceEvenly_AddOneMargin_01 = CommonFunc.getComponentRect('SpaceEvenly_AddOneMargin_01'); expect(Math.round(SpaceEvenly_AddOneMargin_011.top - SpaceEvenly_AddOneMargin_01.top)).assertEqual(vp2px(30)); expect(Math.round(SpaceEvenly_AddOneMargin_011.left - SpaceEvenly_AddOneMargin_01.left)) - .assertEqual(Math.round(vp2px(500/17))); + .assertEqual(vp2px(30)); expect(Math.round(SpaceEvenly_AddOneMargin_012.left - SpaceEvenly_AddOneMargin_011.right)) .assertEqual(Math.round(SpaceEvenly_AddOneMargin_011.left - SpaceEvenly_AddOneMargin_01.left)); expect(SpaceEvenly_AddOneMargin_013.right).assertEqual(SpaceEvenly_AddOneMargin_01.right); @@ -116,11 +116,11 @@ export default function AlignSpaceEvenly_AddOneMargin() { expect(Math.round(SpaceEvenly_AddOneMargin_012.bottom - SpaceEvenly_AddOneMargin_012.top)).assertEqual(vp2px(100)); expect(Math.round(SpaceEvenly_AddOneMargin_013.bottom - SpaceEvenly_AddOneMargin_013.top)).assertEqual(vp2px(150)); expect(Math.round(SpaceEvenly_AddOneMargin_011.right - SpaceEvenly_AddOneMargin_011.left)) - .assertEqual(Math.round(vp2px(2500/17))); + .assertEqual(Math.round(vp2px(440/3))); expect(Math.round(SpaceEvenly_AddOneMargin_012.right - SpaceEvenly_AddOneMargin_012.left)) - .assertEqual(Math.round(vp2px(2500/17))); + .assertEqual(Math.round(vp2px(440/3))); expect(Math.round(SpaceEvenly_AddOneMargin_013.right - SpaceEvenly_AddOneMargin_013.left)) - .assertEqual(Math.round(vp2px(2500/17))); + .assertEqual(Math.round(vp2px(440/3))); console.info('[SUB_ACE_FLEX_JUSTIFYCONTENT_FLEXALIGN_SPACEEVENLY_TEST_1600] END'); done(); }) diff --git a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/Start/AlignStart_AddOneMargin.test.ets b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/Start/AlignStart_AddOneMargin.test.ets index c8392735b66e8a17ddf3341d95c4a976c66663e6..009c50fd00b6d4f13076e692040065d31c52b4eb 100644 --- a/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/Start/AlignStart_AddOneMargin.test.ets +++ b/arkui/ace_ets_layout_test/entry/src/main/ets/test/Flex/justifyContent/Start/AlignStart_AddOneMargin.test.ets @@ -104,16 +104,16 @@ export default function AlignStart_AddOneMargin() { expect(Start_AddOneMargin_013.left).assertEqual(Start_AddOneMargin_012.right); expect(Start_AddOneMargin_013.right).assertEqual(Start_AddOneMargin_01.right); expect(Math.round(Start_AddOneMargin_012.left - Start_AddOneMargin_011.right)) - .assertEqual(Math.round(vp2px(500/17))); + .assertEqual(vp2px(30)); expect(Math.round(Start_AddOneMargin_011.top - Start_AddOneMargin_01.top)).assertEqual(vp2px(30)); expect(Math.round(Start_AddOneMargin_011.left - Start_AddOneMargin_01.left)) - .assertEqual(Math.round(vp2px(500/17))); + .assertEqual(vp2px(30)); expect(Math.round(Start_AddOneMargin_011.right - Start_AddOneMargin_011.left)) - .assertEqual(Math.round(vp2px(2500/17))); + .assertEqual(Math.round(vp2px(440/3))); expect(Math.round(Start_AddOneMargin_012.right - Start_AddOneMargin_012.left)) - .assertEqual(Math.round(vp2px(2500/17))); + .assertEqual(Math.round(vp2px(440/3))); expect(Math.round(Start_AddOneMargin_013.right - Start_AddOneMargin_013.left)) - .assertEqual(Math.round(vp2px(2500/17))); + .assertEqual(Math.round(vp2px(440/3))); expect(Math.round(Start_AddOneMargin_011.bottom - Start_AddOneMargin_011.top)).assertEqual(vp2px(50)); expect(Math.round(Start_AddOneMargin_012.bottom - Start_AddOneMargin_012.top)).assertEqual(vp2px(100)); expect(Math.round(Start_AddOneMargin_013.bottom - Start_AddOneMargin_013.top)).assertEqual(vp2px(150));