Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
ebc79a18
D
Docs
项目概览
OpenHarmony
/
Docs
接近 2 年 前同步成功
通知
159
Star
292
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看板
未验证
提交
ebc79a18
编写于
3月 13, 2023
作者:
O
openharmony_ci
提交者:
Gitee
3月 13, 2023
浏览文件
操作
浏览文件
下载
差异文件
!15921 【Monthly】翻译完成 15590+14673
Merge pull request !15921 from ester.zhou/CM-15590
上级
ed8bd203
4a7ff879
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
17 addition
and
17 deletion
+17
-17
en/application-dev/reference/apis/js-apis-uitest.md
en/application-dev/reference/apis/js-apis-uitest.md
+17
-17
未找到文件。
en/application-dev/reference/apis/js-apis-uitest.md
浏览文件 @
ebc79a18
# @ohos.
uitest
# @ohos.
UiTest
The
**UiTest**
module provides APIs that you can use to simulate UI actions during testing, such as clicks, double-clicks, long-clicks, and swipes.
The
**UiTest**
module provides APIs that you can use to simulate UI actions during testing, such as clicks, double-clicks, long-clicks, and swipes.
...
@@ -20,7 +20,7 @@ This module provides the following functions:
...
@@ -20,7 +20,7 @@ This module provides the following functions:
## Modules to Import
## Modules to Import
```
js
```
js
import
{
UiComponent
,
UiDriver
,
Component
,
Driver
,
UiWindow
,
ON
,
BY
,
MatchPattern
,
DisplayRotation
,
ResizeDirection
,
WindowMode
,
PointerMatrix
}
from
'
@ohos.
uit
est
'
;
import
{
UiComponent
,
UiDriver
,
Component
,
Driver
,
UiWindow
,
ON
,
BY
,
MatchPattern
,
DisplayRotation
,
ResizeDirection
,
WindowMode
,
PointerMatrix
}
from
'
@ohos.
UiT
est
'
;
```
```
## MatchPattern
## MatchPattern
...
@@ -61,8 +61,8 @@ Provides the coordinates of a point.
...
@@ -61,8 +61,8 @@ Provides the coordinates of a point.
| Name| Type | Readable| Writable| Description |
| Name| Type | Readable| Writable| Description |
| ---- | ------ | ---- | ---- | ---------------- |
| ---- | ------ | ---- | ---- | ---------------- |
|
X
| number | Yes | No | X-coordinate of a point.|
|
x
| number | Yes | No | X-coordinate of a point.|
|
Y
| number | Yes | No | Y-coordinate of a point.|
|
y
| number | Yes | No | Y-coordinate of a point.|
## Rect<sup>9+</sup>
## Rect<sup>9+</sup>
...
@@ -2093,7 +2093,7 @@ For details about the error codes, see [UiTest Error Codes](../errorcodes/errorc
...
@@ -2093,7 +2093,7 @@ For details about the error codes, see [UiTest Error Codes](../errorcodes/errorc
```
js
```
js
async
function
demo
()
{
async
function
demo
()
{
let
driver
=
Driver
.
create
();
let
driver
=
Driver
.
create
();
await
driver
.
fling
({
X
:
500
,
Y
:
480
},{
X
:
450
,
Y
:
480
},
5
,
600
);
await
driver
.
fling
({
x
:
500
,
Y
:
480
},{
x
:
450
,
Y
:
480
},
5
,
600
);
}
}
```
```
...
@@ -2132,12 +2132,12 @@ For details about the error codes, see [UiTest Error Codes](../errorcodes/errorc
...
@@ -2132,12 +2132,12 @@ For details about the error codes, see [UiTest Error Codes](../errorcodes/errorc
async
function
demo
()
{
async
function
demo
()
{
let
driver
=
Driver
.
create
();
let
driver
=
Driver
.
create
();
let
pointers
=
PointerMatrix
.
create
(
2
,
3
);
let
pointers
=
PointerMatrix
.
create
(
2
,
3
);
pointers
.
setPoint
(
0
,
0
,{
X
:
230
,
Y
:
480
});
pointers
.
setPoint
(
0
,
0
,{
x
:
230
,
y
:
480
});
pointers
.
setPoint
(
0
,
1
,{
X
:
250
,
Y
:
380
});
pointers
.
setPoint
(
0
,
1
,{
x
:
250
,
y
:
380
});
pointers
.
setPoint
(
0
,
2
,{
X
:
270
,
Y
:
280
});
pointers
.
setPoint
(
0
,
2
,{
x
:
270
,
y
:
280
});
pointers
.
setPoint
(
1
,
0
,{
X
:
230
,
Y
:
680
});
pointers
.
setPoint
(
1
,
0
,{
x
:
230
,
y
:
680
});
pointers
.
setPoint
(
1
,
1
,{
X
:
240
,
Y
:
580
});
pointers
.
setPoint
(
1
,
1
,{
x
:
240
,
y
:
580
});
pointers
.
setPoint
(
1
,
2
,{
X
:
250
,
Y
:
480
});
pointers
.
setPoint
(
1
,
2
,{
x
:
250
,
y
:
480
});
await
driver
.
injectMultiPointerAction
(
pointers
);
await
driver
.
injectMultiPointerAction
(
pointers
);
}
}
```
```
...
@@ -2196,12 +2196,12 @@ Sets the coordinates for the action corresponding to the specified finger and st
...
@@ -2196,12 +2196,12 @@ Sets the coordinates for the action corresponding to the specified finger and st
```
js
```
js
async
function
demo
()
{
async
function
demo
()
{
let
pointers
=
PointerMatrix
.
create
(
2
,
3
);
let
pointers
=
PointerMatrix
.
create
(
2
,
3
);
pointers
.
setPoint
(
0
,
0
,{
X
:
230
,
Y
:
480
});
pointers
.
setPoint
(
0
,
0
,{
x
:
230
,
y
:
480
});
pointers
.
setPoint
(
0
,
1
,{
X
:
250
,
Y
:
380
});
pointers
.
setPoint
(
0
,
1
,{
x
:
250
,
y
:
380
});
pointers
.
setPoint
(
0
,
2
,{
X
:
270
,
Y
:
280
});
pointers
.
setPoint
(
0
,
2
,{
x
:
270
,
y
:
280
});
pointers
.
setPoint
(
1
,
0
,{
X
:
230
,
Y
:
680
});
pointers
.
setPoint
(
1
,
0
,{
x
:
230
,
y
:
680
});
pointers
.
setPoint
(
1
,
1
,{
X
:
240
,
Y
:
580
});
pointers
.
setPoint
(
1
,
1
,{
x
:
240
,
y
:
580
});
pointers
.
setPoint
(
1
,
2
,{
X
:
250
,
Y
:
480
});
pointers
.
setPoint
(
1
,
2
,{
x
:
250
,
y
:
480
});
}
}
```
```
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录