Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
828d8ee0
X
Xts Acts
项目概览
OpenHarmony
/
Xts Acts
1 年多 前同步成功
通知
9
Star
22
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
X
Xts Acts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
828d8ee0
编写于
3月 29, 2023
作者:
W
wang-xupeng2
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
modify any type in attrlack
Signed-off-by:
N
wang-xupeng2
<
wangxupeng2@huawei.com
>
上级
24057477
变更
24
隐藏空白更改
内联
并排
Showing
24 changed file
with
178 addition
and
166 deletion
+178
-166
arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/page2.ets
...t_attrlack/entry/src/main/ets/MainAbility/pages/page2.ets
+2
-2
arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/router.ets
..._attrlack/entry/src/main/ets/MainAbility/pages/router.ets
+1
-3
arkui/ace_ets_component_ui/entry/src/main/ets/test/BlankJsunit.test.ets
...component_ui/entry/src/main/ets/test/BlankJsunit.test.ets
+2
-2
arkui/ace_ets_component_ui/entry/src/main/ets/test/CheckBoxJsunit.test.ets
...ponent_ui/entry/src/main/ets/test/CheckBoxJsunit.test.ets
+2
-2
arkui/ace_ets_component_ui/entry/src/main/ets/test/GridJsunit.test.ets
..._component_ui/entry/src/main/ets/test/GridJsunit.test.ets
+1
-1
arkui/ace_ets_component_ui/entry/src/main/ets/test/GridRowJsunit.test.ets
...mponent_ui/entry/src/main/ets/test/GridRowJsunit.test.ets
+1
-1
arkui/ace_ets_component_ui/entry/src/main/ets/test/ListJsunit.test.ets
..._component_ui/entry/src/main/ets/test/ListJsunit.test.ets
+7
-7
arkui/ace_ets_component_ui/entry/src/main/ets/test/NavigationJsunit.test.ets
...nent_ui/entry/src/main/ets/test/NavigationJsunit.test.ets
+7
-7
arkui/ace_ets_component_ui/entry/src/main/ets/test/ProgressJsunit.test.ets
...ponent_ui/entry/src/main/ets/test/ProgressJsunit.test.ets
+2
-2
arkui/ace_ets_component_ui/entry/src/main/ets/test/RatingJsunit.test.ets
...omponent_ui/entry/src/main/ets/test/RatingJsunit.test.ets
+1
-1
arkui/ace_ets_component_ui/entry/src/main/ets/test/SearchJsunit.test.ets
...omponent_ui/entry/src/main/ets/test/SearchJsunit.test.ets
+19
-17
arkui/ace_ets_component_ui/entry/src/main/ets/test/SelectJsunit.test.ets
...omponent_ui/entry/src/main/ets/test/SelectJsunit.test.ets
+1
-1
arkui/ace_ets_component_ui/entry/src/main/ets/test/TextClockJsunit.test.ets
...onent_ui/entry/src/main/ets/test/TextClockJsunit.test.ets
+5
-5
arkui/ace_ets_component_ui/entry/src/main/ets/test/TextInputJsunit.test.ets
...onent_ui/entry/src/main/ets/test/TextInputJsunit.test.ets
+21
-21
arkui/ace_ets_component_ui/entry/src/main/ets/test/TextPickerJsunit.test.ets
...nent_ui/entry/src/main/ets/test/TextPickerJsunit.test.ets
+3
-3
arkui/ace_ets_component_ui/entry/src/main/ets/test/ToggleJsunit.test.ets
...omponent_ui/entry/src/main/ets/test/ToggleJsunit.test.ets
+7
-7
arkui/ace_ets_component_ui/entry/src/main/ets/test/imageAnimatorJsunit.test.ets
...t_ui/entry/src/main/ets/test/imageAnimatorJsunit.test.ets
+12
-14
arkui/ace_ets_component_ui/entry/src/main/ets/test/imageOneJsunit.test.ets
...ponent_ui/entry/src/main/ets/test/imageOneJsunit.test.ets
+44
-30
arkui/ace_ets_component_ui/entry/src/main/ets/test/imageThreeJsunit.test.ets
...nent_ui/entry/src/main/ets/test/imageThreeJsunit.test.ets
+1
-1
arkui/ace_ets_component_ui/entry/src/main/ets/test/imageTwoJsunit.test.ets
...ponent_ui/entry/src/main/ets/test/imageTwoJsunit.test.ets
+11
-11
arkui/ace_ets_component_ui/entry/src/main/ets/test/marqueeJsunit.test.ets
...mponent_ui/entry/src/main/ets/test/marqueeJsunit.test.ets
+10
-10
arkui/ace_ets_component_ui/entry/src/main/ets/test/sliderJsunit.test.ets
...omponent_ui/entry/src/main/ets/test/sliderJsunit.test.ets
+14
-14
arkui/ace_ets_component_ui/entry/src/main/ets/test/textOneJsunit.test.ets
...mponent_ui/entry/src/main/ets/test/textOneJsunit.test.ets
+1
-1
arkui/ace_ets_component_ui/entry/src/main/ets/test/textTwoJsunit.test.ets
...mponent_ui/entry/src/main/ets/test/textTwoJsunit.test.ets
+3
-3
未找到文件。
arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/page2.ets
浏览文件 @
828d8ee0
...
...
@@ -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: {
...
...
arkui/ace_ets_component_attrlack/entry/src/main/ets/MainAbility/pages/router.ets
浏览文件 @
828d8ee0
...
...
@@ -45,9 +45,7 @@ struct RouterStandard {
url: 'pages/page2',
params: {
text: '这是第二页的值',
data: {
array: [13, 46, 79]
}
data: [13, 46, 79]
}
}
try {
...
...
arkui/ace_ets_component_ui/entry/src/main/ets/test/BlankJsunit.test.ets
浏览文件 @
828d8ee0
...
...
@@ -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.00
vp
');
expect(obj.$attrs.min).assertEqual('80.00
px
');
done();
});
...
...
arkui/ace_ets_component_ui/entry/src/main/ets/test/CheckBoxJsunit.test.ets
浏览文件 @
828d8ee0
...
...
@@ -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).assert
Fals
e();
expect(isChecked).assert
Tru
e();
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);
...
...
arkui/ace_ets_component_ui/entry/src/main/ets/test/GridJsunit.test.ets
浏览文件 @
828d8ee0
...
...
@@ -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');
...
...
arkui/ace_ets_component_ui/entry/src/main/ets/test/GridRowJsunit.test.ets
浏览文件 @
828d8ee0
...
...
@@ -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();
});
...
...
arkui/ace_ets_component_ui/entry/src/main/ets/test/ListJsunit.test.ets
浏览文件 @
828d8ee0
...
...
@@ -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 = grid
Top
.left
//
let gridRight = CommonFunc.getComponentRect('grid2');
let right = grid
Top
.right
let gridLeft = CommonFunc.getComponentRect('grid2');
let left = grid
Left
.left
let gridRight = CommonFunc.getComponentRect('grid2');
let right = grid
Right
.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();
});
...
...
arkui/ace_ets_component_ui/entry/src/main/ets/test/NavigationJsunit.test.ets
浏览文件 @
828d8ee0
...
...
@@ -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(
tru
e);
expect(obj.$attrs.hideTitleBar).assertEqual(
fals
e);
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();
});
...
...
arkui/ace_ets_component_ui/entry/src/main/ets/test/ProgressJsunit.test.ets
浏览文件 @
828d8ee0
...
...
@@ -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('#
0000
0000');
expect(obj.$attrs.backgroundColor).assertEqual('#
FFFF
0000');
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('#
00
000000');
expect(obj.$attrs.backgroundColor).assertEqual('#
FF
000000');
console.info('[ProgressJsunit_0500] END');
done();
});
...
...
arkui/ace_ets_component_ui/entry/src/main/ets/test/RatingJsunit.test.ets
浏览文件 @
828d8ee0
...
...
@@ -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.0
00000');
expect(obj1.$attrs.rating).assertEqual('
2.5
00000');
console.info('[RatingJsunit_0300] END');
done();
});
...
...
arkui/ace_ets_component_ui/entry/src/main/ets/test/SearchJsunit.test.ets
浏览文件 @
828d8ee0
...
...
@@ -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.i
nspector.i
con).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 textComponent
6
= await driver.findComponent(BY.text('粘贴'));
await textComponent
6
.click()
let textComponent
8
= await driver.findComponent(BY.text('粘贴'));
await textComponent
8
.click()
let paste = await driver.findComponent(BY.key('paste'));
let text5 = await paste.getText();
expect(text5).assertEqual('onPaste:hello');
...
...
arkui/ace_ets_component_ui/entry/src/main/ets/test/SelectJsunit.test.ets
浏览文件 @
828d8ee0
...
...
@@ -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('#FFFF
00
00');
expect(obj.$attrs.selectedOptionFontColor).assertEqual('#FFFF
FF
00');
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');
...
...
arkui/ace_ets_component_ui/entry/src/main/ets/test/TextClockJsunit.test.ets
浏览文件 @
828d8ee0
...
...
@@ -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();
});
...
...
arkui/ace_ets_component_ui/entry/src/main/ets/test/TextInputJsunit.test.ets
浏览文件 @
828d8ee0
...
...
@@ -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('#FF
808080
');
expect(obj.$attrs.placeholderFont).assertEqual('{"style":"FontStyle.Normal","size":"1
4
.00fp","weight":"400","fontFamily":"sans-serif"}');
expect(obj.$attrs.enterKeyType).assertEqual('EnterKeyType.
Next
');
expect(obj.$attrs.caretColor).assertEqual('#FF00
00
FF');
expect(obj.$attrs.maxLength).assertEqual('
10
');
expect(obj.$attrs.placeholderColor).assertEqual('#FF
182431
');
expect(obj.$attrs.placeholderFont).assertEqual('{"style":"FontStyle.Normal","size":"1
6
.00fp","weight":"400","fontFamily":"sans-serif"}');
expect(obj.$attrs.enterKeyType).assertEqual('EnterKeyType.
Done
');
expect(obj.$attrs.caretColor).assertEqual('#FF00
7D
FF');
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.
Emai
l');
expect(obj.$attrs.type).assertEqual('InputType.
Norma
l');
expect(obj.$attrs.placeholderColor).assertEqual('#FF008000');
expect(obj.$attrs.placeholderFont).assertEqual('{"style":"FontStyle.Normal","size":"1
4.00fp","weight":"4
00","fontFamily":"sans-serif"}');
expect(obj.$attrs.placeholderFont).assertEqual('{"style":"FontStyle.Normal","size":"1
8.00fp","weight":"5
00","fontFamily":"sans-serif"}');
expect(obj.$attrs.enterKeyType).assertEqual('EnterKeyType.Done');
expect(obj.$attrs.caretColor).assertEqual('#FF
007DFF
');
expect(obj.$attrs.caretColor).assertEqual('#FF
FF0000
');
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('#FF
80808
0');
expect(obj.$attrs.placeholderFont).assertEqual('{"style":"FontStyle.Normal","size":"1
4.00fp","weight":"4
00","fontFamily":"sans-serif"}');
expect(obj.$attrs.placeholderColor).assertEqual('#FF
00800
0');
expect(obj.$attrs.placeholderFont).assertEqual('{"style":"FontStyle.Normal","size":"1
8.00fp","weight":"5
00","fontFamily":"sans-serif"}');
expect(obj.$attrs.enterKeyType).assertEqual('EnterKeyType.Done');
expect(obj.$attrs.caretColor).assertEqual('#FF00007B');
expect(obj.$attrs.maxLength).assertEqual('INF');
...
...
arkui/ace_ets_component_ui/entry/src/main/ets/test/TextPickerJsunit.test.ets
浏览文件 @
828d8ee0
...
...
@@ -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');
...
...
arkui/ace_ets_component_ui/entry/src/main/ets/test/ToggleJsunit.test.ets
浏览文件 @
828d8ee0
...
...
@@ -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
tru
e');
expect(checkbox).assertEqual('checkbox
fals
e');
await checkboxButton.click();
await CommonFunc.sleep(1000);
let checkbox1 = await textComponent.getText();
console.info("[ToggleJsunit_0300] checkbox1: " + JSON.stringify(checkbox1));
expect(checkbox1).assertEqual('checkbox
fals
e');
expect(checkbox1).assertEqual('checkbox
tru
e');
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('#FFFF
0000
');
expect(obj1.$attrs.switchPointColor).assertEqual('#FFFF
FFFF
');
console.info('[ToggleJsunit_0600] END');
done();
});
...
...
arkui/ace_ets_component_ui/entry/src/main/ets/test/imageAnimatorJsunit.test.ets
浏览文件 @
828d8ee0
...
...
@@ -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(
3
000);
await CommonFunc.sleep(
1
000);
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();
...
...
arkui/ace_ets_component_ui/entry/src/main/ets/test/imageOneJsunit.test.ets
浏览文件 @
828d8ee0
...
...
@@ -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(
2
000);
await CommonFunc.sleep(
1
000);
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(
3
000);
await CommonFunc.sleep(
1
000);
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(
2
000);
await CommonFunc.sleep(
1
000);
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(
2
000);
await CommonFunc.sleep(
1
000);
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(
2
000);
await CommonFunc.sleep(
1
000);
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.jp
g');
expect(obj.$attrs.src).assertEqual('resource://rawfile/
aaa.pn
g');
});
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(
3
000);
await CommonFunc.sleep(
1
000);
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(
3
000);
await CommonFunc.sleep(
1
000);
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(
3
000);
await CommonFunc.sleep(
1
000);
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(
3
000);
await CommonFunc.sleep(
1
000);
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(
3
000);
await CommonFunc.sleep(
1
000);
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(
3
000);
await CommonFunc.sleep(
1
000);
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(
3
000);
await CommonFunc.sleep(
1
000);
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:'object
Fi
t',value:ImageRepeat.NoRepeat})
await CommonFunc.sleep(
3
000);
globalThis.value.message.notify({name:'object
Repea
t',value:ImageRepeat.NoRepeat})
await CommonFunc.sleep(
1
000);
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();
});
})
...
...
arkui/ace_ets_component_ui/entry/src/main/ets/test/imageThreeJsunit.test.ets
浏览文件 @
828d8ee0
...
...
@@ -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));
...
...
arkui/ace_ets_component_ui/entry/src/main/ets/test/imageTwoJsunit.test.ets
浏览文件 @
828d8ee0
...
...
@@ -30,7 +30,7 @@ export default function imageTwoJsunit() {
router.clear();
let pages = router.getState();
console.info("get imageTwoJsunit state pages:" + JSON.stringify(pages));
if (!("
text
Two" == pages.name)) {
if (!("
image
Two" == 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(
3
000);
await CommonFunc.sleep(
1
000);
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('#FFFF
0000
');
expect(obj.$attrs.fillColor).assertEqual('#FFFF
EEAA
');
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('#FF
FF0000
');
expect(obj2.$attrs.fillColor).assertEqual('#FF
EE82EE
');
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('#FF
FF0
000');
expect(obj3.$attrs.fillColor).assertEqual('#FF
008
000');
done();
});
})
...
...
arkui/ace_ets_component_ui/entry/src/main/ets/test/marqueeJsunit.test.ets
浏览文件 @
828d8ee0
...
...
@@ -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:
fals
e})
await CommonFunc.sleep(200);
globalThis.value.message.notify({name:'fromStart',value:
tru
e})
await CommonFunc.sleep(200
0
);
// check the value of changed parameter
let strJson = getInspectorByKey('marquee');
let obj = JSON.parse(strJson);
expect(obj.$attrs.fromStart).assertEqual('
fals
e');
done();
expect(obj.$attrs.fromStart).assertEqual('
tru
e');
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:
2
0})
globalThis.value.message.notify({name:'step',value:
5
0})
await CommonFunc.sleep(2000);
// check the value of changed parameter
let strJson = getInspectorByKey('marquee');
let obj = JSON.parse(strJson);
expect(obj.$attrs.step).assertEqual('
2
0.000000');
expect(obj.$attrs.step).assertEqual('
5
0.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('
-3
0.000000');
expect(obj.$attrs.step).assertEqual('
5
0.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();
});
...
...
arkui/ace_ets_component_ui/entry/src/main/ets/test/sliderJsunit.test.ets
浏览文件 @
828d8ee0
...
...
@@ -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('Slider
Mode.OUTSET
');
expect(obj.$attrs.style).assertEqual('Slider
Style.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('Slider
Mode.INSET
');
expect(obj.$attrs.style).assertEqual('Slider
Style.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('Slider
Mode.OUTSET
');
expect(obj.$attrs.style).assertEqual('Slider
Style.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('Slider
Mode.OUTSET
');
expect(obj.$attrs.style).assertEqual('Slider
Style.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('1
020
.000000');
done();
expect(obj.$attrs.constructor.step).assertEqual('1.000000');
done();
});
it('sliderJsunit_0900', 0, async function (done) {
...
...
arkui/ace_ets_component_ui/entry/src/main/ets/test/textOneJsunit.test.ets
浏览文件 @
828d8ee0
...
...
@@ -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.
Righ
t');
expect(obj.$attrs.textAlign).assertEqual('TextAlign.
Lef
t');
done();
});
...
...
arkui/ace_ets_component_ui/entry/src/main/ets/test/textTwoJsunit.test.ets
浏览文件 @
828d8ee0
...
...
@@ -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(
2
000);
await CommonFunc.sleep(
1
000);
globalThis.value.message.notify({name:'color',value:"#ACE"})
await CommonFunc.sleep(
3
000);
await CommonFunc.sleep(
2
000);
let strJson2 = getInspectorByKey('text1');
let obj2 = JSON.parse(strJson2);
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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录