Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
a439684f
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看板
提交
a439684f
编写于
4月 12, 2023
作者:
W
wang-xupeng2
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update UI testcase about delay time
Signed-off-by:
N
wang-xupeng2
<
wangxupeng2@huawei.com
>
上级
7bc244a0
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
29 addition
and
29 deletion
+29
-29
arkui/ace_ets_component_ui/entry/src/main/ets/test/TimePickerJsunit.test.ets
...nent_ui/entry/src/main/ets/test/TimePickerJsunit.test.ets
+15
-15
arkui/ace_ets_component_ui/entry/src/main/ets/test/imageAnimatorJsunit.test.ets
...t_ui/entry/src/main/ets/test/imageAnimatorJsunit.test.ets
+2
-2
arkui/ace_ets_component_ui/entry/src/main/ets/test/imageOneJsunit.test.ets
...ponent_ui/entry/src/main/ets/test/imageOneJsunit.test.ets
+8
-8
arkui/ace_ets_component_ui/entry/src/main/ets/test/sliderJsunit.test.ets
...omponent_ui/entry/src/main/ets/test/sliderJsunit.test.ets
+2
-2
arkui/ace_ets_component_ui/entry/src/main/ets/test/textAreaJsunit.test.ets
...ponent_ui/entry/src/main/ets/test/textAreaJsunit.test.ets
+2
-2
未找到文件。
arkui/ace_ets_component_ui/entry/src/main/ets/test/TimePickerJsunit.test.ets
浏览文件 @
a439684f
...
...
@@ -101,17 +101,18 @@ export default function TimePickerJsunit() {
let switchButton = await driver.findComponent(BY.key('button'));
await switchButton.click();
await CommonFunc.sleep(1000);
let
modeComponent = await driver.findComponent(BY.key('mode')
);
let
mode = await modeComponent.getText(
);
console.info("[TimePickerJsunit_0200]
mode: " + JSON.stringify(mode
));
expect(
mode
).assertEqual('24hour:true');
let
strJson = getInspectorByKey('mode'
);
let
obj = JSON.parse(strJson
);
console.info("[TimePickerJsunit_0200]
component obj is: " + JSON.stringify(obj
));
expect(
obj.$attrs.content
).assertEqual('24hour:true');
// Verify switch 12-hour
await switchButton.click();
await CommonFunc.sleep(1000);
let mode1 = await modeComponent.getText();
console.info("[TimePickerJsunit_0200] mode1: " + JSON.stringify(mode1));
expect(mode1).assertEqual('24hour:false');
let strJson1 = getInspectorByKey('mode');
let obj1 = JSON.parse(strJson1);
console.info("[TimePickerJsunit_0200] component obj1 is: " + JSON.stringify(obj1));
expect(obj1.$attrs.content).assertEqual('24hour:false');
console.info('[TimePickerJsunit_0200] END');
done();
});
...
...
@@ -123,21 +124,20 @@ export default function TimePickerJsunit() {
let switchButton = await driver.findComponent(BY.key('button'));
await switchButton.click();
await CommonFunc.sleep(1000);
let timePickerTop = CommonFunc.getComponentRect('timePicker');
let top = timePickerTop.top
let timePickerBottom = CommonFunc.getComponentRect('timePicker');
let bottom = timePickerBottom.bottom
let timePickerRight = CommonFunc.getComponentRect('timePicker');
let right = timePickerRight.right
let timePicker = CommonFunc.getComponentRect('timePicker');
let top = timePicker.top
let bottom = timePicker.bottom
let right = timePicker.right
let middle = (top + bottom) / 2
// Verify hour
let hour = await driver.findComponent(BY.key('hour'));
let hour1 = await hour.getText();
console.info("[TimePickerJsunit_0300] hour1: " + JSON.stringify(hour1));
await driver.swipe(Math.round(right * 0.2
3), Math.round(middle + 100), Math.round(right * 0.23
), Math.round(middle - 100));
await driver.swipe(Math.round(right * 0.2
4), Math.round(middle + 100), Math.round(right * 0.24
), Math.round(middle - 100));
await CommonFunc.sleep(1000);
let hour2 = await hour.getText();
let hourComponent = await driver.findComponent(BY.key('hour'));
let hour2 = await hourComponent.getText();
console.info("[TimePickerJsunit_0300] hour2: " + JSON.stringify(hour2));
expect(hour1 == hour2).assertFalse();
...
...
arkui/ace_ets_component_ui/entry/src/main/ets/test/imageAnimatorJsunit.test.ets
浏览文件 @
a439684f
...
...
@@ -79,14 +79,14 @@ export default function imageAniamtorJsunit() {
expect(obj.$attrs.state).assertEqual('AnimationStatus.Running');
globalThis.value.message.notify({name:'state',value:AnimationStatus.Paused})
await CommonFunc.sleep(
1
000);
await CommonFunc.sleep(
2
000);
let strJson2 = getInspectorByKey('imageAnimator');
let obj2 = JSON.parse(strJson2);
console.info('[imageAniamtorJsunit_0200] component obj2 is: ' + obj2.$attrs.state);
expect(obj2.$attrs.state).assertEqual('AnimationStatus.Paused');
globalThis.value.message.notify({name:'state',value:AnimationStatus.Stopped})
await CommonFunc.sleep(
1
000);
await CommonFunc.sleep(
2
000);
let strJson3 = getInspectorByKey('imageAnimator');
let obj3 = JSON.parse(strJson3);
console.info('[imageAniamtorJsunit_0200] component obj3 is: ' + obj3.$attrs.state);
...
...
arkui/ace_ets_component_ui/entry/src/main/ets/test/imageOneJsunit.test.ets
浏览文件 @
a439684f
...
...
@@ -36,7 +36,7 @@ export default function imageOneJsunit() {
}
} catch (err) {
console.error("push imageOneJsunit page error:" + err);
expect().assertFail();
expect().assertFail();
}
done();
});
...
...
@@ -114,42 +114,42 @@ export default function imageOneJsunit() {
await CommonFunc.sleep(1000);
// test the enum of objectFit
globalThis.value.message.notify({name:'objectFit',value:ImageFit.Cover})
await CommonFunc.sleep(
1
00);
await CommonFunc.sleep(
5
00);
let strJson = getInspectorByKey('objectFit');
let obj = JSON.parse(strJson);
console.info('textimageOneJsunit_0400 component obj is: ' + obj.$attrs.objectFit);
expect(obj.$attrs.objectFit).assertEqual('ImageFit.Cover');
globalThis.value.message.notify({name:'objectFit',value:ImageFit.Auto})
await CommonFunc.sleep(
1
00);
await CommonFunc.sleep(
5
00);
let strJson2 = getInspectorByKey('objectFit');
let obj2 = JSON.parse(strJson2);
console.info('textimageOneJsunit_0400 component obj2 is: ' + obj2.$attrs.objectFit);
expect(obj2.$attrs.objectFit).assertEqual('ImageFit.Auto');
globalThis.value.message.notify({name:'objectFit',value:ImageFit.Fill})
await CommonFunc.sleep(
1
00);
await CommonFunc.sleep(
5
00);
let strJson3 = getInspectorByKey('objectFit');
let obj3 = JSON.parse(strJson3);
console.info('textimageOneJsunit_0400 component obj3 is: ' + obj3.$attrs.objectFit);
expect(obj3.$attrs.objectFit).assertEqual('ImageFit.Fill');
globalThis.value.message.notify({name:'objectFit',value:ImageFit.ScaleDown})
await CommonFunc.sleep(
1
00);
await CommonFunc.sleep(
5
00);
let strJson4 = getInspectorByKey('objectFit');
let obj4 = JSON.parse(strJson4);
console.info('textimageOneJsunit_0400 component obj4 is: ' + obj4.$attrs.objectFit);
expect(obj4.$attrs.objectFit).assertEqual('ImageFit.ScaleDown');
globalThis.value.message.notify({name:'objectFit',value:ImageFit.None})
await CommonFunc.sleep(
1
00);
await CommonFunc.sleep(
5
00);
let strJson5 = getInspectorByKey('objectFit');
let obj5 = JSON.parse(strJson5);
console.info('textimageOneJsunit_0400 component obj5 is: ' + obj5.$attrs.objectFit);
expect(obj5.$attrs.objectFit).assertEqual('ImageFit.None');
globalThis.value.message.notify({name:'objectFit',value:ImageFit.Contain})
await CommonFunc.sleep(
1
00);
await CommonFunc.sleep(
5
00);
let strJson6 = getInspectorByKey('objectFit');
let obj6 = JSON.parse(strJson6);
console.info('textimageOneJsunit_0400 component obj6 is: ' + obj6.$attrs.objectFit);
...
...
@@ -217,4 +217,4 @@ export default function imageOneJsunit() {
done();
});
})
}
\ No newline at end of file
}
arkui/ace_ets_component_ui/entry/src/main/ets/test/sliderJsunit.test.ets
浏览文件 @
a439684f
...
...
@@ -200,7 +200,7 @@ export default function sliderJsunit() {
let strJson = getInspectorByKey('tex');
let obj = JSON.parse(strJson);
console.info("[sliderJsunit_0800] obj: " + JSON.stringify(obj));
expect(
obj.$attrs.content).assertEqual('30'
);
expect(
Math.round(obj.$attrs.content)).assertEqual(50
);
let strJson1 = getInspectorByKey('modeT');
let obj1 = JSON.parse(strJson1);
console.info("[sliderJsunit_0800] obj1: " + JSON.stringify(obj1));
...
...
@@ -241,4 +241,4 @@ export default function sliderJsunit() {
done();
});
})
}
\ No newline at end of file
}
arkui/ace_ets_component_ui/entry/src/main/ets/test/textAreaJsunit.test.ets
浏览文件 @
a439684f
...
...
@@ -37,14 +37,14 @@ export default function textAreaJsunit() {
}
} catch (err) {
console.error("push textAreaJsunit page error:" + err);
expect().assertFail();
expect().assertFail();
}
done();
});
it('textAreaJsunit_0100', 0, async function (done) {
console.info('textAreaJsunit_0100');
await CommonFunc.sleep(
30
000);
await CommonFunc.sleep(
1
000);
// get the textArea component and test attribute
let strJson = getInspectorByKey('textArea');
let obj = JSON.parse(strJson);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录