Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
7eddc4d2
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看板
提交
7eddc4d2
编写于
4月 04, 2023
作者:
W
wang-xupeng2
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update Ui testcases
Signed-off-by:
N
wang-xupeng2
<
wangxupeng2@huawei.com
>
上级
817001f1
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
56 addition
and
53 deletion
+56
-53
arkui/ace_ets_component_ui/entry/src/main/ets/MainAbility/pages/checkBoxExample.ets
.../entry/src/main/ets/MainAbility/pages/checkBoxExample.ets
+1
-1
arkui/ace_ets_component_ui/entry/src/main/ets/MainAbility/pages/imageAnimator.ets
...ui/entry/src/main/ets/MainAbility/pages/imageAnimator.ets
+2
-2
arkui/ace_ets_component_ui/entry/src/main/ets/test/TextPickerJsunit.test.ets
...nent_ui/entry/src/main/ets/test/TextPickerJsunit.test.ets
+8
-8
arkui/ace_ets_component_ui/entry/src/main/ets/test/imageAnimatorJsunit.test.ets
...t_ui/entry/src/main/ets/test/imageAnimatorJsunit.test.ets
+16
-12
arkui/ace_ets_component_ui/entry/src/main/ets/test/sliderJsunit.test.ets
...omponent_ui/entry/src/main/ets/test/sliderJsunit.test.ets
+29
-30
未找到文件。
arkui/ace_ets_component_ui/entry/src/main/ets/MainAbility/pages/checkBoxExample.ets
浏览文件 @
7eddc4d2
...
@@ -50,7 +50,7 @@ struct CheckboxExample {
...
@@ -50,7 +50,7 @@ struct CheckboxExample {
} else {
} else {
this.selectedColor = "#000000"
this.selectedColor = "#000000"
}
}
}).key(
"check1").id(
'chek1')
}).key('chek1')
Checkbox({name: 'checkbox2', group: 'checkboxGroup'})
Checkbox({name: 'checkbox2', group: 'checkboxGroup'})
.select(false)
.select(false)
.selectedColor(0x39a2db)
.selectedColor(0x39a2db)
...
...
arkui/ace_ets_component_ui/entry/src/main/ets/MainAbility/pages/imageAnimator.ets
浏览文件 @
7eddc4d2
...
@@ -44,7 +44,7 @@ struct ImageAnimatorExample {
...
@@ -44,7 +44,7 @@ struct ImageAnimatorExample {
}
}
let callback:Callback = (message:any) => {
let callback:Callback = (message:any) => {
console.error('message = ' + message.name + "--" + message.value)
console.error('message = ' + message.name + "--" + message.value)
if (message.name == '
typ
e') {
if (message.name == '
stat
e') {
this.state = message.value
this.state = message.value
}
}
if (message.name == 'reverse') {
if (message.name == 'reverse') {
...
@@ -99,7 +99,7 @@ struct ImageAnimatorExample {
...
@@ -99,7 +99,7 @@ struct ImageAnimatorExample {
.margin({ top: 100 })
.margin({ top: 100 })
.key('imageAnimator')
.key('imageAnimator')
.onStart(() => {
.onStart(() => {
console.info('Start')
console.info('Start
123456
')
this.message1 = 'start'
this.message1 = 'start'
})
})
.onPause(() => {
.onPause(() => {
...
...
arkui/ace_ets_component_ui/entry/src/main/ets/test/TextPickerJsunit.test.ets
浏览文件 @
7eddc4d2
...
@@ -61,10 +61,10 @@ export default function TextPickerJsunit() {
...
@@ -61,10 +61,10 @@ export default function TextPickerJsunit() {
// Get the content of Initial value
// Get the content of Initial value
let driver = await UiDriver.create()
let driver = await UiDriver.create()
let
change = await driver.findComponent(BY.key('text')
);
let
strJson1 = getInspectorByKey('text'
);
let
textChange = await change.getText(
);
let
obj1 = JSON.parse(strJson1
);
console.info("[TextPickerJsunit_0100]
textChange: " + JSON.stringify(textChange
));
console.info("[TextPickerJsunit_0100]
obj1: " + JSON.stringify(obj1
));
expect(
textChange
).assertEqual('value: 0');
expect(
obj1.$attrs.content
).assertEqual('value: 0');
console.info('[TextPickerJsunit_0100] END');
console.info('[TextPickerJsunit_0100] END');
done();
done();
});
});
...
@@ -110,10 +110,10 @@ export default function TextPickerJsunit() {
...
@@ -110,10 +110,10 @@ export default function TextPickerJsunit() {
await CommonFunc.sleep(1000);
await CommonFunc.sleep(1000);
let driver = await UiDriver.create()
let driver = await UiDriver.create()
await driver.swipe(Math.round(right / 2), Math.round(bottom * 2 / 3), Math.round(right / 2), Math.round(bottom / 3));
await driver.swipe(Math.round(right / 2), Math.round(bottom * 2 / 3), Math.round(right / 2), Math.round(bottom / 3));
let
change = await driver.findComponent(BY.key('text')
);
let
strJson = getInspectorByKey('text'
);
let
textChange = await change.getText(
);
let
obj = JSON.parse(strJson
);
console.info("[TextPickerJsunit_0300]
textChange: " + JSON.stringify(textChange
));
console.info("[TextPickerJsunit_0300]
obj: " + JSON.stringify(obj
));
expect(
textChange
== 'value: 0').assertFalse();
expect(
obj.$attrs.content
== 'value: 0').assertFalse();
done();
done();
});
});
...
...
arkui/ace_ets_component_ui/entry/src/main/ets/test/imageAnimatorJsunit.test.ets
浏览文件 @
7eddc4d2
...
@@ -76,19 +76,21 @@ export default function imageAniamtorJsunit() {
...
@@ -76,19 +76,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_0200] component obj is: ' + obj.$attrs.state);
console.info('[imageAniamtorJsunit_0200] component obj is: ' + obj.$attrs.state);
//expect(obj.$attrs.state).assertEqual('AnimationStatus.Running');
expect(obj.$attrs.state).assertEqual('AnimationStatus.Running');
globalThis.value.message.notify({name:'state',value:AnimationStatus.Paused})
globalThis.value.message.notify({name:'state',value:AnimationStatus.Paused})
await CommonFunc.sleep(
5
000);
await CommonFunc.sleep(
1
000);
let strJson2 = getInspectorByKey('imageAnimator');
let strJson2 = getInspectorByKey('imageAnimator');
let obj2 = JSON.parse(strJson2);
let obj2 = JSON.parse(strJson2);
console.info('[imageAniamtorJsunit_0200] component obj2 is: ' + obj2.$attrs.state);
console.info('[imageAniamtorJsunit_0200] component obj2 is: ' + obj2.$attrs.state);
//expect(obj2.$attrs.state).assertEqual('AnimationStatus.Paused');
expect(obj2.$attrs.state).assertEqual('AnimationStatus.Paused');
globalThis.value.message.notify({name:'state',value:AnimationStatus.Stopped})
globalThis.value.message.notify({name:'state',value:AnimationStatus.Stopped})
await CommonFunc.sleep(
5
000);
await CommonFunc.sleep(
1
000);
let strJson3 = getInspectorByKey('imageAnimator');
let strJson3 = getInspectorByKey('imageAnimator');
let obj3 = JSON.parse(strJson3);
let obj3 = JSON.parse(strJson3);
console.info('[imageAniamtorJsunit_0200] component obj3 is: ' + obj3.$attrs.state);
console.info('[imageAniamtorJsunit_0200] component obj3 is: ' + obj3.$attrs.state);
//
expect(obj3.$attrs.state).assertEqual('AnimationStatus.Stopped');
expect(obj3.$attrs.state).assertEqual('AnimationStatus.Stopped');
console.info('[imageAniamtorJsunit_0200] END');
console.info('[imageAniamtorJsunit_0200] END');
done();
done();
});
});
...
@@ -178,13 +180,15 @@ export default function imageAniamtorJsunit() {
...
@@ -178,13 +180,15 @@ export default function imageAniamtorJsunit() {
expect(btn != null).assertTrue();
expect(btn != null).assertTrue();
await btn.click();
await btn.click();
await CommonFunc.sleep(1000);
await CommonFunc.sleep(1000);
let textComponent = await driver.findComponent(BY.key('t1'));
let strJson = getInspectorByKey('t1');
let text = await textComponent.getText();
let obj = JSON.parse(strJson);
expect(text).assertEqual('start');
console.info("[imageAniamtorJsunit_0700] obj: " + JSON.stringify(obj));
expect(obj.$attrs.content).assertEqual('start');
await CommonFunc.sleep(3000);
await CommonFunc.sleep(3000);
let textComponent1 = await driver.findComponent(BY.key('t5'));
let strJson1 = getInspectorByKey('t5');
let text1 = await textComponent1.getText();
let obj1 = JSON.parse(strJson1);
expect(text1).assertEqual('onFinish');
console.info("[imageAniamtorJsunit_0700] obj1: " + JSON.stringify(obj1));
expect(obj1.$attrs.content).assertEqual('onFinish');
console.info('imageAniamtorJsunit_0700 END');
console.info('imageAniamtorJsunit_0700 END');
done();
done();
});
});
...
...
arkui/ace_ets_component_ui/entry/src/main/ets/test/sliderJsunit.test.ets
浏览文件 @
7eddc4d2
...
@@ -184,7 +184,32 @@ export default function sliderJsunit() {
...
@@ -184,7 +184,32 @@ export default function sliderJsunit() {
});
});
it('sliderJsunit_0800', 0, async function (done) {
it('sliderJsunit_0800', 0, async function (done) {
// Verify the swipe function of slider component
console.info('sliderJsunit_0800 START');
console.info('sliderJsunit_0800 START');
await CommonFunc.sleep(1000);
let sliderT = CommonFunc.getComponentRect('sliderConstructor');
let top = sliderT.top
let bottom = sliderT.bottom
let left = sliderT.left
let right = sliderT.right
let x = Math.round(left + (right - left) / 2)
let driver = await Driver.create();
await driver.delayMs(waitUiReadyMs);
await driver.swipe(x, Math.round(bottom - 20), x, Math.round(top + 50));
await driver.delayMs(waitUiReadyMs);
let strJson = getInspectorByKey('tex');
let obj = JSON.parse(strJson);
console.info("[sliderJsunit_0800] obj: " + JSON.stringify(obj));
expect(obj.$attrs.content).assertEqual('30');
let strJson1 = getInspectorByKey('modeT');
let obj1 = JSON.parse(strJson1);
console.info("[sliderJsunit_0800] obj1: " + JSON.stringify(obj1));
expect(obj1.$attrs.content).assertEqual('mode');
done();
});
it('sliderJsunit_0900', 0, async function (done) {
console.info('[sliderJsunit_0800] START');
// modify the constructor attribute of slider dynamically
// modify the constructor attribute of slider dynamically
globalThis.value.message.notify({name:'vInSetValueOne',value:-30})
globalThis.value.message.notify({name:'vInSetValueOne',value:-30})
await CommonFunc.sleep(1000);
await CommonFunc.sleep(1000);
...
@@ -203,7 +228,7 @@ export default function sliderJsunit() {
...
@@ -203,7 +228,7 @@ export default function sliderJsunit() {
// check the value of changed parameter
// check the value of changed parameter
let strJson = getInspectorByKey('sliderConstructor');
let strJson = getInspectorByKey('sliderConstructor');
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_0900]
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('SliderStyle.OutSet');
expect(obj.$attrs.style).assertEqual('SliderStyle.OutSet');
expect(obj.$attrs.constructor.direction).assertEqual('Axis.Horizontal');
expect(obj.$attrs.constructor.direction).assertEqual('Axis.Horizontal');
...
@@ -212,33 +237,7 @@ export default function sliderJsunit() {
...
@@ -212,33 +237,7 @@ export default function sliderJsunit() {
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('1.000000');
expect(obj.$attrs.constructor.step).assertEqual('1.000000');
done();
console.info('[sliderJsunit_0900] END');
});
it('sliderJsunit_0900', 0, async function (done) {
// Verify the swipe function of slider component
console.info('sliderJsunit_0900 START');
await CommonFunc.sleep(1000);
let sliderT = CommonFunc.getComponentRect('sliderConstructor2');
let top = sliderT.top
let sliderB = CommonFunc.getComponentRect('sliderConstructor2');
let bottom = sliderB.bottom
let sliderL = CommonFunc.getComponentRect('sliderConstructor2');
let left = sliderL.left
let sliderR = CommonFunc.getComponentRect('sliderConstructor2');
let right = sliderR.right
let driver = await Driver.create();
await driver.delayMs(waitUiReadyMs);
await driver.swipe(Math.round((right - left) / 2), Math.round(bottom - 10), Math.round((right - left) / 2), Math.round(top + 10));
await driver.delayMs(waitUiReadyMs);
let textIn = await driver.findComponent(ON.id('tex'));
let txt = await textIn.getText();
console.info('sliderJsunit_0900 component textIn obj is: ' + txt);
expect(txt).assertEqual('20');
let modeT = await driver.findComponent(ON.id('modeT'));
let txtt = await modeT.getText();
console.info('sliderJsunit_0900 modeT component obj is: ' + txtt);
expect(txtt).assertEqual('mode');
done();
done();
});
});
})
})
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录