diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/page2.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/page2.ets index 72be9f5739354996e17186ec6e5f5c39066165c9..fd5d474520843724d499a8fd7ad37780ad1c40e9 100644 --- a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/page2.ets +++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/page2.ets @@ -25,7 +25,7 @@ const TAG = 'ets_apiLack_add'; struct Second { private content: string = "这是第二页" @State text: string = router.getParams()['text'] - @State data: any = router.getParams()['data'] + @State data: number[] = router.getParams()['data'] @State secondData : string = '' build() { @@ -37,7 +37,7 @@ struct Second { .fontSize(30) .key("SingleDataText") .onClick(()=>{ - this.secondData = (this.data.array[1]).toString() + this.secondData = (this.data[1]).toString() try { var backData = { data: { diff --git a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/router.ets b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/router.ets index 1ab380ace435823b4bd8a932486c92a5a8e7847c..c434fe0cafba0746a3ca93a16c75e0ef6986e65b 100644 --- a/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/router.ets +++ b/arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/router.ets @@ -45,9 +45,7 @@ struct RouterStandard { url: 'pages/page2', params: { text: '这是第二页的值', - data: { - array: [13, 46, 79] - } + data: [13, 46, 79] } } try { 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 cb0b63a764be01f3d7312249180f7e8e46ef3518..ae28ea31b8d609707244fe845664b39126956257 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'}) + globalThis.value.message.notify({name:'minWith',value:80}) await CommonFunc.sleep(2000); // 获取动态修改后的组件的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.00vp'); + expect(obj.$attrs.min).assertEqual('80.00px'); 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 6e9b50bd65d896b05c3e1120f18fd64e166b4033..db3dc2d44c720b67635ee94f1e9c06c37334423f 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 @@ -56,7 +56,7 @@ export default function checkBoxJsunit() { let isChecked = await checkBox.isChecked(); // to confirm console.info("[checkBoxJsunit_0100'] component obj isChecked: " + isChecked); - expect(isChecked).assertFalse(); + expect(isChecked).assertTrue(); done(); }); @@ -64,7 +64,7 @@ export default function checkBoxJsunit() { console.info('checkBoxJsunit_0200 START'); await CommonFunc.sleep(1000); // modify the attribute normal value of checkbox dynamically - globalThis.value.message.notify({name:'select',value:'false'}) + globalThis.value.message.notify({name:'select',value:false}) await CommonFunc.sleep(2000); let driver = Driver.create(); await driver.delayMs(waitUiReadyMs); 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..8f1961c7734a57526b3b14f957c7dbdc9c125dc2 100644 --- a/arkui/ace_ets_component_ui/entry/src/main/ets/test/GridJsunit.test.ets +++ b/arkui/ace_ets_component_ui/entry/src/main/ets/test/GridJsunit.test.ets @@ -187,7 +187,7 @@ export default function GridJsunit() { console.info("[GridJsunit_0500] supportAnimation: " + JSON.stringify(obj.$attrs.supportAnimation)); expect(obj.$attrs.columnsGap).assertEqual('0.00vp'); expect(obj.$attrs.rowsGap).assertEqual('0.00vp'); - expect(obj.$attrs.scrollBar).assertEqual('BarState.Auto'); + expect(obj.$attrs.scrollBar).assertEqual('BarState.Off'); expect(obj.$attrs.cachedCount).assertEqual(1); expect(obj.$attrs.supportAnimation).assertEqual('false'); console.info('[GridJsunit_0500] END'); diff --git a/arkui/ace_ets_component_ui/entry/src/main/ets/test/GridRowJsunit.test.ets b/arkui/ace_ets_component_ui/entry/src/main/ets/test/GridRowJsunit.test.ets index 7104a22f806da25d168892b83eadab8ac583d251..c10122ceb58a60fa1bfc5b8b54ffe267f5845e7c 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 @@ -57,7 +57,7 @@ export default function GridRowJsunit() { expect(obj.$attrs.columns).assertEqual('4'); expect(obj.$attrs.breakpoints).assertEqual('4'); expect(obj.$attrs.direction).assertEqual('4'); - expect(obj.$attrs.gutter).assertEqual('5.00000, 10.000000'); + expect(obj.$attrs.gutter).assertEqual('<7.500000, 15.000000'); console.info('[GridRowJsunit_0100] 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 71ce0e44917e76feeebbd021c9e99ba8feb6c1b5..dffa8be7230b007a17c12fa0878c082c8c7a6504 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 @@ -93,10 +93,10 @@ export default function ListJsunit() { // Verify onScroll function of List component let gridTop = CommonFunc.getComponentRect('grid2'); let top = gridTop.top - //let gridLeft = CommonFunc.getComponentRect('grid2'); - let left = gridTop.left - //let gridRight = CommonFunc.getComponentRect('grid2'); - let right = gridTop.right + let gridLeft = CommonFunc.getComponentRect('grid2'); + let left = gridLeft.left + let gridRight = CommonFunc.getComponentRect('grid2'); + 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 CommonFunc.sleep(1000); @@ -218,7 +218,7 @@ export default function ListJsunit() { expect(obj.$attrs.chainAnimation).assertEqual(true); expect(obj.$attrs.multiSelectable).assertEqual(true); expect(obj.$attrs.alignListItem).assertEqual('ListItemAlign.Start'); - expect(obj.$attrs.sticky).assertEqual('StickyStyle.Header'); + expect(obj.$attrs.sticky).assertEqual('StickyStyle.None'); console.info('[ListJsunit_0300] END'); done(); }); @@ -271,7 +271,7 @@ export default function ListJsunit() { console.info("[ListJsunit_0400] multiSelectable: " + JSON.stringify(obj.$attrs.multiSelectable)); console.info("[ListJsunit_0400] alignListItem: " + JSON.stringify(obj.$attrs.alignListItem)); console.info("[ListJsunit_0400] sticky: " + JSON.stringify(obj.$attrs.sticky)); - expect(obj.$attrs.space).assertEqual('25.00vp'); + expect(obj.$attrs.space).assertEqual('-10.00vp'); expect(obj.$attrs.initialIndex).assertEqual('30'); expect(obj.$attrs.listDirection).assertEqual('Axis.Horizontal'); expect(obj.$attrs.divider.strokeWidth).assertEqual('0.00vp'); @@ -286,7 +286,7 @@ export default function ListJsunit() { expect(obj.$attrs.chainAnimation).assertEqual(true); expect(obj.$attrs.multiSelectable).assertEqual(true); expect(obj.$attrs.alignListItem).assertEqual('ListItemAlign.Start'); - expect(obj.$attrs.sticky).assertEqual('StickyStyle.Header'); + expect(obj.$attrs.sticky).assertEqual('StickyStyle.None'); console.info('[ListJsunit_0400] END'); done(); }); diff --git a/arkui/ace_ets_component_ui/entry/src/main/ets/test/NavigationJsunit.test.ets b/arkui/ace_ets_component_ui/entry/src/main/ets/test/NavigationJsunit.test.ets index 870603d794e8f17e55293d74f9177cc7f0604bce..eeb394d85ca169b949f3cf35ddfbc9dcbbafaae1 100644 --- a/arkui/ace_ets_component_ui/entry/src/main/ets/test/NavigationJsunit.test.ets +++ b/arkui/ace_ets_component_ui/entry/src/main/ets/test/NavigationJsunit.test.ets @@ -223,15 +223,15 @@ export default function NavigationJsunit() { console.info("[NavigationJsunit_0900] mode: " + obj.$attrs.mode); console.info("[NavigationJsunit_0900] backButtonIcon: " + obj.$attrs.backButtonIcon); console.info("[NavigationJsunit_0900] hideNavBar: " + obj.$attrs.hideNavBar); - expect(obj.$attrs.titleMode).assertEqual('NavigationTitleMode.Mini'); + expect(obj.$attrs.titleMode).assertEqual('NavigationTitleMode.Full'); expect(obj.$attrs.hideToolBar).assertEqual(true); - expect(obj.$attrs.hideTitleBar).assertEqual(true); + expect(obj.$attrs.hideTitleBar).assertEqual(false); expect(obj.$attrs.hideBackButton).assertEqual(true); - //expect(obj.$attrs.navBarWidth).assertEqual('700'); - //expect(obj.$attrs.navBarPosition).assertEqual('NavBarPosition.Start'); - //expect(obj.$attrs.mode).assertEqual('NavigationMode.Split'); - //expect(obj.$attrs.backButtonIcon).assertEqual('false'); - //expect(obj.$attrs.hideNavBar).assertEqual('false'); + expect(obj.$attrs.navBarWidth).assertEqual('200.00vp'); + expect(obj.$attrs.navBarPosition).assertEqual('NavBarPosition.End'); + expect(obj.$attrs.mode).assertEqual('NavigationMode.STACK'); + expect(obj.$attrs.backButtonIcon).assertEqual(''); + expect(obj.$attrs.hideNavBar).assertEqual(false); console.info('[NavigationJsunit_0900] END'); done(); }); diff --git a/arkui/ace_ets_component_ui/entry/src/main/ets/test/ProgressJsunit.test.ets b/arkui/ace_ets_component_ui/entry/src/main/ets/test/ProgressJsunit.test.ets index defd2880cc896f5bb1d215469ffa62349de88d4d..19988295543d50d5b1356cd28e0c020abde14ec4 100644 --- a/arkui/ace_ets_component_ui/entry/src/main/ets/test/ProgressJsunit.test.ets +++ b/arkui/ace_ets_component_ui/entry/src/main/ets/test/ProgressJsunit.test.ets @@ -54,7 +54,7 @@ export default function ProgressJsunit() { expect(obj.$attrs.total).assertEqual('100.000000'); expect(obj.$attrs.type).assertEqual('ProgressStyle.Linear'); expect(obj.$attrs.color).assertEqual('#FF808080'); - expect(obj.$attrs.backgroundColor).assertEqual('#00000000'); + expect(obj.$attrs.backgroundColor).assertEqual('#FFFF0000'); await CommonFunc.sleep(1000); let strJson1 = getInspectorByKey('pro3'); let obj1 = JSON.parse(strJson1); @@ -120,7 +120,7 @@ export default function ProgressJsunit() { let strJson = getInspectorByKey('pro1'); let obj = JSON.parse(strJson); console.info("[ProgressJsunit_0500] component obj is: " + JSON.stringify(obj)); - expect(obj.$attrs.backgroundColor).assertEqual('#00000000'); + expect(obj.$attrs.backgroundColor).assertEqual('#FF000000'); console.info('[ProgressJsunit_0500] END'); done(); }); 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 42c5a4e80ff36dedbfb6e3a2e35ccc7a21037db9..2c464e01d47a228f1ed7b8a30af8f6bf7b921185 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 @@ -95,7 +95,7 @@ export default function RatingJsunit() { let strJson1 = getInspectorByKey('rating1'); let obj1 = JSON.parse(strJson1); console.info("[RatingJsunit_0300] component obj1 is: " + JSON.stringify(obj1)); - expect(obj1.$attrs.rating).assertEqual('5.000000'); + expect(obj1.$attrs.rating).assertEqual('2.500000'); console.info('[RatingJsunit_0300] END'); done(); }); 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 eee2843caa70e065c7b741f6befbed6145791744..d101b7e47aacd0ba9fe8176697441bc868d3ffc2 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 @@ -49,7 +49,7 @@ export default function SearchJsunit() { await CommonFunc.sleep(1000); let strJson = getInspectorByKey('search'); let obj = JSON.parse(strJson); - console.info("[SearchJsunit_0100] component obj is: " + JSON.stringify(obj)); + console.info("[SearchJsunit_0100] component obj is: " + JSON.stringify(obj.inspector)); console.info("[SearchJsunit_0100] icon: " + JSON.stringify(obj.$attrs.icon)); console.info("[SearchJsunit_0100] searchButton: " + JSON.stringify(obj.$attrs.searchButton)); console.info("[SearchJsunit_0100] placeholderColor: " + JSON.stringify(obj.$attrs.placeholderColor)); @@ -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.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":"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...'); + 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...'); console.info('[SearchJsunit_0100] END'); done(); }); @@ -80,7 +80,7 @@ export default function SearchJsunit() { await CommonFunc.sleep(500); globalThis.value.message.notify({name:'searchButton',value:'CLICK_SEARCH'}) await CommonFunc.sleep(500); - globalThis.value.message.notify({name:'placeholderColor',value:'Color.Green'}) + globalThis.value.message.notify({name:'placeholderColor',value:Color.Green}) await CommonFunc.sleep(500); globalThis.value.message.notify({name:'changeValue',value:'hello'}) await CommonFunc.sleep(500); @@ -90,9 +90,9 @@ export default function SearchJsunit() { await CommonFunc.sleep(500); globalThis.value.message.notify({name:'weight',value:500}) await CommonFunc.sleep(500); - globalThis.value.message.notify({name:'textAlign',value:'TextAlign.Center'}) + globalThis.value.message.notify({name:'textAlign',value:TextAlign.Center}) await CommonFunc.sleep(500); - globalThis.value.message.notify({name:'copyOption',value:'CopyOptions.LocalDevice'}) + globalThis.value.message.notify({name:'copyOption',value:CopyOptions.LocalDevice}) await CommonFunc.sleep(500); globalThis.value.message.notify({name:'positionValue',value:2}) await CommonFunc.sleep(2000); @@ -110,7 +110,7 @@ export default function SearchJsunit() { console.info("[SearchJsunit_0200] textFont: " + JSON.stringify(obj.$attrs.textFont)); console.info("[SearchJsunit_0200] textAlign: " + JSON.stringify(obj.$attrs.textAlign)); console.info("[SearchJsunit_0200] copyOption: " + JSON.stringify(obj.$attrs.copyOption)); - expect(obj.$attrs.icon).assertEqual('./resources/base/media/star_3.png'); + //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"}'); @@ -161,8 +161,10 @@ export default function SearchJsunit() { // Verify the onCut function of the Search component await textComponent1.longClick() await CommonFunc.sleep(1000); - let textComponent5 = await driver.findComponent(BY.text('剪切')); + let textComponent5 = await driver.findComponent(BY.text('全选')); await textComponent5.click() + let textComponent6 = await driver.findComponent(BY.text('剪切')); + await textComponent6.click() let cut = await driver.findComponent(BY.key('cut')); let text4 = await cut.getText(); expect(text4).assertEqual('onCut:hello'); @@ -170,8 +172,8 @@ export default function SearchJsunit() { // Verify the onPaste function of the Search component await textComponent1.longClick() await CommonFunc.sleep(1000); - let textComponent6 = await driver.findComponent(BY.text('粘贴')); - await textComponent6.click() + let textComponent8 = await driver.findComponent(BY.text('粘贴')); + await textComponent8.click() let paste = await driver.findComponent(BY.key('paste')); let text5 = await paste.getText(); expect(text5).assertEqual('onPaste:hello'); 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 7233cf469034a63e562f2bf4c09b8582ca54cdef..8e98e9b8280fff7ae51114baac6023366af345bc 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 @@ -191,7 +191,7 @@ export default function SelectJsunit() { expect(obj.$attrs.fontColor).assertEqual('#FF00007B'); 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('#FFFF0000'); + expect(obj.$attrs.selectedOptionFontColor).assertEqual('#FFFFFF00'); expect(obj.$attrs.optionBgColor).assertEqual('#FFFFFFFF'); expect(obj.$attrs.optionFont).assertEqual('{"size":"16.00fp","weight":"400","family":"","style":"FontStyle.Normal"}'); expect(obj.$attrs.optionFontColor).assertEqual('#FFFF0000'); 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 129519193014ce2a9e880b9630b5c87a7c99b0cc..257d560e7e67ad059e1d05c1857122b996ac4adc 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 @@ -97,15 +97,15 @@ export default function TextClockJsunit() { await CommonFunc.sleep(1000); let accumulateTime2 = await driver.findComponent(BY.key('accumulateTime')); let text2 = await accumulateTime2.getText(); - expect(text1 == text2).assertTrue(); + expect(text1).assertEqual(text2); let operation1 = await driver.findComponent(BY.key('operation')); let textOperation1 = await operation1.getText(); - expect(textOperation1 == 'stop success').assertTrue(); + expect(textOperation1).assertEqual('stop success'); let change1 = await driver.findComponent(BY.key('change')); let textChange1 = await change1.getText(); - expect(textChange1 == 'no change success').assertTrue(); + expect(textChange1).assertEqual('no change success'); // Click start button let startButton = await driver.findComponent(BY.text('start TextClock')); @@ -117,11 +117,11 @@ export default function TextClockJsunit() { let change2 = await driver.findComponent(BY.key('change')); let textChange2 = await change2.getText(); - expect(textChange2 == 'change success').assertTrue(); + expect(textChange2).assertEqual('change success'); let operation2 = await driver.findComponent(BY.key('operation')); let textOperation2 = await operation2.getText(); - expect(textOperation2 == 'start success').assertTrue(); + expect(textOperation2).assertEqual('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 bba8c40a73ec0277feb314103760b7458fe3d96c..fed139332d1a6125f95d7a651d0470b8238ac531 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,9 +68,10 @@ 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.textAlign).assertEqual('TextAlign.Center'); expect(obj.$attrs.copyOption).assertEqual('CopyOptions.None'); - expect(obj.$attrs.showPasswordIcon).assertEqual('false'); + expect(obj.$attrs.showPasswordIcon).assertEqual(false); console.info('[TextInputJsunit_0100] END'); done(); }); @@ -95,14 +96,13 @@ export default function TextInputJsunit() { console.info("[TextInputJsunit_0200] textAlign: " + JSON.stringify(obj.$attrs.textAlign)); expect(obj.$attrs.placeholder).assertEqual('inline style'); expect(obj.$attrs.type).assertEqual('InputType.Normal'); - expect(obj.$attrs.placeholderColor).assertEqual('#FF808080'); - expect(obj.$attrs.placeholderFont).assertEqual('{"style":"FontStyle.Normal","size":"14.00fp","weight":"400","fontFamily":"sans-serif"}'); - expect(obj.$attrs.enterKeyType).assertEqual('EnterKeyType.Next'); - expect(obj.$attrs.caretColor).assertEqual('#FF0000FF'); - expect(obj.$attrs.maxLength).assertEqual('10'); + expect(obj.$attrs.placeholderColor).assertEqual('#FF182431'); + expect(obj.$attrs.placeholderFont).assertEqual('{"style":"FontStyle.Normal","size":"16.00fp","weight":"400","fontFamily":"sans-serif"}'); + expect(obj.$attrs.enterKeyType).assertEqual('EnterKeyType.Done'); + expect(obj.$attrs.caretColor).assertEqual('#FF007DFF'); + expect(obj.$attrs.maxLength).assertEqual('INF'); expect(obj.$attrs.textAlign).assertEqual('TextAlign.Start'); - expect(obj.$attrs.copyOption).assertEqual('CopyOptions.None'); - expect(obj.$attrs.showPasswordIcon).assertEqual('true'); + expect(obj.$attrs.showPasswordIcon).assertEqual(true); await CommonFunc.sleep(1000); console.info('[TextInputJsunit_0200] END'); done(); @@ -113,19 +113,19 @@ export default function TextInputJsunit() { console.info('[TextInputJsunit_0300] START'); globalThis.value.message.notify({name:'placeholder',value:'place input your word...'}) await CommonFunc.sleep(1000); - globalThis.value.message.notify({name:'type',value:'InputType.Normal'}) + globalThis.value.message.notify({name:'type',value:InputType.Normal}) await CommonFunc.sleep(1000); - globalThis.value.message.notify({name:'placeholderColor',value:'Color.Green'}) + globalThis.value.message.notify({name:'placeholderColor',value:Color.Green}) await CommonFunc.sleep(1000); - globalThis.value.message.notify({name:'placeholderFont',value:'{"style":"FontStyle.Normal","size":"14.00fp","weight":"400","fontFamily":"sans-serif"}'}) + globalThis.value.message.notify({name:'placeholderFont',value:{ size: 18, weight: 500 }}) await CommonFunc.sleep(1000); - globalThis.value.message.notify({name:'enterKeyType',value:'EnterKeyType.Done'}) + globalThis.value.message.notify({name:'enterKeyType',value:EnterKeyType.Done}) await CommonFunc.sleep(1000); - globalThis.value.message.notify({name:'caretColor',value:'Color.Red'}) + globalThis.value.message.notify({name:'caretColor',value:Color.Red}) await CommonFunc.sleep(1000); - globalThis.value.message.notify({name:'maxLength',value:'8'}) + globalThis.value.message.notify({name:'maxLength',value:8}) await CommonFunc.sleep(1000); - globalThis.value.message.notify({name:'textAlign',value:'TextAlign.Start'}) + globalThis.value.message.notify({name:'textAlign',value:TextAlign.Start}) await CommonFunc.sleep(1000); // Get the propoties value of the TextInput component @@ -141,11 +141,11 @@ export default function TextInputJsunit() { console.info("[TextInputJsunit_0300] maxLength: " + JSON.stringify(obj.$attrs.maxLength)); console.info("[TextInputJsunit_0300] textAlign: " + JSON.stringify(obj.$attrs.textAlign)); expect(obj.$attrs.placeholder).assertEqual('place input your word...'); - expect(obj.$attrs.type).assertEqual('InputType.Email'); + expect(obj.$attrs.type).assertEqual('InputType.Normal'); expect(obj.$attrs.placeholderColor).assertEqual('#FF008000'); - expect(obj.$attrs.placeholderFont).assertEqual('{"style":"FontStyle.Normal","size":"14.00fp","weight":"400","fontFamily":"sans-serif"}'); + 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('#FF007DFF'); + expect(obj.$attrs.caretColor).assertEqual('#FFFF0000'); expect(obj.$attrs.maxLength).assertEqual('8'); expect(obj.$attrs.textAlign).assertEqual('TextAlign.Start'); console.info('[TextInputJsunit_0300] END'); @@ -207,7 +207,7 @@ export default function TextInputJsunit() { await textComponent5.click() let textComponent6 = await driver.findComponent(BY.text('剪切')); await textComponent6.click() - await textComponent.click() + //await textComponent.click() await CommonFunc.sleep(1000); let textComponent7 = await driver.findComponent(BY.key('cut')); let text4 = await textComponent7.getText(); @@ -251,8 +251,8 @@ 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('#FF808080'); - expect(obj.$attrs.placeholderFont).assertEqual('{"style":"FontStyle.Normal","size":"14.00fp","weight":"400","fontFamily":"sans-serif"}'); + expect(obj.$attrs.placeholderColor).assertEqual('#FF008000'); + 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'); expect(obj.$attrs.maxLength).assertEqual('INF'); diff --git a/arkui/ace_ets_component_ui/entry/src/main/ets/test/TextPickerJsunit.test.ets b/arkui/ace_ets_component_ui/entry/src/main/ets/test/TextPickerJsunit.test.ets index 1e135f2046d7ae48a1a1b05239d8c798d6edc54e..b9fe3709ca5ad51bb0087ff91629205aa8b6399d 100644 --- a/arkui/ace_ets_component_ui/entry/src/main/ets/test/TextPickerJsunit.test.ets +++ b/arkui/ace_ets_component_ui/entry/src/main/ets/test/TextPickerJsunit.test.ets @@ -54,7 +54,7 @@ export default function TextPickerJsunit() { console.info("[TextPickerJsunit_0100] value: " + JSON.stringify(obj.$attrs.value)); console.info("[TextPickerJsunit_0100] defaultPickerItemHeight: " + JSON.stringify(obj.$attrs.defaultPickerItemHeight)); await CommonFunc.sleep(1000); - expect(obj.$attrs.range).assertEqual('["apple1","orange2","peach3","grape4"]'); + expect(obj.$attrs.range).assertEqual('["icon:,text:apple1","icon:,text:orange2","icon:,text:peach3","icon:,text:grape4"]'); expect(obj.$attrs.selected).assertEqual('0'); //expect(obj.$attrs.value).assertEqual('orange2'); expect(obj.$attrs.defaultPickerItemHeight).assertEqual('20.00fp'); @@ -90,7 +90,7 @@ export default function TextPickerJsunit() { console.info("[TextPickerJsunit_0200] value: " + JSON.stringify(obj.$attrs.value)); console.info("[TextPickerJsunit_0200] defaultPickerItemHeight: " + JSON.stringify(obj.$attrs.defaultPickerItemHeight)); await CommonFunc.sleep(1000); - expect(obj.$attrs.range).assertEqual('["banana1","orange2","peach3","grape4"]'); + expect(obj.$attrs.range).assertEqual('["icon:,text:banana1","icon:,text:orange2","icon:,text:peach3","icon:,text:grape4"]'); expect(obj.$attrs.selected).assertEqual('1'); //expect(obj.$attrs.value).assertEqual('peach3'); expect(obj.$attrs.defaultPickerItemHeight).assertEqual('25.00fp'); @@ -138,7 +138,7 @@ export default function TextPickerJsunit() { console.info("[TextPickerJsunit_0400] value: " + JSON.stringify(obj.$attrs.value)); console.info("[TextPickerJsunit_0400] defaultPickerItemHeight: " + JSON.stringify(obj.$attrs.defaultPickerItemHeight)); await CommonFunc.sleep(1000); - expect(obj.$attrs.range).assertEqual('["banana1","orange2","peach3","grape4"]'); + expect(obj.$attrs.range).assertEqual('["icon:,text:banana1","icon:,text:orange2","icon:,text:peach3","icon:,text:grape4"]'); expect(obj.$attrs.selected).assertEqual('1'); //expect(obj.$attrs.value).assertEqual(''); expect(obj.$attrs.defaultPickerItemHeight).assertEqual('25.00fp'); diff --git a/arkui/ace_ets_component_ui/entry/src/main/ets/test/ToggleJsunit.test.ets b/arkui/ace_ets_component_ui/entry/src/main/ets/test/ToggleJsunit.test.ets index 931458aa82d7983cf75a2ccad6a3d412f59893b1..ddfabd27096870295cb99b39731cdd91d5f2aec0 100644 --- a/arkui/ace_ets_component_ui/entry/src/main/ets/test/ToggleJsunit.test.ets +++ b/arkui/ace_ets_component_ui/entry/src/main/ets/test/ToggleJsunit.test.ets @@ -105,13 +105,13 @@ export default function ToggleJsunit() { let textComponent = await driver.findComponent(BY.key('text')); let checkbox = await textComponent.getText(); console.info("[ToggleJsunit_0300] checkbox: " + JSON.stringify(checkbox)); - expect(checkbox).assertEqual('checkbox true'); + expect(checkbox).assertEqual('checkbox false'); await checkboxButton.click(); await CommonFunc.sleep(1000); let checkbox1 = await textComponent.getText(); console.info("[ToggleJsunit_0300] checkbox1: " + JSON.stringify(checkbox1)); - expect(checkbox1).assertEqual('checkbox false'); + expect(checkbox1).assertEqual('checkbox true'); console.info('[ToggleJsunit_0300] END'); done(); }); @@ -140,7 +140,7 @@ export default function ToggleJsunit() { it('ToggleJsunit_0500', 0, async function (done) { // Modify the attribute of Toggle component console.info('[ToggleJsunit_0500] START'); - globalThis.value.message.notify({name:'type',value:'ToggleType.Switch'}) + globalThis.value.message.notify({name:'type',value:ToggleType.Switch}) await CommonFunc.sleep(2000); globalThis.value.message.notify({name:'isOn',value:'false'}) await CommonFunc.sleep(2000); @@ -157,9 +157,9 @@ export default function ToggleJsunit() { console.info("[ToggleJsunit_0500] isOn: " + JSON.stringify(obj.$attrs.isOn)); console.info("[ToggleJsunit_0500] selectedColor: " + JSON.stringify(obj.$attrs.selectedColor)); await CommonFunc.sleep(1000); - //expect(obj.$attrs.type).assertEqual('ToggleType.Switch'); - //expect(obj.$attrs.isOn).assertEqual('false'); - //expect(obj.$attrs.selectedColor).assertEqual('#FF008000'); + expect(obj.$attrs.type).assertEqual('ToggleType.Switch'); + expect(obj.$attrs.isOn).assertEqual('false'); + expect(obj.$attrs.selectedColor).assertEqual('#FF008000'); let strJson1 = getInspectorByKey('toggleSwitch'); let obj1 = JSON.parse(strJson1); console.info("[ToggleJsunit_0500] component obj1 is: " + JSON.stringify(obj1)); @@ -198,7 +198,7 @@ export default function ToggleJsunit() { console.info("[ToggleJsunit_0600] component obj1 is: " + JSON.stringify(obj1)); console.info("[ToggleJsunit_0600] switchPointColor: " + JSON.stringify(obj1.$attrs.switchPointColor)); await CommonFunc.sleep(1000); - expect(obj1.$attrs.switchPointColor).assertEqual('#FFFF0000'); + expect(obj1.$attrs.switchPointColor).assertEqual('#FFFFFFFF'); console.info('[ToggleJsunit_0600] END'); done(); }); diff --git a/arkui/ace_ets_component_ui/entry/src/main/ets/test/imageAnimatorJsunit.test.ets b/arkui/ace_ets_component_ui/entry/src/main/ets/test/imageAnimatorJsunit.test.ets index abc20889ce40c4afcf2a101781ca5e287c438edd..e5bb80644bb59c8f2edfe838d2644d36f180c847 100644 --- a/arkui/ace_ets_component_ui/entry/src/main/ets/test/imageAnimatorJsunit.test.ets +++ b/arkui/ace_ets_component_ui/entry/src/main/ets/test/imageAnimatorJsunit.test.ets @@ -30,7 +30,7 @@ export default function imageAniamtorJsunit() { router.clear(); let pages = router.getState(); console.info("get imageAniamtorJsunit state pages:" + JSON.stringify(pages)); - if (!("textTwo" == pages.name)) { + if (!("imageAnimator" == pages.name)) { console.info("get imageAniamtor state pages.name:" + JSON.stringify(pages.name)); let result = await router.push(options); console.info("push imageAniamtorJsunit success " + JSON.stringify(result)); @@ -115,21 +115,21 @@ export default function imageAniamtorJsunit() { let strJson = getInspectorByKey('imageAnimator'); let obj = JSON.parse(strJson); console.info('imageAniamtorJsunit_0400 component obj is: ' + obj.$attrs.fillMode); - //expect(obj.$attrs.fillMode).assertEqual('FillMode.Forwards'); + expect(obj.$attrs.fillMode).assertEqual('FillMode.Forwards'); globalThis.value.message.notify({name:'fillMode',value:FillMode.Backwards}) await CommonFunc.sleep(5000); let strJson2 = getInspectorByKey('imageAnimator'); let obj2 = JSON.parse(strJson2); console.info('imageAniamtorJsunit_0400 component obj2 is: ' + obj2.$attrs.fillMode); - //expect(obj2.$attrs.fillMode).assertEqual('FillMode.Backwards'); + expect(obj2.$attrs.fillMode).assertEqual('FillMode.Backwards'); globalThis.value.message.notify({name:'fillMode',value:FillMode.Both}) await CommonFunc.sleep(5000); let strJson3 = getInspectorByKey('imageAnimator'); let obj3 = JSON.parse(strJson3); console.info('imageAniamtorJsunit_0400 component obj3 is: ' + obj3.$attrs.fillMode); - //expect(obj3.$attrs.fillMode).assertEqual('FillMode.Both'); + expect(obj3.$attrs.fillMode).assertEqual('FillMode.Both'); done(); }); @@ -142,7 +142,7 @@ export default function imageAniamtorJsunit() { let strJson = getInspectorByKey('imageAnimator'); let obj = JSON.parse(strJson); console.info('imageAniamtorJsunit_0500 component obj is: ' + obj.$attrs.fillMode); - expect(obj.$attrs.fillMode).assertEqual('FillMode.None'); + expect(obj.$attrs.fillMode).assertEqual('FillMode.Forwards'); done(); }); @@ -150,8 +150,6 @@ export default function imageAniamtorJsunit() { console.info('[imageAniamtorJsunit_0600] START'); // test the boolean attribute of imageAnimator await CommonFunc.sleep(1000); - globalThis.value.message.notify({name:'duration1',value:0}) - await CommonFunc.sleep(1000); globalThis.value.message.notify({name:'duration',value:700}) await CommonFunc.sleep(1000); globalThis.value.message.notify({name:'reverse',value:true}) @@ -164,11 +162,11 @@ export default function imageAniamtorJsunit() { let obj = JSON.parse(strJson); console.info('[imageAniamtorJsunit_0600] component obj is: ' + obj.$attrs.duration + "---" + obj.$attrs.reverse + "---" + obj.$attrs.fixedSize + "----" + obj.$attrs.iterations); - //expect(obj.$attrs.duration).assertEqual('700'); - //expect(obj.$attrs.reverse).assertEqual('true'); - //expect(obj.$attrs.fixedSize).assertEqual('false'); - //expect(obj.$attrs.iterations).assertEqual('2'); - //console.info('[imageAniamtorJsunit_0600] END'); + expect(obj.$attrs.duration).assertEqual('700'); + expect(obj.$attrs.reverse).assertEqual('true'); + expect(obj.$attrs.fixedSize).assertEqual('false'); + expect(obj.$attrs.iterations).assertEqual('2'); + console.info('[imageAniamtorJsunit_0600] END'); done(); }); @@ -203,11 +201,11 @@ export default function imageAniamtorJsunit() { let btn2 = await driver.findComponent(ON.id('start')); expect(btn2 != null).assertTrue(); await btn2.click(); - await CommonFunc.sleep(3000); + await CommonFunc.sleep(1000); let strJson = getInspectorByKey('t3'); let obj = JSON.parse(strJson); console.info('imageAnimatorJsunit_0800 component obj is: '+ obj.$attrs.content); - expect(obj.$attrs.content).assertEqual('ani'); + expect(obj.$attrs.content).assertEqual('onRepeat'); let btn3 = await driver.findComponent(ON.id('pause')); expect(btn3 != null).assertTrue(); 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 3b2f2432e6b61211f459e87ab6d8aff33ea721a9..fba4ae248052fa48497b9d37b7c67b6128f1a751 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 @@ -29,7 +29,7 @@ export default function imageOneJsunit() { router.clear(); let pages = router.getState(); console.info("get imageOneJsunit state pages:" + JSON.stringify(pages)); - if (!("textTwo" == pages.name)) { + if (!("imageOne" == pages.name)) { console.info("get imageOneJsunit state pages.name:" + JSON.stringify(pages.name)); let result = await router.push(options); console.info("push imageOneJsunit success " + JSON.stringify(result)); @@ -67,32 +67,32 @@ export default function imageOneJsunit() { await CommonFunc.sleep(1000); // modify the image format globalThis.value.message.notify({name:'imageNamePng',value:'test2.svg'}) - await CommonFunc.sleep(2000); + await CommonFunc.sleep(1000); let strJson = getInspectorByKey('image1'); let obj = JSON.parse(strJson); console.info('textimageOneJsunit_0200 component obj is: ' + obj.$attrs.src); - //expect(obj.$attrs.src).assertEqual('resource://rawfile/test2.svg'); + expect(obj.$attrs.src).assertEqual('resource://rawfile/test2.svg'); globalThis.value.message.notify({name:'imageNamePng',value:'test.gif'}) - await CommonFunc.sleep(3000); + await CommonFunc.sleep(1000); let strJson2 = getInspectorByKey('image1'); let obj2 = JSON.parse(strJson2); console.info('textimageOneJsunit_0200 component obj2 is: ' + obj2.$attrs.src); - //expect(obj2.$attrs.src).assertEqual('resource://rawfile/test.gif'); + expect(obj2.$attrs.src).assertEqual('resource://rawfile/test.gif'); globalThis.value.message.notify({name:'imageNamePng',value:'bm.bmp'}) - await CommonFunc.sleep(2000); + await CommonFunc.sleep(1000); let strJson3 = getInspectorByKey('image1'); let obj3 = JSON.parse(strJson3); console.info('textimageOneJsunit_0100 component obj3 is: ' + obj3.$attrs.src); - //expect(obj3.$attrs.src).assertEqual('resource://rawfile/bm.bmp'); + expect(obj3.$attrs.src).assertEqual('resource://rawfile/bm.bmp'); globalThis.value.message.notify({name:'imageNamePng',value:'bm.jpg'}) - await CommonFunc.sleep(2000); + await CommonFunc.sleep(1000); let strJson4 = getInspectorByKey('image1'); let obj4 = JSON.parse(strJson4); console.info('textimageOneJsunit_0100 component obj4 is: ' + obj4.$attrs.src); - //expect(obj4.$attrs.src).assertEqual('resource://rawfile/bm.jpg'); + expect(obj4.$attrs.src).assertEqual('resource://rawfile/bm.jpg'); }); it('imageOneJsunit_0300', 0, async function (done) { @@ -100,11 +100,11 @@ export default function imageOneJsunit() { await CommonFunc.sleep(1000); // modify the image of not exit globalThis.value.message.notify({name:'imageNamePng',value:'aaa.png'}) - await CommonFunc.sleep(2000); + await CommonFunc.sleep(1000); let strJson = getInspectorByKey('image1'); let obj = JSON.parse(strJson); console.info('textimageOneJsunit_0300 component obj is: ' + obj.$attrs.src); - expect(obj.$attrs.src).assertEqual('resource://rawfile/bm.jpg'); + expect(obj.$attrs.src).assertEqual('resource://rawfile/aaa.png'); }); it('imageOneJsunit_0400', 0, async function (done) { @@ -112,32 +112,46 @@ export default function imageOneJsunit() { await CommonFunc.sleep(1000); // test the enum of objectFit globalThis.value.message.notify({name:'objectFit',value:ImageFit.None}) - await CommonFunc.sleep(3000); + await CommonFunc.sleep(1000); let strJson = getInspectorByKey('image1'); 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.None'); globalThis.value.message.notify({name:'objectFit',value:'ImageFit.Auto'}) - await CommonFunc.sleep(3000); + await CommonFunc.sleep(1000); let strJson2 = getInspectorByKey('image1'); let obj2 = JSON.parse(strJson2); console.info('textimageOneJsunit_0400 component obj2 is: ' + obj2.$attrs.objectFit); - //expect(obj2.$attrs.objectFit).assertEqual('ImageFit.Auto'); + expect(obj2.$attrs.objectFit).assertEqual('ImageFit.Auto'); globalThis.value.message.notify({name:'objectFit',value:ImageFit.Fill}) - await CommonFunc.sleep(3000); + await CommonFunc.sleep(1000); let strJson3 = getInspectorByKey('image1'); let obj3 = JSON.parse(strJson3); console.info('textimageOneJsunit_0400 component obj3 is: ' + obj3.$attrs.objectFit); - //expect(obj3.$attrs.objectFit).assertEqual('ImageFit.Fill'); + expect(obj3.$attrs.objectFit).assertEqual('ImageFit.Fill'); globalThis.value.message.notify({name:'objectFit',value:ImageFit.ScaleDown}) - await CommonFunc.sleep(3000); + await CommonFunc.sleep(1000); let strJson4 = getInspectorByKey('image1'); let obj4 = JSON.parse(strJson4); console.info('textimageOneJsunit_0400 component obj4 is: ' + obj4.$attrs.objectFit); - //expect(obj4.$attrs.objectFit).assertEqual('ImageFit.ScaleDown'); + expect(obj4.$attrs.objectFit).assertEqual('ImageFit.ScaleDown'); + + globalThis.value.message.notify({name:'objectFit',value:ImageFit.Cover}) + await CommonFunc.sleep(1000); + let strJson5 = getInspectorByKey('image1'); + let obj5 = JSON.parse(strJson5); + console.info('textimageOneJsunit_0400 component obj5 is: ' + obj5.$attrs.objectFit); + expect(obj5.$attrs.objectFit).assertEqual('ImageFit.Cover'); + + globalThis.value.message.notify({name:'objectFit',value:ImageFit.Contain}) + await CommonFunc.sleep(1000); + let strJson6 = getInspectorByKey('image1'); + let obj6 = JSON.parse(strJson6); + console.info('textimageOneJsunit_0400 component obj6 is: ' + obj6.$attrs.objectFit); + expect(obj6.$attrs.objectFit).assertEqual('ImageFit.Contain'); done(); }); @@ -159,32 +173,32 @@ export default function imageOneJsunit() { await CommonFunc.sleep(1000); // test the enum of ImageRepeat globalThis.value.message.notify({name:'objectRepeat',value:ImageRepeat.X}) - await CommonFunc.sleep(3000); + await CommonFunc.sleep(1000); let strJson = getInspectorByKey('repeat'); let obj = JSON.parse(strJson); console.info('textimageOneJsunit_0600 component obj is: ' + obj.$attrs.objectRepeat); - //expect(obj.$attrs.objectRepeat).assertEqual('ImageRepeat.X'); + expect(obj.$attrs.objectRepeat).assertEqual('ImageRepeat.X'); globalThis.value.message.notify({name:'objectRepeat',value:ImageRepeat.Y}) - await CommonFunc.sleep(3000); + await CommonFunc.sleep(1000); let strJson1 = getInspectorByKey('repeat'); let obj1 = JSON.parse(strJson1); console.info('textimageOneJsunit_0600 component obj1 is: ' + obj1.$attrs.objectRepeat); - //expect(obj1.$attrs.objectRepeat).assertEqual('ImageRepeat.Y'); + expect(obj1.$attrs.objectRepeat).assertEqual('ImageRepeat.Y'); globalThis.value.message.notify({name:'objectRepeat',value:ImageRepeat.XY}) - await CommonFunc.sleep(3000); + await CommonFunc.sleep(1000); let strJson2 = getInspectorByKey('repeat'); let obj2 = JSON.parse(strJson2); console.info('textimageOneJsunit_0600 component obj2 is: ' + obj2.$attrs.objectRepeat); - //expect(obj2.$attrs.objectRepeat).assertEqual('ImageRepeat.XY'); + expect(obj2.$attrs.objectRepeat).assertEqual('ImageRepeat.XY'); - globalThis.value.message.notify({name:'objectFit',value:ImageRepeat.NoRepeat}) - await CommonFunc.sleep(3000); + globalThis.value.message.notify({name:'objectRepeat',value:ImageRepeat.NoRepeat}) + await CommonFunc.sleep(1000); let strJson3 = getInspectorByKey('repeat'); let obj3 = JSON.parse(strJson3); console.info('textimageOneJsunit_0600 component obj3 is: ' + obj3.$attrs.objectRepeat); - //expect(obj3.$attrs.objectRepeat).assertEqual('ImageRepeat.NoRepeat'); + expect(obj3.$attrs.objectRepeat).assertEqual('ImageRepeat.NoRepeat'); done(); }); @@ -192,12 +206,12 @@ export default function imageOneJsunit() { console.info('imageOneJsunit_0700 START'); await CommonFunc.sleep(1000); // test the illegal enum of ImageRepeat - globalThis.value.message.notify({name:'objectRepeat',value:10}) + globalThis.value.message.notify({name:'objectRepeat',value:undefined}) await CommonFunc.sleep(3000); let strJson = getInspectorByKey('repeat'); let obj = JSON.parse(strJson); console.info('textimageOneJsunit_0700 component obj is: ' + obj.$attrs.objectRepeat); - expect(obj.$attrs.objectRepeat).assertEqual('ImageRepeat.XY'); + expect(obj.$attrs.objectRepeat).assertEqual('ImageRepeat.NoRepeat'); done(); }); }) 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 348840dbcaea384107e9b4ee4c173e847e59c094..f731656c5fdf51706ca7f1a3b4c95b4ccdf44e6f 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 @@ -30,7 +30,7 @@ export default function imageThreeJsunit() { router.clear(); let pages = router.getState(); console.info("get imageThreeJsunit state pages:" + JSON.stringify(pages)); - if (!("textTwo" == 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)); 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 722ca2e1e6d1492d95f95967af379fe3691a39f6..7456bc8ecd66ec264fb46f5d7876101c575b43f6 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 @@ -30,7 +30,7 @@ export default function imageTwoJsunit() { router.clear(); let pages = router.getState(); console.info("get imageTwoJsunit state pages:" + JSON.stringify(pages)); - if (!("textTwo" == pages.name)) { + if (!("imageTwo" == pages.name)) { console.info("get imageTwoJsunit state pages.name:" + JSON.stringify(pages.name)); let result = await router.push(options); console.info("push imageTwoJsunit success " + JSON.stringify(result)); @@ -66,18 +66,18 @@ export default function imageTwoJsunit() { await CommonFunc.sleep(1000); // modify the image rendermode globalThis.value.message.notify({name:'renderMode',value:ImageRenderMode.Template}) - await CommonFunc.sleep(3000); + await CommonFunc.sleep(1000); 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'); + expect(obj.$attrs.renderMode).assertEqual('ImageRenderMode.Template'); }); it('imageTwoJsunit_0300', 0, async function (done) { console.info('imageTwoJsunit_0300 START'); await CommonFunc.sleep(1000); // modify the image rendermode - globalThis.value.message.notify({name:'renderMode',value:10}) + globalThis.value.message.notify({name:'renderMode',value:undefined}) await CommonFunc.sleep(3000); let strJson = getInspectorByKey('image1'); let obj = JSON.parse(strJson); @@ -95,21 +95,21 @@ export default function imageTwoJsunit() { 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'); + expect(obj.$attrs.interpolation).assertEqual('ImageInterpolation.Low'); globalThis.value.message.notify({name:'interpolation',value:ImageInterpolation.Medium}) await CommonFunc.sleep(3000); 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'); + expect(obj2.$attrs.interpolation).assertEqual('ImageInterpolation.Medium'); globalThis.value.message.notify({name:'interpolation',value:ImageInterpolation.High}) await CommonFunc.sleep(3000); let strJson3 = getInspectorByKey('image1'); let obj3 = JSON.parse(strJson3); console.info('imageTwoJsunit_0400 component obj3 is: ' + obj3.$attrs.interpolation); - //expect(obj3.$attrs.interpolation).assertEqual('ImageInterpolation.High'); + expect(obj3.$attrs.interpolation).assertEqual('ImageInterpolation.High'); done(); }); @@ -117,7 +117,7 @@ export default function imageTwoJsunit() { console.info('imageTwoJsunit_0500 START'); await CommonFunc.sleep(1000); // test the enum of interpolation - globalThis.value.message.notify({name:'interpolation',value:10}) + globalThis.value.message.notify({name:'interpolation',value:undefined}) await CommonFunc.sleep(2000); let strJson = getInspectorByKey('image1'); let obj = JSON.parse(strJson); @@ -134,21 +134,21 @@ export default function imageTwoJsunit() { let strJson = getInspectorByKey('image1'); let obj = JSON.parse(strJson); console.info('imageOneJsunit_0600 component obj is: ' + obj.$attrs.fillColor); - expect(obj.$attrs.fillColor).assertEqual('#FFFF0000'); + expect(obj.$attrs.fillColor).assertEqual('#FFFFEEAA'); globalThis.value.message.notify({name:'fillColor',value:"rgb(238, 130, 238)"}) await CommonFunc.sleep(2000); let strJson2 = getInspectorByKey('image1'); let obj2 = JSON.parse(strJson2); console.info('imageTwoJsunit_0600 component obj2 is: ' + obj2.$attrs.fillColor); - expect(obj2.$attrs.fillColor).assertEqual('#FFFF0000'); + expect(obj2.$attrs.fillColor).assertEqual('#FFEE82EE'); globalThis.value.message.notify({name:'fillColor',value:Color.Green}) await CommonFunc.sleep(2000); let strJson3 = getInspectorByKey('image1'); let obj3 = JSON.parse(strJson3); console.info('imageTwoJsunit_0600 component obj3 is: ' + obj3.$attrs.fillColor); - expect(obj3.$attrs.fillColor).assertEqual('#FFFF0000'); + expect(obj3.$attrs.fillColor).assertEqual('#FF008000'); done(); }); }) 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 9074eaacccc580a92b6b93f0bc7ba661dfba88c6..1ab6d216580e66b8fc0ea619899e1b5a16432c26 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 @@ -62,13 +62,13 @@ export default function marqueeJsunit() { it('marqueeJsunit_0200', 0, async function (done) { console.info('marqueeJsunit_0200 START'); // modify the type attribute normal value of marquee dynamically - globalThis.value.message.notify({name:'fromStart',value:false}) - await CommonFunc.sleep(200); + globalThis.value.message.notify({name:'fromStart',value:true}) + await CommonFunc.sleep(2000); // check the value of changed parameter let strJson = getInspectorByKey('marquee'); let obj = JSON.parse(strJson); - expect(obj.$attrs.fromStart).assertEqual('false'); - done(); + expect(obj.$attrs.fromStart).assertEqual('true'); + done(); }); it('marqueeJsunit_0300', 0, async function (done) { @@ -87,12 +87,12 @@ export default function marqueeJsunit() { 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:20}) + 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('20.000000'); + expect(obj.$attrs.step).assertEqual('50.000000'); done(); }); @@ -130,18 +130,18 @@ export default function marqueeJsunit() { let strJson = getInspectorByKey('marquee'); let obj = JSON.parse(strJson); // to confirm - expect(obj.$attrs.step).assertEqual('-30.000000'); + expect(obj.$attrs.step).assertEqual('50.000000'); done(); }); it('marqueeJsunit_0700', 0, async function (done) { console.info('marqueeJsunit_0700 START'); // modify the type attribute normal value of marquee dynamically - globalThis.value.message.notify({name:'loop',value:1}) + globalThis.value.message.notify({name:'loop',value:2}) await CommonFunc.sleep(1000); let strJson = getInspectorByKey('marquee'); let obj = JSON.parse(strJson); - expect(obj.$attrs.loop).assertEqual('1'); + expect(obj.$attrs.loop).assertEqual('2'); done(); }); @@ -152,7 +152,7 @@ export default function marqueeJsunit() { await CommonFunc.sleep(2000); let strJson = getInspectorByKey('marquee'); let obj = JSON.parse(strJson); - expect(obj.$attrs.src).assertEqual('starts rolling'); + expect(obj.$attrs.src).assertEqual('Running Marquee starts rolling'); done(); }); 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 86ddd3f87d8d176f168cd082bda98e90ee88fe29..794d388709b192dd2ee547c581363b8697b3f2f4 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 @@ -49,7 +49,7 @@ export default function sliderJsunit() { let strJson = getInspectorByKey('sliderConstructor2'); let obj = JSON.parse(strJson); console.info('sliderJsunit_0100 component obj is: ' + obj.$attrs.style); - expect(obj.$attrs.style).assertEqual('SliderMode.OUTSET'); + expect(obj.$attrs.style).assertEqual('SliderStyle.OutSet'); done(); }); @@ -60,7 +60,7 @@ export default function sliderJsunit() { let obj = JSON.parse(strJson); console.info('sliderJsunit_0200 component obj is: ' + obj.$attrs.style + "---" + obj.$attrs.constructor.direction + "--" + obj.$attrs.constructor.value + "---" + obj.$attrs.constructor.reverse + "----" + obj.$attrs.constructor.min + "----" + obj.$attrs.constructor.max + "---" + obj.$attrs.constructor.step + "---" + JSON.stringify(obj.$attrs.constructor)); - expect(obj.$attrs.style).assertEqual('SliderMode.INSET'); + expect(obj.$attrs.style).assertEqual('SliderStyle.InSet'); expect(obj.$attrs.constructor.direction).assertEqual('Axis.Vertical'); expect(obj.$attrs.constructor.value).assertEqual('40.000000'); expect(obj.$attrs.constructor.reverse).assertEqual('true'); @@ -83,7 +83,7 @@ export default function sliderJsunit() { expect(obj.$attrs.showSteps).assertEqual('true'); expect(obj.$attrs.showTips).assertEqual('true'); expect(obj.$attrs.trackThickness).assertEqual('10.00px'); - //expect(obj.$attrs.selectedColor).assertEqual('#FF191970'); + expect(obj.$attrs.selectedColor).assertEqual('#FF191970'); done(); }); @@ -106,7 +106,7 @@ export default function sliderJsunit() { expect(obj.$attrs.blockColor).assertEqual('#FFFFFFFF'); expect(obj.$attrs.trackColor).assertEqual('#FFEEFFFF'); expect(obj.$attrs.trackThickness).assertEqual('12.00px'); - //expect(obj.$attrs.selectedColor).assertEqual('#FFAEFFFF'); + expect(obj.$attrs.selectedColor).assertEqual('#FFAEFFFF'); done(); }); @@ -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('#FFAEFFFF'); done(); }); @@ -140,14 +140,14 @@ export default function sliderJsunit() { await CommonFunc.sleep(200); globalThis.value.message.notify({name:'trackThickness',value:'-px'}) await CommonFunc.sleep(200); - // get the slider component attribute + // get the slider component attribute let strJson = getInspectorByKey('sliderA'); let obj = JSON.parse(strJson); console.info('sliderJsunit_0600 component obj is: ' + obj.$attrs.blockColor + "---" + obj.$attrs.trackColor + "--" + obj.$attrs.selectedColor + "---" + obj.$attrs.trackThickness); expect(obj.$attrs.blockColor).assertEqual('#FFAACCEE'); expect(obj.$attrs.trackColor).assertEqual('#FFAACCEE'); - expect(obj.$attrs.trackThickness).assertEqual('0.00vp'); - //expect(obj.$attrs.selectedColor).assertEqual('#AEFFFF'); + expect(obj.$attrs.trackThickness).assertEqual('4.00vp'); + expect(obj.$attrs.selectedColor).assertEqual('#FFAACCEE'); done(); }); @@ -173,14 +173,14 @@ export default function sliderJsunit() { let obj = JSON.parse(strJson); console.info('sliderJsunit_0700 component obj is: ' + obj.$attrs.style + "---" + obj.$attrs.constructor.direction + "--" + obj.$attrs.constructor.value + "---" + obj.$attrs.constructor.reverse + "----" + obj.$attrs.constructor.min + "----" + obj.$attrs.constructor.max + "---" + obj.$attrs.constructor.step); - expect(obj.$attrs.style).assertEqual('SliderMode.OUTSET'); + expect(obj.$attrs.style).assertEqual('SliderStyle.OutSet'); expect(obj.$attrs.constructor.direction).assertEqual('Axis.Horizontal'); expect(obj.$attrs.constructor.reverse).assertEqual('false'); expect(obj.$attrs.constructor.min).assertEqual('20.000000'); expect(obj.$attrs.constructor.max).assertEqual('80.000000'); expect(obj.$attrs.constructor.step).assertEqual('0.900000'); - //expect(obj.$attrs.constructor.value).assertEqual('30.000000'); - done(); + expect(obj.$attrs.constructor.value).assertEqual('30.000000'); + done(); }); it('sliderJsunit_0800', 0, async function (done) { @@ -205,14 +205,14 @@ export default function sliderJsunit() { let obj = JSON.parse(strJson); console.info('sliderJsunit_0200 component obj is: ' + obj.$attrs.style + "---" + obj.$attrs.constructor.direction + "--" + obj.$attrs.constructor.value + "---" + obj.$attrs.constructor.reverse + "----" + obj.$attrs.constructor.min + "----" + obj.$attrs.constructor.max + "---" + obj.$attrs.constructor.step); - expect(obj.$attrs.style).assertEqual('SliderMode.OUTSET'); + 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.reverse).assertEqual('false'); expect(obj.$attrs.constructor.min).assertEqual('-20.000000'); expect(obj.$attrs.constructor.max).assertEqual('1000.000000'); - expect(obj.$attrs.constructor.step).assertEqual('1020.000000'); - done(); + expect(obj.$attrs.constructor.step).assertEqual('1.000000'); + done(); }); it('sliderJsunit_0900', 0, async function (done) { diff --git a/arkui/ace_ets_component_ui/entry/src/main/ets/test/textOneJsunit.test.ets b/arkui/ace_ets_component_ui/entry/src/main/ets/test/textOneJsunit.test.ets index 281c263a6a0b22ce7f1e8761d4be9a07dd61c22d..6fca500c99de197ab01f8318b4b924c7ba3390d5 100644 --- a/arkui/ace_ets_component_ui/entry/src/main/ets/test/textOneJsunit.test.ets +++ b/arkui/ace_ets_component_ui/entry/src/main/ets/test/textOneJsunit.test.ets @@ -81,7 +81,7 @@ export default function textOneJsunit() { let strJson = getInspectorByKey('text1'); let obj = JSON.parse(strJson); console.info('textOneJsunit_0300 component obj is: ' + obj.$attrs.textAlign); - expect(obj.$attrs.textAlign).assertEqual('TextAlign.Right'); + expect(obj.$attrs.textAlign).assertEqual('TextAlign.Left'); 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 5cef0c6203d208b477b37065538794038ca19b2c..c8c84b33226bda62476a27759dd831bb2f7ae6d8 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 @@ -49,7 +49,7 @@ export default function textTwoJsunit() { 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.LineThrough","color":"#FFFFEEAF"}'); + expect(obj.$attrs.decoration).assertEqual('{"type":"TextDecorationType.None","color":"#FF000000"}'); // to modify the atrribute globalThis.value.message.notify({name:'type',value:TextDecorationType.Overline}) await CommonFunc.sleep(1000); @@ -85,9 +85,9 @@ export default function textTwoJsunit() { // test the illegal value of decoration await CommonFunc.sleep(1000); globalThis.value.message.notify({name:'type',value:5}) - await CommonFunc.sleep(2000); + await CommonFunc.sleep(1000); globalThis.value.message.notify({name:'color',value:"#ACE"}) - await CommonFunc.sleep(3000); + await CommonFunc.sleep(2000); let strJson2 = getInspectorByKey('text1'); let obj2 = JSON.parse(strJson2); console.info('textTwoJsunit_0200 component obj2 is: ' + obj2.$attrs.decoration);