提交 828d8ee0 编写于 作者: W wang-xupeng2

modify any type in attrlack

Signed-off-by: Nwang-xupeng2 <wangxupeng2@huawei.com>
上级 24057477
...@@ -25,7 +25,7 @@ const TAG = 'ets_apiLack_add'; ...@@ -25,7 +25,7 @@ const TAG = 'ets_apiLack_add';
struct Second { struct Second {
private content: string = "这是第二页" private content: string = "这是第二页"
@State text: string = router.getParams()['text'] @State text: string = router.getParams()['text']
@State data: any = router.getParams()['data'] @State data: number[] = router.getParams()['data']
@State secondData : string = '' @State secondData : string = ''
build() { build() {
...@@ -37,7 +37,7 @@ struct Second { ...@@ -37,7 +37,7 @@ struct Second {
.fontSize(30) .fontSize(30)
.key("SingleDataText") .key("SingleDataText")
.onClick(()=>{ .onClick(()=>{
this.secondData = (this.data.array[1]).toString() this.secondData = (this.data[1]).toString()
try { try {
var backData = { var backData = {
data: { data: {
......
...@@ -45,9 +45,7 @@ struct RouterStandard { ...@@ -45,9 +45,7 @@ struct RouterStandard {
url: 'pages/page2', url: 'pages/page2',
params: { params: {
text: '这是第二页的值', text: '这是第二页的值',
data: { data: [13, 46, 79]
array: [13, 46, 79]
}
} }
} }
try { try {
......
...@@ -67,13 +67,13 @@ export default function blankJsunit() { ...@@ -67,13 +67,13 @@ export default function blankJsunit() {
console.info('blankJsunitUITest_0200 START'); console.info('blankJsunitUITest_0200 START');
await CommonFunc.sleep(1000); await CommonFunc.sleep(1000);
// 动态修改Blank组件的minwidth // 动态修改Blank组件的minwidth
globalThis.value.message.notify({name:'minWith',value:'80'}) globalThis.value.message.notify({name:'minWith',value:80})
await CommonFunc.sleep(2000); await CommonFunc.sleep(2000);
// 获取动态修改后的组件的minwidth // 获取动态修改后的组件的minwidth
let strJson = getInspectorByKey('bl2'); let strJson = getInspectorByKey('bl2');
let obj = JSON.parse(strJson); let obj = JSON.parse(strJson);
console.info("[blankJsunit_0200'] component obj is: " + JSON.stringify(obj)); 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(); done();
}); });
......
...@@ -56,7 +56,7 @@ export default function checkBoxJsunit() { ...@@ -56,7 +56,7 @@ export default function checkBoxJsunit() {
let isChecked = await checkBox.isChecked(); let isChecked = await checkBox.isChecked();
// to confirm // to confirm
console.info("[checkBoxJsunit_0100'] component obj isChecked: " + isChecked); console.info("[checkBoxJsunit_0100'] component obj isChecked: " + isChecked);
expect(isChecked).assertFalse(); expect(isChecked).assertTrue();
done(); done();
}); });
...@@ -64,7 +64,7 @@ export default function checkBoxJsunit() { ...@@ -64,7 +64,7 @@ export default function checkBoxJsunit() {
console.info('checkBoxJsunit_0200 START'); console.info('checkBoxJsunit_0200 START');
await CommonFunc.sleep(1000); await CommonFunc.sleep(1000);
// modify the attribute normal value of checkbox dynamically // 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); await CommonFunc.sleep(2000);
let driver = Driver.create(); let driver = Driver.create();
await driver.delayMs(waitUiReadyMs); await driver.delayMs(waitUiReadyMs);
......
...@@ -187,7 +187,7 @@ export default function GridJsunit() { ...@@ -187,7 +187,7 @@ export default function GridJsunit() {
console.info("[GridJsunit_0500] supportAnimation: " + JSON.stringify(obj.$attrs.supportAnimation)); console.info("[GridJsunit_0500] supportAnimation: " + JSON.stringify(obj.$attrs.supportAnimation));
expect(obj.$attrs.columnsGap).assertEqual('0.00vp'); expect(obj.$attrs.columnsGap).assertEqual('0.00vp');
expect(obj.$attrs.rowsGap).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.cachedCount).assertEqual(1);
expect(obj.$attrs.supportAnimation).assertEqual('false'); expect(obj.$attrs.supportAnimation).assertEqual('false');
console.info('[GridJsunit_0500] END'); console.info('[GridJsunit_0500] END');
......
...@@ -57,7 +57,7 @@ export default function GridRowJsunit() { ...@@ -57,7 +57,7 @@ export default function GridRowJsunit() {
expect(obj.$attrs.columns).assertEqual('4'); expect(obj.$attrs.columns).assertEqual('4');
expect(obj.$attrs.breakpoints).assertEqual('4'); expect(obj.$attrs.breakpoints).assertEqual('4');
expect(obj.$attrs.direction).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'); console.info('[GridRowJsunit_0100] END');
done(); done();
}); });
......
...@@ -93,10 +93,10 @@ export default function ListJsunit() { ...@@ -93,10 +93,10 @@ export default function ListJsunit() {
// Verify onScroll function of List component // Verify onScroll function of List component
let gridTop = CommonFunc.getComponentRect('grid2'); let gridTop = CommonFunc.getComponentRect('grid2');
let top = gridTop.top let top = gridTop.top
//let gridLeft = CommonFunc.getComponentRect('grid2'); let gridLeft = CommonFunc.getComponentRect('grid2');
let left = gridTop.left let left = gridLeft.left
//let gridRight = CommonFunc.getComponentRect('grid2'); let gridRight = CommonFunc.getComponentRect('grid2');
let right = gridTop.right let right = gridRight.right
let driver = await UiDriver.create() 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(left + 50), Math.round(top + 100), Math.round(right - 50), Math.round(top + 100));
await CommonFunc.sleep(1000); await CommonFunc.sleep(1000);
...@@ -218,7 +218,7 @@ export default function ListJsunit() { ...@@ -218,7 +218,7 @@ export default function ListJsunit() {
expect(obj.$attrs.chainAnimation).assertEqual(true); expect(obj.$attrs.chainAnimation).assertEqual(true);
expect(obj.$attrs.multiSelectable).assertEqual(true); expect(obj.$attrs.multiSelectable).assertEqual(true);
expect(obj.$attrs.alignListItem).assertEqual('ListItemAlign.Start'); 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'); console.info('[ListJsunit_0300] END');
done(); done();
}); });
...@@ -271,7 +271,7 @@ export default function ListJsunit() { ...@@ -271,7 +271,7 @@ export default function ListJsunit() {
console.info("[ListJsunit_0400] multiSelectable: " + JSON.stringify(obj.$attrs.multiSelectable)); console.info("[ListJsunit_0400] multiSelectable: " + JSON.stringify(obj.$attrs.multiSelectable));
console.info("[ListJsunit_0400] alignListItem: " + JSON.stringify(obj.$attrs.alignListItem)); console.info("[ListJsunit_0400] alignListItem: " + JSON.stringify(obj.$attrs.alignListItem));
console.info("[ListJsunit_0400] sticky: " + JSON.stringify(obj.$attrs.sticky)); 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.initialIndex).assertEqual('30');
expect(obj.$attrs.listDirection).assertEqual('Axis.Horizontal'); expect(obj.$attrs.listDirection).assertEqual('Axis.Horizontal');
expect(obj.$attrs.divider.strokeWidth).assertEqual('0.00vp'); expect(obj.$attrs.divider.strokeWidth).assertEqual('0.00vp');
...@@ -286,7 +286,7 @@ export default function ListJsunit() { ...@@ -286,7 +286,7 @@ export default function ListJsunit() {
expect(obj.$attrs.chainAnimation).assertEqual(true); expect(obj.$attrs.chainAnimation).assertEqual(true);
expect(obj.$attrs.multiSelectable).assertEqual(true); expect(obj.$attrs.multiSelectable).assertEqual(true);
expect(obj.$attrs.alignListItem).assertEqual('ListItemAlign.Start'); 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'); console.info('[ListJsunit_0400] END');
done(); done();
}); });
......
...@@ -223,15 +223,15 @@ export default function NavigationJsunit() { ...@@ -223,15 +223,15 @@ export default function NavigationJsunit() {
console.info("[NavigationJsunit_0900] mode: " + obj.$attrs.mode); console.info("[NavigationJsunit_0900] mode: " + obj.$attrs.mode);
console.info("[NavigationJsunit_0900] backButtonIcon: " + obj.$attrs.backButtonIcon); console.info("[NavigationJsunit_0900] backButtonIcon: " + obj.$attrs.backButtonIcon);
console.info("[NavigationJsunit_0900] hideNavBar: " + obj.$attrs.hideNavBar); 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.hideToolBar).assertEqual(true);
expect(obj.$attrs.hideTitleBar).assertEqual(true); expect(obj.$attrs.hideTitleBar).assertEqual(false);
expect(obj.$attrs.hideBackButton).assertEqual(true); expect(obj.$attrs.hideBackButton).assertEqual(true);
//expect(obj.$attrs.navBarWidth).assertEqual('700'); expect(obj.$attrs.navBarWidth).assertEqual('200.00vp');
//expect(obj.$attrs.navBarPosition).assertEqual('NavBarPosition.Start'); expect(obj.$attrs.navBarPosition).assertEqual('NavBarPosition.End');
//expect(obj.$attrs.mode).assertEqual('NavigationMode.Split'); expect(obj.$attrs.mode).assertEqual('NavigationMode.STACK');
//expect(obj.$attrs.backButtonIcon).assertEqual('false'); expect(obj.$attrs.backButtonIcon).assertEqual('');
//expect(obj.$attrs.hideNavBar).assertEqual('false'); expect(obj.$attrs.hideNavBar).assertEqual(false);
console.info('[NavigationJsunit_0900] END'); console.info('[NavigationJsunit_0900] END');
done(); done();
}); });
......
...@@ -54,7 +54,7 @@ export default function ProgressJsunit() { ...@@ -54,7 +54,7 @@ export default function ProgressJsunit() {
expect(obj.$attrs.total).assertEqual('100.000000'); expect(obj.$attrs.total).assertEqual('100.000000');
expect(obj.$attrs.type).assertEqual('ProgressStyle.Linear'); expect(obj.$attrs.type).assertEqual('ProgressStyle.Linear');
expect(obj.$attrs.color).assertEqual('#FF808080'); expect(obj.$attrs.color).assertEqual('#FF808080');
expect(obj.$attrs.backgroundColor).assertEqual('#00000000'); expect(obj.$attrs.backgroundColor).assertEqual('#FFFF0000');
await CommonFunc.sleep(1000); await CommonFunc.sleep(1000);
let strJson1 = getInspectorByKey('pro3'); let strJson1 = getInspectorByKey('pro3');
let obj1 = JSON.parse(strJson1); let obj1 = JSON.parse(strJson1);
...@@ -120,7 +120,7 @@ export default function ProgressJsunit() { ...@@ -120,7 +120,7 @@ export default function ProgressJsunit() {
let strJson = getInspectorByKey('pro1'); let strJson = getInspectorByKey('pro1');
let obj = JSON.parse(strJson); let obj = JSON.parse(strJson);
console.info("[ProgressJsunit_0500] component obj is: " + JSON.stringify(obj)); 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'); console.info('[ProgressJsunit_0500] END');
done(); done();
}); });
......
...@@ -95,7 +95,7 @@ export default function RatingJsunit() { ...@@ -95,7 +95,7 @@ export default function RatingJsunit() {
let strJson1 = getInspectorByKey('rating1'); let strJson1 = getInspectorByKey('rating1');
let obj1 = JSON.parse(strJson1); let obj1 = JSON.parse(strJson1);
console.info("[RatingJsunit_0300] component obj1 is: " + JSON.stringify(obj1)); 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'); console.info('[RatingJsunit_0300] END');
done(); done();
}); });
......
...@@ -49,7 +49,7 @@ export default function SearchJsunit() { ...@@ -49,7 +49,7 @@ export default function SearchJsunit() {
await CommonFunc.sleep(1000); await CommonFunc.sleep(1000);
let strJson = getInspectorByKey('search'); let strJson = getInspectorByKey('search');
let obj = JSON.parse(strJson); 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] icon: " + JSON.stringify(obj.$attrs.icon));
console.info("[SearchJsunit_0100] searchButton: " + JSON.stringify(obj.$attrs.searchButton)); console.info("[SearchJsunit_0100] searchButton: " + JSON.stringify(obj.$attrs.searchButton));
console.info("[SearchJsunit_0100] placeholderColor: " + JSON.stringify(obj.$attrs.placeholderColor)); console.info("[SearchJsunit_0100] placeholderColor: " + JSON.stringify(obj.$attrs.placeholderColor));
...@@ -59,15 +59,15 @@ export default function SearchJsunit() { ...@@ -59,15 +59,15 @@ export default function SearchJsunit() {
console.info("[SearchJsunit_0100] textFont: " + JSON.stringify(obj.$attrs.textFont)); console.info("[SearchJsunit_0100] textFont: " + JSON.stringify(obj.$attrs.textFont));
console.info("[SearchJsunit_0100] textAlign: " + JSON.stringify(obj.$attrs.textAlign)); console.info("[SearchJsunit_0100] textAlign: " + JSON.stringify(obj.$attrs.textAlign));
console.info("[SearchJsunit_0100] copyOption: " + JSON.stringify(obj.$attrs.copyOption)); console.info("[SearchJsunit_0100] copyOption: " + JSON.stringify(obj.$attrs.copyOption));
expect(obj.$attrs.icon).assertEqual('resource:///ohos_search.svg'); expect(obj.$attrs.inspector.icon).assertEqual('resource:///ohos_search.svg');
expect(obj.$attrs.searchButton).assertEqual('SEARCH'); expect(obj.$attrs.inspector.searchButton).assertEqual('SEARCH');
expect(obj.$attrs.placeholderColor).assertEqual('#FF808080'); expect(obj.$attrs.inspector.placeholderColor).assertEqual('#FF808080');
expect(obj.$attrs.value).assertEqual(''); expect(obj.$attrs.inspector.value).assertEqual('');
expect(obj.$attrs.placeholderFont).assertEqual('{"style":"FontStyle.Normal","size":"14.00fp","weight":"400","fontFamily":"sans-serif"}'); expect(obj.$attrs.inspector.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.inspector.textFont).assertEqual('{"fontSize":"14.00fp","fontStyle":"FontStyle.Normal","fontWeight":"FontWeight.400","fontFamily":"HarmonyOS Sans"}');
expect(obj.$attrs.textAlign).assertEqual('TextAlign.Start'); expect(obj.$attrs.inspector.textAlign).assertEqual('TextAlign.Start');
expect(obj.$attrs.copyOption).assertEqual('CopyOptions.InApp'); expect(obj.$attrs.inspector.copyOption).assertEqual('CopyOptions.InApp');
expect(obj.$attrs.placeholder).assertEqual('Type to search...'); expect(obj.$attrs.placeholder.inspector).assertEqual('Type to search...');
console.info('[SearchJsunit_0100] END'); console.info('[SearchJsunit_0100] END');
done(); done();
}); });
...@@ -80,7 +80,7 @@ export default function SearchJsunit() { ...@@ -80,7 +80,7 @@ export default function SearchJsunit() {
await CommonFunc.sleep(500); await CommonFunc.sleep(500);
globalThis.value.message.notify({name:'searchButton',value:'CLICK_SEARCH'}) globalThis.value.message.notify({name:'searchButton',value:'CLICK_SEARCH'})
await CommonFunc.sleep(500); 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); await CommonFunc.sleep(500);
globalThis.value.message.notify({name:'changeValue',value:'hello'}) globalThis.value.message.notify({name:'changeValue',value:'hello'})
await CommonFunc.sleep(500); await CommonFunc.sleep(500);
...@@ -90,9 +90,9 @@ export default function SearchJsunit() { ...@@ -90,9 +90,9 @@ export default function SearchJsunit() {
await CommonFunc.sleep(500); await CommonFunc.sleep(500);
globalThis.value.message.notify({name:'weight',value:500}) globalThis.value.message.notify({name:'weight',value:500})
await CommonFunc.sleep(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); 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); await CommonFunc.sleep(500);
globalThis.value.message.notify({name:'positionValue',value:2}) globalThis.value.message.notify({name:'positionValue',value:2})
await CommonFunc.sleep(2000); await CommonFunc.sleep(2000);
...@@ -110,7 +110,7 @@ export default function SearchJsunit() { ...@@ -110,7 +110,7 @@ export default function SearchJsunit() {
console.info("[SearchJsunit_0200] textFont: " + JSON.stringify(obj.$attrs.textFont)); console.info("[SearchJsunit_0200] textFont: " + JSON.stringify(obj.$attrs.textFont));
console.info("[SearchJsunit_0200] textAlign: " + JSON.stringify(obj.$attrs.textAlign)); console.info("[SearchJsunit_0200] textAlign: " + JSON.stringify(obj.$attrs.textAlign));
console.info("[SearchJsunit_0200] copyOption: " + JSON.stringify(obj.$attrs.copyOption)); 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.searchButton).assertEqual('CLICK_SEARCH');
expect(obj.$attrs.value).assertEqual('hello'); 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.placeholderFont).assertEqual('{"style":"FontStyle.Normal","size":"20.00fp","weight":"500","fontFamily":"sans-serif"}');
...@@ -161,8 +161,10 @@ export default function SearchJsunit() { ...@@ -161,8 +161,10 @@ export default function SearchJsunit() {
// Verify the onCut function of the Search component // Verify the onCut function of the Search component
await textComponent1.longClick() await textComponent1.longClick()
await CommonFunc.sleep(1000); await CommonFunc.sleep(1000);
let textComponent5 = await driver.findComponent(BY.text('剪切')); let textComponent5 = await driver.findComponent(BY.text('全选'));
await textComponent5.click() await textComponent5.click()
let textComponent6 = await driver.findComponent(BY.text('剪切'));
await textComponent6.click()
let cut = await driver.findComponent(BY.key('cut')); let cut = await driver.findComponent(BY.key('cut'));
let text4 = await cut.getText(); let text4 = await cut.getText();
expect(text4).assertEqual('onCut:hello'); expect(text4).assertEqual('onCut:hello');
...@@ -170,8 +172,8 @@ export default function SearchJsunit() { ...@@ -170,8 +172,8 @@ export default function SearchJsunit() {
// Verify the onPaste function of the Search component // Verify the onPaste function of the Search component
await textComponent1.longClick() await textComponent1.longClick()
await CommonFunc.sleep(1000); await CommonFunc.sleep(1000);
let textComponent6 = await driver.findComponent(BY.text('粘贴')); let textComponent8 = await driver.findComponent(BY.text('粘贴'));
await textComponent6.click() await textComponent8.click()
let paste = await driver.findComponent(BY.key('paste')); let paste = await driver.findComponent(BY.key('paste'));
let text5 = await paste.getText(); let text5 = await paste.getText();
expect(text5).assertEqual('onPaste:hello'); expect(text5).assertEqual('onPaste:hello');
......
...@@ -191,7 +191,7 @@ export default function SelectJsunit() { ...@@ -191,7 +191,7 @@ export default function SelectJsunit() {
expect(obj.$attrs.fontColor).assertEqual('#FF00007B'); expect(obj.$attrs.fontColor).assertEqual('#FF00007B');
expect(obj.$attrs.selectedOptionBgColor).assertEqual('#FF0000FF'); expect(obj.$attrs.selectedOptionBgColor).assertEqual('#FF0000FF');
expect(obj.$attrs.selectedOptionFont).assertEqual('{"size":"16.00fp","weight":"400","family":"","style":"FontStyle.Normal"}'); 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.optionBgColor).assertEqual('#FFFFFFFF');
expect(obj.$attrs.optionFont).assertEqual('{"size":"16.00fp","weight":"400","family":"","style":"FontStyle.Normal"}'); 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('#FFFF0000');
......
...@@ -97,15 +97,15 @@ export default function TextClockJsunit() { ...@@ -97,15 +97,15 @@ export default function TextClockJsunit() {
await CommonFunc.sleep(1000); await CommonFunc.sleep(1000);
let accumulateTime2 = await driver.findComponent(BY.key('accumulateTime')); let accumulateTime2 = await driver.findComponent(BY.key('accumulateTime'));
let text2 = await accumulateTime2.getText(); let text2 = await accumulateTime2.getText();
expect(text1 == text2).assertTrue(); expect(text1).assertEqual(text2);
let operation1 = await driver.findComponent(BY.key('operation')); let operation1 = await driver.findComponent(BY.key('operation'));
let textOperation1 = await operation1.getText(); let textOperation1 = await operation1.getText();
expect(textOperation1 == 'stop success').assertTrue(); expect(textOperation1).assertEqual('stop success');
let change1 = await driver.findComponent(BY.key('change')); let change1 = await driver.findComponent(BY.key('change'));
let textChange1 = await change1.getText(); let textChange1 = await change1.getText();
expect(textChange1 == 'no change success').assertTrue(); expect(textChange1).assertEqual('no change success');
// Click start button // Click start button
let startButton = await driver.findComponent(BY.text('start TextClock')); let startButton = await driver.findComponent(BY.text('start TextClock'));
...@@ -117,11 +117,11 @@ export default function TextClockJsunit() { ...@@ -117,11 +117,11 @@ export default function TextClockJsunit() {
let change2 = await driver.findComponent(BY.key('change')); let change2 = await driver.findComponent(BY.key('change'));
let textChange2 = await change2.getText(); let textChange2 = await change2.getText();
expect(textChange2 == 'change success').assertTrue(); expect(textChange2).assertEqual('change success');
let operation2 = await driver.findComponent(BY.key('operation')); let operation2 = await driver.findComponent(BY.key('operation'));
let textOperation2 = await operation2.getText(); let textOperation2 = await operation2.getText();
expect(textOperation2 == 'start success').assertTrue(); expect(textOperation2).assertEqual('start success');
console.info('[TextClock_0300] END'); console.info('[TextClock_0300] END');
done(); done();
}); });
......
...@@ -68,9 +68,10 @@ export default function TextInputJsunit() { ...@@ -68,9 +68,10 @@ export default function TextInputJsunit() {
expect(obj.$attrs.enterKeyType).assertEqual('EnterKeyType.Search'); expect(obj.$attrs.enterKeyType).assertEqual('EnterKeyType.Search');
expect(obj.$attrs.caretColor).assertEqual('#FF0000FF'); expect(obj.$attrs.caretColor).assertEqual('#FF0000FF');
expect(obj.$attrs.maxLength).assertEqual('10'); expect(obj.$attrs.maxLength).assertEqual('10');
expect(obj.$attrs.style).assertEqual('TextInputStyle.Inline');
expect(obj.$attrs.textAlign).assertEqual('TextAlign.Center'); expect(obj.$attrs.textAlign).assertEqual('TextAlign.Center');
expect(obj.$attrs.copyOption).assertEqual('CopyOptions.None'); expect(obj.$attrs.copyOption).assertEqual('CopyOptions.None');
expect(obj.$attrs.showPasswordIcon).assertEqual('false'); expect(obj.$attrs.showPasswordIcon).assertEqual(false);
console.info('[TextInputJsunit_0100] END'); console.info('[TextInputJsunit_0100] END');
done(); done();
}); });
...@@ -95,14 +96,13 @@ export default function TextInputJsunit() { ...@@ -95,14 +96,13 @@ export default function TextInputJsunit() {
console.info("[TextInputJsunit_0200] textAlign: " + JSON.stringify(obj.$attrs.textAlign)); console.info("[TextInputJsunit_0200] textAlign: " + JSON.stringify(obj.$attrs.textAlign));
expect(obj.$attrs.placeholder).assertEqual('inline style'); expect(obj.$attrs.placeholder).assertEqual('inline style');
expect(obj.$attrs.type).assertEqual('InputType.Normal'); expect(obj.$attrs.type).assertEqual('InputType.Normal');
expect(obj.$attrs.placeholderColor).assertEqual('#FF808080'); expect(obj.$attrs.placeholderColor).assertEqual('#FF182431');
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":"16.00fp","weight":"400","fontFamily":"sans-serif"}');
expect(obj.$attrs.enterKeyType).assertEqual('EnterKeyType.Next'); expect(obj.$attrs.enterKeyType).assertEqual('EnterKeyType.Done');
expect(obj.$attrs.caretColor).assertEqual('#FF0000FF'); expect(obj.$attrs.caretColor).assertEqual('#FF007DFF');
expect(obj.$attrs.maxLength).assertEqual('10'); expect(obj.$attrs.maxLength).assertEqual('INF');
expect(obj.$attrs.textAlign).assertEqual('TextAlign.Start'); 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); await CommonFunc.sleep(1000);
console.info('[TextInputJsunit_0200] END'); console.info('[TextInputJsunit_0200] END');
done(); done();
...@@ -113,19 +113,19 @@ export default function TextInputJsunit() { ...@@ -113,19 +113,19 @@ export default function TextInputJsunit() {
console.info('[TextInputJsunit_0300] START'); console.info('[TextInputJsunit_0300] START');
globalThis.value.message.notify({name:'placeholder',value:'place input your word...'}) globalThis.value.message.notify({name:'placeholder',value:'place input your word...'})
await CommonFunc.sleep(1000); 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); 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); 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); 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); 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); await CommonFunc.sleep(1000);
globalThis.value.message.notify({name:'maxLength',value:'8'}) globalThis.value.message.notify({name:'maxLength',value:8})
await CommonFunc.sleep(1000); 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); await CommonFunc.sleep(1000);
// Get the propoties value of the TextInput component // Get the propoties value of the TextInput component
...@@ -141,11 +141,11 @@ export default function TextInputJsunit() { ...@@ -141,11 +141,11 @@ export default function TextInputJsunit() {
console.info("[TextInputJsunit_0300] maxLength: " + JSON.stringify(obj.$attrs.maxLength)); console.info("[TextInputJsunit_0300] maxLength: " + JSON.stringify(obj.$attrs.maxLength));
console.info("[TextInputJsunit_0300] textAlign: " + JSON.stringify(obj.$attrs.textAlign)); console.info("[TextInputJsunit_0300] textAlign: " + JSON.stringify(obj.$attrs.textAlign));
expect(obj.$attrs.placeholder).assertEqual('place input your word...'); 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.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.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.maxLength).assertEqual('8');
expect(obj.$attrs.textAlign).assertEqual('TextAlign.Start'); expect(obj.$attrs.textAlign).assertEqual('TextAlign.Start');
console.info('[TextInputJsunit_0300] END'); console.info('[TextInputJsunit_0300] END');
...@@ -207,7 +207,7 @@ export default function TextInputJsunit() { ...@@ -207,7 +207,7 @@ export default function TextInputJsunit() {
await textComponent5.click() await textComponent5.click()
let textComponent6 = await driver.findComponent(BY.text('剪切')); let textComponent6 = await driver.findComponent(BY.text('剪切'));
await textComponent6.click() await textComponent6.click()
await textComponent.click() //await textComponent.click()
await CommonFunc.sleep(1000); await CommonFunc.sleep(1000);
let textComponent7 = await driver.findComponent(BY.key('cut')); let textComponent7 = await driver.findComponent(BY.key('cut'));
let text4 = await textComponent7.getText(); let text4 = await textComponent7.getText();
...@@ -251,8 +251,8 @@ export default function TextInputJsunit() { ...@@ -251,8 +251,8 @@ export default function TextInputJsunit() {
console.info("[TextInputJsunit_0500] textAlign: " + JSON.stringify(obj.$attrs.textAlign)); console.info("[TextInputJsunit_0500] textAlign: " + JSON.stringify(obj.$attrs.textAlign));
expect(obj.$attrs.placeholder).assertEqual(''); expect(obj.$attrs.placeholder).assertEqual('');
expect(obj.$attrs.type).assertEqual('InputType.Normal'); expect(obj.$attrs.type).assertEqual('InputType.Normal');
expect(obj.$attrs.placeholderColor).assertEqual('#FF808080'); 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.enterKeyType).assertEqual('EnterKeyType.Done');
expect(obj.$attrs.caretColor).assertEqual('#FF00007B'); expect(obj.$attrs.caretColor).assertEqual('#FF00007B');
expect(obj.$attrs.maxLength).assertEqual('INF'); expect(obj.$attrs.maxLength).assertEqual('INF');
......
...@@ -54,7 +54,7 @@ export default function TextPickerJsunit() { ...@@ -54,7 +54,7 @@ export default function TextPickerJsunit() {
console.info("[TextPickerJsunit_0100] value: " + JSON.stringify(obj.$attrs.value)); console.info("[TextPickerJsunit_0100] value: " + JSON.stringify(obj.$attrs.value));
console.info("[TextPickerJsunit_0100] defaultPickerItemHeight: " + JSON.stringify(obj.$attrs.defaultPickerItemHeight)); console.info("[TextPickerJsunit_0100] defaultPickerItemHeight: " + JSON.stringify(obj.$attrs.defaultPickerItemHeight));
await CommonFunc.sleep(1000); 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.selected).assertEqual('0');
//expect(obj.$attrs.value).assertEqual('orange2'); //expect(obj.$attrs.value).assertEqual('orange2');
expect(obj.$attrs.defaultPickerItemHeight).assertEqual('20.00fp'); expect(obj.$attrs.defaultPickerItemHeight).assertEqual('20.00fp');
...@@ -90,7 +90,7 @@ export default function TextPickerJsunit() { ...@@ -90,7 +90,7 @@ export default function TextPickerJsunit() {
console.info("[TextPickerJsunit_0200] value: " + JSON.stringify(obj.$attrs.value)); console.info("[TextPickerJsunit_0200] value: " + JSON.stringify(obj.$attrs.value));
console.info("[TextPickerJsunit_0200] defaultPickerItemHeight: " + JSON.stringify(obj.$attrs.defaultPickerItemHeight)); console.info("[TextPickerJsunit_0200] defaultPickerItemHeight: " + JSON.stringify(obj.$attrs.defaultPickerItemHeight));
await CommonFunc.sleep(1000); 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.selected).assertEqual('1');
//expect(obj.$attrs.value).assertEqual('peach3'); //expect(obj.$attrs.value).assertEqual('peach3');
expect(obj.$attrs.defaultPickerItemHeight).assertEqual('25.00fp'); expect(obj.$attrs.defaultPickerItemHeight).assertEqual('25.00fp');
...@@ -138,7 +138,7 @@ export default function TextPickerJsunit() { ...@@ -138,7 +138,7 @@ export default function TextPickerJsunit() {
console.info("[TextPickerJsunit_0400] value: " + JSON.stringify(obj.$attrs.value)); console.info("[TextPickerJsunit_0400] value: " + JSON.stringify(obj.$attrs.value));
console.info("[TextPickerJsunit_0400] defaultPickerItemHeight: " + JSON.stringify(obj.$attrs.defaultPickerItemHeight)); console.info("[TextPickerJsunit_0400] defaultPickerItemHeight: " + JSON.stringify(obj.$attrs.defaultPickerItemHeight));
await CommonFunc.sleep(1000); 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.selected).assertEqual('1');
//expect(obj.$attrs.value).assertEqual(''); //expect(obj.$attrs.value).assertEqual('');
expect(obj.$attrs.defaultPickerItemHeight).assertEqual('25.00fp'); expect(obj.$attrs.defaultPickerItemHeight).assertEqual('25.00fp');
......
...@@ -105,13 +105,13 @@ export default function ToggleJsunit() { ...@@ -105,13 +105,13 @@ export default function ToggleJsunit() {
let textComponent = await driver.findComponent(BY.key('text')); let textComponent = await driver.findComponent(BY.key('text'));
let checkbox = await textComponent.getText(); let checkbox = await textComponent.getText();
console.info("[ToggleJsunit_0300] checkbox: " + JSON.stringify(checkbox)); console.info("[ToggleJsunit_0300] checkbox: " + JSON.stringify(checkbox));
expect(checkbox).assertEqual('checkbox true'); expect(checkbox).assertEqual('checkbox false');
await checkboxButton.click(); await checkboxButton.click();
await CommonFunc.sleep(1000); await CommonFunc.sleep(1000);
let checkbox1 = await textComponent.getText(); let checkbox1 = await textComponent.getText();
console.info("[ToggleJsunit_0300] checkbox1: " + JSON.stringify(checkbox1)); console.info("[ToggleJsunit_0300] checkbox1: " + JSON.stringify(checkbox1));
expect(checkbox1).assertEqual('checkbox false'); expect(checkbox1).assertEqual('checkbox true');
console.info('[ToggleJsunit_0300] END'); console.info('[ToggleJsunit_0300] END');
done(); done();
}); });
...@@ -140,7 +140,7 @@ export default function ToggleJsunit() { ...@@ -140,7 +140,7 @@ export default function ToggleJsunit() {
it('ToggleJsunit_0500', 0, async function (done) { it('ToggleJsunit_0500', 0, async function (done) {
// Modify the attribute of Toggle component // Modify the attribute of Toggle component
console.info('[ToggleJsunit_0500] START'); 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); await CommonFunc.sleep(2000);
globalThis.value.message.notify({name:'isOn',value:'false'}) globalThis.value.message.notify({name:'isOn',value:'false'})
await CommonFunc.sleep(2000); await CommonFunc.sleep(2000);
...@@ -157,9 +157,9 @@ export default function ToggleJsunit() { ...@@ -157,9 +157,9 @@ export default function ToggleJsunit() {
console.info("[ToggleJsunit_0500] isOn: " + JSON.stringify(obj.$attrs.isOn)); console.info("[ToggleJsunit_0500] isOn: " + JSON.stringify(obj.$attrs.isOn));
console.info("[ToggleJsunit_0500] selectedColor: " + JSON.stringify(obj.$attrs.selectedColor)); console.info("[ToggleJsunit_0500] selectedColor: " + JSON.stringify(obj.$attrs.selectedColor));
await CommonFunc.sleep(1000); await CommonFunc.sleep(1000);
//expect(obj.$attrs.type).assertEqual('ToggleType.Switch'); expect(obj.$attrs.type).assertEqual('ToggleType.Switch');
//expect(obj.$attrs.isOn).assertEqual('false'); expect(obj.$attrs.isOn).assertEqual('false');
//expect(obj.$attrs.selectedColor).assertEqual('#FF008000'); expect(obj.$attrs.selectedColor).assertEqual('#FF008000');
let strJson1 = getInspectorByKey('toggleSwitch'); let strJson1 = getInspectorByKey('toggleSwitch');
let obj1 = JSON.parse(strJson1); let obj1 = JSON.parse(strJson1);
console.info("[ToggleJsunit_0500] component obj1 is: " + JSON.stringify(obj1)); console.info("[ToggleJsunit_0500] component obj1 is: " + JSON.stringify(obj1));
...@@ -198,7 +198,7 @@ export default function ToggleJsunit() { ...@@ -198,7 +198,7 @@ export default function ToggleJsunit() {
console.info("[ToggleJsunit_0600] component obj1 is: " + JSON.stringify(obj1)); console.info("[ToggleJsunit_0600] component obj1 is: " + JSON.stringify(obj1));
console.info("[ToggleJsunit_0600] switchPointColor: " + JSON.stringify(obj1.$attrs.switchPointColor)); console.info("[ToggleJsunit_0600] switchPointColor: " + JSON.stringify(obj1.$attrs.switchPointColor));
await CommonFunc.sleep(1000); await CommonFunc.sleep(1000);
expect(obj1.$attrs.switchPointColor).assertEqual('#FFFF0000'); expect(obj1.$attrs.switchPointColor).assertEqual('#FFFFFFFF');
console.info('[ToggleJsunit_0600] END'); console.info('[ToggleJsunit_0600] END');
done(); done();
}); });
......
...@@ -30,7 +30,7 @@ export default function imageAniamtorJsunit() { ...@@ -30,7 +30,7 @@ export default function imageAniamtorJsunit() {
router.clear(); router.clear();
let pages = router.getState(); let pages = router.getState();
console.info("get imageAniamtorJsunit state pages:" + JSON.stringify(pages)); 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)); console.info("get imageAniamtor state pages.name:" + JSON.stringify(pages.name));
let result = await router.push(options); let result = await router.push(options);
console.info("push imageAniamtorJsunit success " + JSON.stringify(result)); console.info("push imageAniamtorJsunit success " + JSON.stringify(result));
...@@ -115,21 +115,21 @@ export default function imageAniamtorJsunit() { ...@@ -115,21 +115,21 @@ export default function imageAniamtorJsunit() {
let strJson = getInspectorByKey('imageAnimator'); let strJson = getInspectorByKey('imageAnimator');
let obj = JSON.parse(strJson); let obj = JSON.parse(strJson);
console.info('imageAniamtorJsunit_0400 component obj is: ' + obj.$attrs.fillMode); 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}) globalThis.value.message.notify({name:'fillMode',value:FillMode.Backwards})
await CommonFunc.sleep(5000); await CommonFunc.sleep(5000);
let strJson2 = getInspectorByKey('imageAnimator'); let strJson2 = getInspectorByKey('imageAnimator');
let obj2 = JSON.parse(strJson2); let obj2 = JSON.parse(strJson2);
console.info('imageAniamtorJsunit_0400 component obj2 is: ' + obj2.$attrs.fillMode); 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}) globalThis.value.message.notify({name:'fillMode',value:FillMode.Both})
await CommonFunc.sleep(5000); await CommonFunc.sleep(5000);
let strJson3 = getInspectorByKey('imageAnimator'); let strJson3 = getInspectorByKey('imageAnimator');
let obj3 = JSON.parse(strJson3); let obj3 = JSON.parse(strJson3);
console.info('imageAniamtorJsunit_0400 component obj3 is: ' + obj3.$attrs.fillMode); 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(); done();
}); });
...@@ -142,7 +142,7 @@ export default function imageAniamtorJsunit() { ...@@ -142,7 +142,7 @@ export default function imageAniamtorJsunit() {
let strJson = getInspectorByKey('imageAnimator'); let strJson = getInspectorByKey('imageAnimator');
let obj = JSON.parse(strJson); let obj = JSON.parse(strJson);
console.info('imageAniamtorJsunit_0500 component obj is: ' + obj.$attrs.fillMode); 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(); done();
}); });
...@@ -150,8 +150,6 @@ export default function imageAniamtorJsunit() { ...@@ -150,8 +150,6 @@ export default function imageAniamtorJsunit() {
console.info('[imageAniamtorJsunit_0600] START'); console.info('[imageAniamtorJsunit_0600] START');
// test the boolean attribute of imageAnimator // test the boolean attribute of imageAnimator
await CommonFunc.sleep(1000); await CommonFunc.sleep(1000);
globalThis.value.message.notify({name:'duration1',value:0})
await CommonFunc.sleep(1000);
globalThis.value.message.notify({name:'duration',value:700}) globalThis.value.message.notify({name:'duration',value:700})
await CommonFunc.sleep(1000); await CommonFunc.sleep(1000);
globalThis.value.message.notify({name:'reverse',value:true}) globalThis.value.message.notify({name:'reverse',value:true})
...@@ -164,11 +162,11 @@ export default function imageAniamtorJsunit() { ...@@ -164,11 +162,11 @@ export default function imageAniamtorJsunit() {
let obj = JSON.parse(strJson); let obj = JSON.parse(strJson);
console.info('[imageAniamtorJsunit_0600] component obj is: ' + obj.$attrs.duration console.info('[imageAniamtorJsunit_0600] component obj is: ' + obj.$attrs.duration
+ "---" + obj.$attrs.reverse + "---" + obj.$attrs.fixedSize + "----" + obj.$attrs.iterations); + "---" + obj.$attrs.reverse + "---" + obj.$attrs.fixedSize + "----" + obj.$attrs.iterations);
//expect(obj.$attrs.duration).assertEqual('700'); expect(obj.$attrs.duration).assertEqual('700');
//expect(obj.$attrs.reverse).assertEqual('true'); expect(obj.$attrs.reverse).assertEqual('true');
//expect(obj.$attrs.fixedSize).assertEqual('false'); expect(obj.$attrs.fixedSize).assertEqual('false');
//expect(obj.$attrs.iterations).assertEqual('2'); expect(obj.$attrs.iterations).assertEqual('2');
//console.info('[imageAniamtorJsunit_0600] END'); console.info('[imageAniamtorJsunit_0600] END');
done(); done();
}); });
...@@ -203,11 +201,11 @@ export default function imageAniamtorJsunit() { ...@@ -203,11 +201,11 @@ export default function imageAniamtorJsunit() {
let btn2 = await driver.findComponent(ON.id('start')); let btn2 = await driver.findComponent(ON.id('start'));
expect(btn2 != null).assertTrue(); expect(btn2 != null).assertTrue();
await btn2.click(); await btn2.click();
await CommonFunc.sleep(3000); await CommonFunc.sleep(1000);
let strJson = getInspectorByKey('t3'); let strJson = getInspectorByKey('t3');
let obj = JSON.parse(strJson); let obj = JSON.parse(strJson);
console.info('imageAnimatorJsunit_0800 component obj is: '+ obj.$attrs.content); 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')); let btn3 = await driver.findComponent(ON.id('pause'));
expect(btn3 != null).assertTrue(); expect(btn3 != null).assertTrue();
......
...@@ -29,7 +29,7 @@ export default function imageOneJsunit() { ...@@ -29,7 +29,7 @@ export default function imageOneJsunit() {
router.clear(); router.clear();
let pages = router.getState(); let pages = router.getState();
console.info("get imageOneJsunit state pages:" + JSON.stringify(pages)); 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)); console.info("get imageOneJsunit state pages.name:" + JSON.stringify(pages.name));
let result = await router.push(options); let result = await router.push(options);
console.info("push imageOneJsunit success " + JSON.stringify(result)); console.info("push imageOneJsunit success " + JSON.stringify(result));
...@@ -67,32 +67,32 @@ export default function imageOneJsunit() { ...@@ -67,32 +67,32 @@ export default function imageOneJsunit() {
await CommonFunc.sleep(1000); await CommonFunc.sleep(1000);
// modify the image format // modify the image format
globalThis.value.message.notify({name:'imageNamePng',value:'test2.svg'}) globalThis.value.message.notify({name:'imageNamePng',value:'test2.svg'})
await CommonFunc.sleep(2000); await CommonFunc.sleep(1000);
let strJson = getInspectorByKey('image1'); let strJson = getInspectorByKey('image1');
let obj = JSON.parse(strJson); let obj = JSON.parse(strJson);
console.info('textimageOneJsunit_0200 component obj is: ' + obj.$attrs.src); 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'}) globalThis.value.message.notify({name:'imageNamePng',value:'test.gif'})
await CommonFunc.sleep(3000); await CommonFunc.sleep(1000);
let strJson2 = getInspectorByKey('image1'); let strJson2 = getInspectorByKey('image1');
let obj2 = JSON.parse(strJson2); let obj2 = JSON.parse(strJson2);
console.info('textimageOneJsunit_0200 component obj2 is: ' + obj2.$attrs.src); 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'}) globalThis.value.message.notify({name:'imageNamePng',value:'bm.bmp'})
await CommonFunc.sleep(2000); await CommonFunc.sleep(1000);
let strJson3 = getInspectorByKey('image1'); let strJson3 = getInspectorByKey('image1');
let obj3 = JSON.parse(strJson3); let obj3 = JSON.parse(strJson3);
console.info('textimageOneJsunit_0100 component obj3 is: ' + obj3.$attrs.src); 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'}) globalThis.value.message.notify({name:'imageNamePng',value:'bm.jpg'})
await CommonFunc.sleep(2000); await CommonFunc.sleep(1000);
let strJson4 = getInspectorByKey('image1'); let strJson4 = getInspectorByKey('image1');
let obj4 = JSON.parse(strJson4); let obj4 = JSON.parse(strJson4);
console.info('textimageOneJsunit_0100 component obj4 is: ' + obj4.$attrs.src); 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) { it('imageOneJsunit_0300', 0, async function (done) {
...@@ -100,11 +100,11 @@ export default function imageOneJsunit() { ...@@ -100,11 +100,11 @@ export default function imageOneJsunit() {
await CommonFunc.sleep(1000); await CommonFunc.sleep(1000);
// modify the image of not exit // modify the image of not exit
globalThis.value.message.notify({name:'imageNamePng',value:'aaa.png'}) globalThis.value.message.notify({name:'imageNamePng',value:'aaa.png'})
await CommonFunc.sleep(2000); await CommonFunc.sleep(1000);
let strJson = getInspectorByKey('image1'); let strJson = getInspectorByKey('image1');
let obj = JSON.parse(strJson); let obj = JSON.parse(strJson);
console.info('textimageOneJsunit_0300 component obj is: ' + obj.$attrs.src); 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) { it('imageOneJsunit_0400', 0, async function (done) {
...@@ -112,32 +112,46 @@ export default function imageOneJsunit() { ...@@ -112,32 +112,46 @@ export default function imageOneJsunit() {
await CommonFunc.sleep(1000); await CommonFunc.sleep(1000);
// test the enum of objectFit // test the enum of objectFit
globalThis.value.message.notify({name:'objectFit',value:ImageFit.None}) globalThis.value.message.notify({name:'objectFit',value:ImageFit.None})
await CommonFunc.sleep(3000); await CommonFunc.sleep(1000);
let strJson = getInspectorByKey('image1'); let strJson = getInspectorByKey('image1');
let obj = JSON.parse(strJson); let obj = JSON.parse(strJson);
console.info('textimageOneJsunit_0400 component obj is: ' + obj.$attrs.objectFit); 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'}) globalThis.value.message.notify({name:'objectFit',value:'ImageFit.Auto'})
await CommonFunc.sleep(3000); await CommonFunc.sleep(1000);
let strJson2 = getInspectorByKey('image1'); let strJson2 = getInspectorByKey('image1');
let obj2 = JSON.parse(strJson2); let obj2 = JSON.parse(strJson2);
console.info('textimageOneJsunit_0400 component obj2 is: ' + obj2.$attrs.objectFit); 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}) globalThis.value.message.notify({name:'objectFit',value:ImageFit.Fill})
await CommonFunc.sleep(3000); await CommonFunc.sleep(1000);
let strJson3 = getInspectorByKey('image1'); let strJson3 = getInspectorByKey('image1');
let obj3 = JSON.parse(strJson3); let obj3 = JSON.parse(strJson3);
console.info('textimageOneJsunit_0400 component obj3 is: ' + obj3.$attrs.objectFit); 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}) globalThis.value.message.notify({name:'objectFit',value:ImageFit.ScaleDown})
await CommonFunc.sleep(3000); await CommonFunc.sleep(1000);
let strJson4 = getInspectorByKey('image1'); let strJson4 = getInspectorByKey('image1');
let obj4 = JSON.parse(strJson4); let obj4 = JSON.parse(strJson4);
console.info('textimageOneJsunit_0400 component obj4 is: ' + obj4.$attrs.objectFit); 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(); done();
}); });
...@@ -159,32 +173,32 @@ export default function imageOneJsunit() { ...@@ -159,32 +173,32 @@ export default function imageOneJsunit() {
await CommonFunc.sleep(1000); await CommonFunc.sleep(1000);
// test the enum of ImageRepeat // test the enum of ImageRepeat
globalThis.value.message.notify({name:'objectRepeat',value:ImageRepeat.X}) globalThis.value.message.notify({name:'objectRepeat',value:ImageRepeat.X})
await CommonFunc.sleep(3000); await CommonFunc.sleep(1000);
let strJson = getInspectorByKey('repeat'); let strJson = getInspectorByKey('repeat');
let obj = JSON.parse(strJson); let obj = JSON.parse(strJson);
console.info('textimageOneJsunit_0600 component obj is: ' + obj.$attrs.objectRepeat); 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}) globalThis.value.message.notify({name:'objectRepeat',value:ImageRepeat.Y})
await CommonFunc.sleep(3000); await CommonFunc.sleep(1000);
let strJson1 = getInspectorByKey('repeat'); let strJson1 = getInspectorByKey('repeat');
let obj1 = JSON.parse(strJson1); let obj1 = JSON.parse(strJson1);
console.info('textimageOneJsunit_0600 component obj1 is: ' + obj1.$attrs.objectRepeat); 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}) globalThis.value.message.notify({name:'objectRepeat',value:ImageRepeat.XY})
await CommonFunc.sleep(3000); await CommonFunc.sleep(1000);
let strJson2 = getInspectorByKey('repeat'); let strJson2 = getInspectorByKey('repeat');
let obj2 = JSON.parse(strJson2); let obj2 = JSON.parse(strJson2);
console.info('textimageOneJsunit_0600 component obj2 is: ' + obj2.$attrs.objectRepeat); 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}) globalThis.value.message.notify({name:'objectRepeat',value:ImageRepeat.NoRepeat})
await CommonFunc.sleep(3000); await CommonFunc.sleep(1000);
let strJson3 = getInspectorByKey('repeat'); let strJson3 = getInspectorByKey('repeat');
let obj3 = JSON.parse(strJson3); let obj3 = JSON.parse(strJson3);
console.info('textimageOneJsunit_0600 component obj3 is: ' + obj3.$attrs.objectRepeat); 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(); done();
}); });
...@@ -192,12 +206,12 @@ export default function imageOneJsunit() { ...@@ -192,12 +206,12 @@ export default function imageOneJsunit() {
console.info('imageOneJsunit_0700 START'); console.info('imageOneJsunit_0700 START');
await CommonFunc.sleep(1000); await CommonFunc.sleep(1000);
// test the illegal enum of ImageRepeat // 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); await CommonFunc.sleep(3000);
let strJson = getInspectorByKey('repeat'); let strJson = getInspectorByKey('repeat');
let obj = JSON.parse(strJson); let obj = JSON.parse(strJson);
console.info('textimageOneJsunit_0700 component obj is: ' + obj.$attrs.objectRepeat); 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(); done();
}); });
}) })
......
...@@ -30,7 +30,7 @@ export default function imageThreeJsunit() { ...@@ -30,7 +30,7 @@ export default function imageThreeJsunit() {
router.clear(); router.clear();
let pages = router.getState(); let pages = router.getState();
console.info("get imageThreeJsunit state pages:" + JSON.stringify(pages)); 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)); console.info("get imageThreeJsunit state pages.name:" + JSON.stringify(pages.name));
let result = await router.push(options); let result = await router.push(options);
console.info("push imageThreeJsunit success " + JSON.stringify(result)); console.info("push imageThreeJsunit success " + JSON.stringify(result));
......
...@@ -30,7 +30,7 @@ export default function imageTwoJsunit() { ...@@ -30,7 +30,7 @@ export default function imageTwoJsunit() {
router.clear(); router.clear();
let pages = router.getState(); let pages = router.getState();
console.info("get imageTwoJsunit state pages:" + JSON.stringify(pages)); 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)); console.info("get imageTwoJsunit state pages.name:" + JSON.stringify(pages.name));
let result = await router.push(options); let result = await router.push(options);
console.info("push imageTwoJsunit success " + JSON.stringify(result)); console.info("push imageTwoJsunit success " + JSON.stringify(result));
...@@ -66,18 +66,18 @@ export default function imageTwoJsunit() { ...@@ -66,18 +66,18 @@ export default function imageTwoJsunit() {
await CommonFunc.sleep(1000); await CommonFunc.sleep(1000);
// modify the image rendermode // modify the image rendermode
globalThis.value.message.notify({name:'renderMode',value:ImageRenderMode.Template}) globalThis.value.message.notify({name:'renderMode',value:ImageRenderMode.Template})
await CommonFunc.sleep(3000); await CommonFunc.sleep(1000);
let strJson = getInspectorByKey('image1'); let strJson = getInspectorByKey('image1');
let obj = JSON.parse(strJson); let obj = JSON.parse(strJson);
console.info('imageTwoJsunit_0200 component obj is: ' + obj.$attrs.renderMode); 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) { it('imageTwoJsunit_0300', 0, async function (done) {
console.info('imageTwoJsunit_0300 START'); console.info('imageTwoJsunit_0300 START');
await CommonFunc.sleep(1000); await CommonFunc.sleep(1000);
// modify the image rendermode // modify the image rendermode
globalThis.value.message.notify({name:'renderMode',value:10}) globalThis.value.message.notify({name:'renderMode',value:undefined})
await CommonFunc.sleep(3000); await CommonFunc.sleep(3000);
let strJson = getInspectorByKey('image1'); let strJson = getInspectorByKey('image1');
let obj = JSON.parse(strJson); let obj = JSON.parse(strJson);
...@@ -95,21 +95,21 @@ export default function imageTwoJsunit() { ...@@ -95,21 +95,21 @@ export default function imageTwoJsunit() {
let strJson = getInspectorByKey('image1'); let strJson = getInspectorByKey('image1');
let obj = JSON.parse(strJson); let obj = JSON.parse(strJson);
console.info('imageTwoJsunit_0300 component obj is: ' + obj.$attrs.interpolation); 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}) globalThis.value.message.notify({name:'interpolation',value:ImageInterpolation.Medium})
await CommonFunc.sleep(3000); await CommonFunc.sleep(3000);
let strJson2 = getInspectorByKey('image1'); let strJson2 = getInspectorByKey('image1');
let obj2 = JSON.parse(strJson2); let obj2 = JSON.parse(strJson2);
console.info('imageTwoJsunit_0400 component obj2 is: ' + obj2.$attrs.interpolation); 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}) globalThis.value.message.notify({name:'interpolation',value:ImageInterpolation.High})
await CommonFunc.sleep(3000); await CommonFunc.sleep(3000);
let strJson3 = getInspectorByKey('image1'); let strJson3 = getInspectorByKey('image1');
let obj3 = JSON.parse(strJson3); let obj3 = JSON.parse(strJson3);
console.info('imageTwoJsunit_0400 component obj3 is: ' + obj3.$attrs.interpolation); 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(); done();
}); });
...@@ -117,7 +117,7 @@ export default function imageTwoJsunit() { ...@@ -117,7 +117,7 @@ export default function imageTwoJsunit() {
console.info('imageTwoJsunit_0500 START'); console.info('imageTwoJsunit_0500 START');
await CommonFunc.sleep(1000); await CommonFunc.sleep(1000);
// test the enum of interpolation // 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); await CommonFunc.sleep(2000);
let strJson = getInspectorByKey('image1'); let strJson = getInspectorByKey('image1');
let obj = JSON.parse(strJson); let obj = JSON.parse(strJson);
...@@ -134,21 +134,21 @@ export default function imageTwoJsunit() { ...@@ -134,21 +134,21 @@ export default function imageTwoJsunit() {
let strJson = getInspectorByKey('image1'); let strJson = getInspectorByKey('image1');
let obj = JSON.parse(strJson); let obj = JSON.parse(strJson);
console.info('imageOneJsunit_0600 component obj is: ' + obj.$attrs.fillColor); 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)"}) globalThis.value.message.notify({name:'fillColor',value:"rgb(238, 130, 238)"})
await CommonFunc.sleep(2000); await CommonFunc.sleep(2000);
let strJson2 = getInspectorByKey('image1'); let strJson2 = getInspectorByKey('image1');
let obj2 = JSON.parse(strJson2); let obj2 = JSON.parse(strJson2);
console.info('imageTwoJsunit_0600 component obj2 is: ' + obj2.$attrs.fillColor); 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}) globalThis.value.message.notify({name:'fillColor',value:Color.Green})
await CommonFunc.sleep(2000); await CommonFunc.sleep(2000);
let strJson3 = getInspectorByKey('image1'); let strJson3 = getInspectorByKey('image1');
let obj3 = JSON.parse(strJson3); let obj3 = JSON.parse(strJson3);
console.info('imageTwoJsunit_0600 component obj3 is: ' + obj3.$attrs.fillColor); console.info('imageTwoJsunit_0600 component obj3 is: ' + obj3.$attrs.fillColor);
expect(obj3.$attrs.fillColor).assertEqual('#FFFF0000'); expect(obj3.$attrs.fillColor).assertEqual('#FF008000');
done(); done();
}); });
}) })
......
...@@ -62,13 +62,13 @@ export default function marqueeJsunit() { ...@@ -62,13 +62,13 @@ export default function marqueeJsunit() {
it('marqueeJsunit_0200', 0, async function (done) { it('marqueeJsunit_0200', 0, async function (done) {
console.info('marqueeJsunit_0200 START'); console.info('marqueeJsunit_0200 START');
// modify the type attribute normal value of marquee dynamically // modify the type attribute normal value of marquee dynamically
globalThis.value.message.notify({name:'fromStart',value:false}) globalThis.value.message.notify({name:'fromStart',value:true})
await CommonFunc.sleep(200); await CommonFunc.sleep(2000);
// check the value of changed parameter // check the value of changed parameter
let strJson = getInspectorByKey('marquee'); let strJson = getInspectorByKey('marquee');
let obj = JSON.parse(strJson); let obj = JSON.parse(strJson);
expect(obj.$attrs.fromStart).assertEqual('false'); expect(obj.$attrs.fromStart).assertEqual('true');
done(); done();
}); });
it('marqueeJsunit_0300', 0, async function (done) { it('marqueeJsunit_0300', 0, async function (done) {
...@@ -87,12 +87,12 @@ export default function marqueeJsunit() { ...@@ -87,12 +87,12 @@ export default function marqueeJsunit() {
it('marqueeJsunit_0400', 0, async function (done) { it('marqueeJsunit_0400', 0, async function (done) {
console.info('marqueeJsunit_0400 START'); console.info('marqueeJsunit_0400 START');
// modify the type attribute normal value of marquee dynamically // 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); await CommonFunc.sleep(2000);
// check the value of changed parameter // check the value of changed parameter
let strJson = getInspectorByKey('marquee'); let strJson = getInspectorByKey('marquee');
let obj = JSON.parse(strJson); let obj = JSON.parse(strJson);
expect(obj.$attrs.step).assertEqual('20.000000'); expect(obj.$attrs.step).assertEqual('50.000000');
done(); done();
}); });
...@@ -130,18 +130,18 @@ export default function marqueeJsunit() { ...@@ -130,18 +130,18 @@ export default function marqueeJsunit() {
let strJson = getInspectorByKey('marquee'); let strJson = getInspectorByKey('marquee');
let obj = JSON.parse(strJson); let obj = JSON.parse(strJson);
// to confirm // to confirm
expect(obj.$attrs.step).assertEqual('-30.000000'); expect(obj.$attrs.step).assertEqual('50.000000');
done(); done();
}); });
it('marqueeJsunit_0700', 0, async function (done) { it('marqueeJsunit_0700', 0, async function (done) {
console.info('marqueeJsunit_0700 START'); console.info('marqueeJsunit_0700 START');
// modify the type attribute normal value of marquee dynamically // 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); await CommonFunc.sleep(1000);
let strJson = getInspectorByKey('marquee'); let strJson = getInspectorByKey('marquee');
let obj = JSON.parse(strJson); let obj = JSON.parse(strJson);
expect(obj.$attrs.loop).assertEqual('1'); expect(obj.$attrs.loop).assertEqual('2');
done(); done();
}); });
...@@ -152,7 +152,7 @@ export default function marqueeJsunit() { ...@@ -152,7 +152,7 @@ export default function marqueeJsunit() {
await CommonFunc.sleep(2000); await CommonFunc.sleep(2000);
let strJson = getInspectorByKey('marquee'); let strJson = getInspectorByKey('marquee');
let obj = JSON.parse(strJson); let obj = JSON.parse(strJson);
expect(obj.$attrs.src).assertEqual('starts rolling'); expect(obj.$attrs.src).assertEqual('Running Marquee starts rolling');
done(); done();
}); });
......
...@@ -49,7 +49,7 @@ export default function sliderJsunit() { ...@@ -49,7 +49,7 @@ export default function sliderJsunit() {
let strJson = getInspectorByKey('sliderConstructor2'); let strJson = getInspectorByKey('sliderConstructor2');
let obj = JSON.parse(strJson); let obj = JSON.parse(strJson);
console.info('sliderJsunit_0100 component obj is: ' + obj.$attrs.style); 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(); done();
}); });
...@@ -60,7 +60,7 @@ export default function sliderJsunit() { ...@@ -60,7 +60,7 @@ export default function sliderJsunit() {
let obj = JSON.parse(strJson); let obj = JSON.parse(strJson);
console.info('sliderJsunit_0200 component obj is: ' + obj.$attrs.style + "---" + obj.$attrs.constructor.direction + "--" + obj.$attrs.constructor.value 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)); + "---" + 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.direction).assertEqual('Axis.Vertical');
expect(obj.$attrs.constructor.value).assertEqual('40.000000'); expect(obj.$attrs.constructor.value).assertEqual('40.000000');
expect(obj.$attrs.constructor.reverse).assertEqual('true'); expect(obj.$attrs.constructor.reverse).assertEqual('true');
...@@ -83,7 +83,7 @@ export default function sliderJsunit() { ...@@ -83,7 +83,7 @@ export default function sliderJsunit() {
expect(obj.$attrs.showSteps).assertEqual('true'); expect(obj.$attrs.showSteps).assertEqual('true');
expect(obj.$attrs.showTips).assertEqual('true'); expect(obj.$attrs.showTips).assertEqual('true');
expect(obj.$attrs.trackThickness).assertEqual('10.00px'); expect(obj.$attrs.trackThickness).assertEqual('10.00px');
//expect(obj.$attrs.selectedColor).assertEqual('#FF191970'); expect(obj.$attrs.selectedColor).assertEqual('#FF191970');
done(); done();
}); });
...@@ -106,7 +106,7 @@ export default function sliderJsunit() { ...@@ -106,7 +106,7 @@ export default function sliderJsunit() {
expect(obj.$attrs.blockColor).assertEqual('#FFFFFFFF'); expect(obj.$attrs.blockColor).assertEqual('#FFFFFFFF');
expect(obj.$attrs.trackColor).assertEqual('#FFEEFFFF'); expect(obj.$attrs.trackColor).assertEqual('#FFEEFFFF');
expect(obj.$attrs.trackThickness).assertEqual('12.00px'); expect(obj.$attrs.trackThickness).assertEqual('12.00px');
//expect(obj.$attrs.selectedColor).assertEqual('#FFAEFFFF'); expect(obj.$attrs.selectedColor).assertEqual('#FFAEFFFF');
done(); done();
}); });
...@@ -125,7 +125,7 @@ export default function sliderJsunit() { ...@@ -125,7 +125,7 @@ export default function sliderJsunit() {
console.info('sliderJsunit_0500 component obj is: ' + obj.$attrs.blockColor + "---" + obj.$attrs.trackColor + "--" + obj.$attrs.selectedColor + "--" ); 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.blockColor).assertEqual('#FFEE82EE');
expect(obj.$attrs.trackColor).assertEqual('#FFEE82EE'); expect(obj.$attrs.trackColor).assertEqual('#FFEE82EE');
//expect(obj.$attrs.selectedColor).assertEqual('#FFAEFFFF'); expect(obj.$attrs.selectedColor).assertEqual('#FFAEFFFF');
done(); done();
}); });
...@@ -140,14 +140,14 @@ export default function sliderJsunit() { ...@@ -140,14 +140,14 @@ export default function sliderJsunit() {
await CommonFunc.sleep(200); await CommonFunc.sleep(200);
globalThis.value.message.notify({name:'trackThickness',value:'-px'}) globalThis.value.message.notify({name:'trackThickness',value:'-px'})
await CommonFunc.sleep(200); await CommonFunc.sleep(200);
// get the slider component attribute // get the slider component attribute
let strJson = getInspectorByKey('sliderA'); let strJson = getInspectorByKey('sliderA');
let obj = JSON.parse(strJson); let obj = JSON.parse(strJson);
console.info('sliderJsunit_0600 component obj is: ' + obj.$attrs.blockColor + "---" + obj.$attrs.trackColor + "--" + obj.$attrs.selectedColor + "---" + obj.$attrs.trackThickness); 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.blockColor).assertEqual('#FFAACCEE');
expect(obj.$attrs.trackColor).assertEqual('#FFAACCEE'); expect(obj.$attrs.trackColor).assertEqual('#FFAACCEE');
expect(obj.$attrs.trackThickness).assertEqual('0.00vp'); expect(obj.$attrs.trackThickness).assertEqual('4.00vp');
//expect(obj.$attrs.selectedColor).assertEqual('#AEFFFF'); expect(obj.$attrs.selectedColor).assertEqual('#FFAACCEE');
done(); done();
}); });
...@@ -173,14 +173,14 @@ export default function sliderJsunit() { ...@@ -173,14 +173,14 @@ export default function sliderJsunit() {
let obj = JSON.parse(strJson); let obj = JSON.parse(strJson);
console.info('sliderJsunit_0700 component obj is: ' + obj.$attrs.style + "---" + obj.$attrs.constructor.direction + "--" + obj.$attrs.constructor.value 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); + "---" + 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.direction).assertEqual('Axis.Horizontal');
expect(obj.$attrs.constructor.reverse).assertEqual('false'); expect(obj.$attrs.constructor.reverse).assertEqual('false');
expect(obj.$attrs.constructor.min).assertEqual('20.000000'); expect(obj.$attrs.constructor.min).assertEqual('20.000000');
expect(obj.$attrs.constructor.max).assertEqual('80.000000'); expect(obj.$attrs.constructor.max).assertEqual('80.000000');
expect(obj.$attrs.constructor.step).assertEqual('0.900000'); expect(obj.$attrs.constructor.step).assertEqual('0.900000');
//expect(obj.$attrs.constructor.value).assertEqual('30.000000'); expect(obj.$attrs.constructor.value).assertEqual('30.000000');
done(); done();
}); });
it('sliderJsunit_0800', 0, async function (done) { it('sliderJsunit_0800', 0, async function (done) {
...@@ -205,14 +205,14 @@ export default function sliderJsunit() { ...@@ -205,14 +205,14 @@ export default function sliderJsunit() {
let obj = JSON.parse(strJson); let obj = JSON.parse(strJson);
console.info('sliderJsunit_0200 component obj is: ' + obj.$attrs.style + "---" + obj.$attrs.constructor.direction + "--" + obj.$attrs.constructor.value 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); + "---" + 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.direction).assertEqual('Axis.Horizontal');
expect(obj.$attrs.constructor.value).assertEqual('40.000000'); expect(obj.$attrs.constructor.value).assertEqual('40.000000');
expect(obj.$attrs.constructor.reverse).assertEqual('false'); expect(obj.$attrs.constructor.reverse).assertEqual('false');
expect(obj.$attrs.constructor.min).assertEqual('-20.000000'); expect(obj.$attrs.constructor.min).assertEqual('-20.000000');
expect(obj.$attrs.constructor.max).assertEqual('1000.000000'); expect(obj.$attrs.constructor.max).assertEqual('1000.000000');
expect(obj.$attrs.constructor.step).assertEqual('1020.000000'); expect(obj.$attrs.constructor.step).assertEqual('1.000000');
done(); done();
}); });
it('sliderJsunit_0900', 0, async function (done) { it('sliderJsunit_0900', 0, async function (done) {
......
...@@ -81,7 +81,7 @@ export default function textOneJsunit() { ...@@ -81,7 +81,7 @@ export default function textOneJsunit() {
let strJson = getInspectorByKey('text1'); let strJson = getInspectorByKey('text1');
let obj = JSON.parse(strJson); let obj = JSON.parse(strJson);
console.info('textOneJsunit_0300 component obj is: ' + obj.$attrs.textAlign); 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(); done();
}); });
......
...@@ -49,7 +49,7 @@ export default function textTwoJsunit() { ...@@ -49,7 +49,7 @@ export default function textTwoJsunit() {
let strJson = getInspectorByKey('text1'); let strJson = getInspectorByKey('text1');
let obj = JSON.parse(strJson); let obj = JSON.parse(strJson);
console.info('textTwoJsunit_0100 component obj is: ' + obj.$attrs.decoration); 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 // to modify the atrribute
globalThis.value.message.notify({name:'type',value:TextDecorationType.Overline}) globalThis.value.message.notify({name:'type',value:TextDecorationType.Overline})
await CommonFunc.sleep(1000); await CommonFunc.sleep(1000);
...@@ -85,9 +85,9 @@ export default function textTwoJsunit() { ...@@ -85,9 +85,9 @@ export default function textTwoJsunit() {
// test the illegal value of decoration // test the illegal value of decoration
await CommonFunc.sleep(1000); await CommonFunc.sleep(1000);
globalThis.value.message.notify({name:'type',value:5}) globalThis.value.message.notify({name:'type',value:5})
await CommonFunc.sleep(2000); await CommonFunc.sleep(1000);
globalThis.value.message.notify({name:'color',value:"#ACE"}) globalThis.value.message.notify({name:'color',value:"#ACE"})
await CommonFunc.sleep(3000); await CommonFunc.sleep(2000);
let strJson2 = getInspectorByKey('text1'); let strJson2 = getInspectorByKey('text1');
let obj2 = JSON.parse(strJson2); let obj2 = JSON.parse(strJson2);
console.info('textTwoJsunit_0200 component obj2 is: ' + obj2.$attrs.decoration); console.info('textTwoJsunit_0200 component obj2 is: ' + obj2.$attrs.decoration);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册