Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
68376c07
D
Docs
项目概览
OpenHarmony
/
Docs
大约 2 年 前同步成功
通知
161
Star
293
Fork
28
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
Docs
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
68376c07
编写于
3月 10, 2023
作者:
O
openharmony_ci
提交者:
Gitee
3月 10, 2023
浏览文件
操作
浏览文件
下载
差异文件
!15696 【Monthly】翻译完成 14963:更新arkXtest使用说明文档
Merge pull request !15696 from ester.zhou/CM-14991
上级
7b4b1b30
824345dc
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
5 addition
and
5 deletion
+5
-5
en/application-dev/application-test/arkxtest-guidelines.md
en/application-dev/application-test/arkxtest-guidelines.md
+5
-5
en/application-dev/application-test/figures/Execute.PNG
en/application-dev/application-test/figures/Execute.PNG
+0
-0
未找到文件。
en/application-dev/application-test/arkxtest-guidelines.md
浏览文件 @
68376c07
...
@@ -108,7 +108,7 @@ You write a UI test script based on the unit test framework, adding the invoking
...
@@ -108,7 +108,7 @@ You write a UI test script based on the unit test framework, adding the invoking
In this example, the UI test script is written based on the preceding unit test script. First, add the dependency package, as shown below:
In this example, the UI test script is written based on the preceding unit test script. First, add the dependency package, as shown below:
```
js
```
js
import
{
UiDriver
,
BY
,
Ui
Component
,
MatchPattern
}
from
'
@ohos.uitest
'
import
{
Driver
,
ON
,
Component
,
MatchPattern
}
from
'
@ohos.uitest
'
```
```
Then, write specific test code. Specifically, implement the click action on the started application page and add checkpoint check cases.
Then, write specific test code. Specifically, implement the click action on the started application page and add checkpoint check cases.
...
@@ -131,16 +131,16 @@ export default function abilityTest() {
...
@@ -131,16 +131,16 @@ export default function abilityTest() {
expect
(
Ability
.
context
.
abilityInfo
.
name
).
assertEqual
(
'
MainAbility
'
);
expect
(
Ability
.
context
.
abilityInfo
.
name
).
assertEqual
(
'
MainAbility
'
);
})
})
//ui test code
//ui test code
//init
ui
driver
//init driver
var
driver
=
await
Ui
Driver
.
create
();
var
driver
=
await
Driver
.
create
();
await
driver
.
delayMs
(
1000
);
await
driver
.
delayMs
(
1000
);
//find button by text 'Next'
//find button by text 'Next'
var
button
=
await
driver
.
findComponent
(
BY
.
text
(
'
Next
'
));
var
button
=
await
driver
.
findComponent
(
ON
.
text
(
'
Next
'
));
//click button
//click button
await
button
.
click
();
await
button
.
click
();
await
driver
.
delayMs
(
1000
);
await
driver
.
delayMs
(
1000
);
//check text
//check text
await
driver
.
assertComponentExist
(
BY
.
text
(
'
after click
'
));
await
driver
.
assertComponentExist
(
ON
.
text
(
'
after click
'
));
await
driver
.
pressBack
();
await
driver
.
pressBack
();
done
();
done
();
})
})
...
...
en/application-dev/application-test/figures/Execute.PNG
查看替换文件 @
7b4b1b30
浏览文件 @
68376c07
514.3 KB
|
W:
|
H:
451.6 KB
|
W:
|
H:
2-up
Swipe
Onion skin
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录