Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
dd087507
D
Docs
项目概览
OpenHarmony
/
Docs
1 年多 前同步成功
通知
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看板
提交
dd087507
编写于
11月 15, 2022
作者:
Z
zhouke
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
js-apis-uitest.md modify.Signed-off-by: <zhouke35@huawei.com>.
Signed-off-by:
N
zhouke
<
zhouke35@huawei.com
>
上级
55e10076
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
10 addition
and
9 deletion
+10
-9
zh-cn/application-dev/reference/apis/js-apis-uitest.md
zh-cn/application-dev/reference/apis/js-apis-uitest.md
+10
-9
未找到文件。
zh-cn/application-dev/reference/apis/js-apis-uitest.md
浏览文件 @
dd087507
...
@@ -821,7 +821,7 @@ isChecked(): Promise\<boolean>
...
@@ -821,7 +821,7 @@ isChecked(): Promise\<boolean>
```
js
```
js
async
function
demo
()
{
async
function
demo
()
{
let
driver
=
Driver
.
create
();
let
driver
=
Driver
.
create
();
let
button
=
await
driver
.
findComponent
(
ON
.
type
(
'
Checkbox
'
));
let
checkBox
=
await
driver
.
findComponent
(
ON
.
type
(
'
Checkbox
'
));
if
(
await
checkBox
.
isChecked
)
{
if
(
await
checkBox
.
isChecked
)
{
console
.
info
(
'
This checkBox is checked
'
);
console
.
info
(
'
This checkBox is checked
'
);
}
else
{
}
else
{
...
@@ -858,7 +858,7 @@ isCheckable(): Promise\<boolean>
...
@@ -858,7 +858,7 @@ isCheckable(): Promise\<boolean>
```
js
```
js
async
function
demo
()
{
async
function
demo
()
{
let
driver
=
Driver
.
create
();
let
driver
=
Driver
.
create
();
let
button
=
await
driver
.
findComponent
(
ON
.
type
(
'
Checkbox
'
));
let
checkBox
=
await
driver
.
findComponent
(
ON
.
type
(
'
Checkbox
'
));
if
(
await
checkBox
.
isCheckable
)
{
if
(
await
checkBox
.
isCheckable
)
{
console
.
info
(
'
This checkBox is checkable
'
);
console
.
info
(
'
This checkBox is checkable
'
);
}
else
{
}
else
{
...
@@ -895,7 +895,7 @@ isScrollable(): Promise\<boolean>
...
@@ -895,7 +895,7 @@ isScrollable(): Promise\<boolean>
```
js
```
js
async
function
demo
()
{
async
function
demo
()
{
let
driver
=
Driver
.
create
();
let
driver
=
Driver
.
create
();
let
button
=
await
driver
.
findComponent
(
ON
.
scrollable
(
true
));
let
scrollBar
=
await
driver
.
findComponent
(
ON
.
scrollable
(
true
));
if
(
await
scrollBar
.
isScrollable
())
{
if
(
await
scrollBar
.
isScrollable
())
{
console
.
info
(
'
This scrollBar can be operated
'
);
console
.
info
(
'
This scrollBar can be operated
'
);
}
else
{
}
else
{
...
@@ -1045,7 +1045,7 @@ inputText(text: string): Promise\<void>
...
@@ -1045,7 +1045,7 @@ inputText(text: string): Promise\<void>
```
js
```
js
async
function
demo
()
{
async
function
demo
()
{
let
driver
=
Driver
.
create
();
let
driver
=
Driver
.
create
();
let
button
=
await
driver
.
findComponent
(
ON
.
text
(
'
hello world
'
));
let
text
=
await
driver
.
findComponent
(
ON
.
text
(
'
hello world
'
));
await
text
.
inputText
(
'
123
'
);
await
text
.
inputText
(
'
123
'
);
}
}
```
```
...
@@ -1070,7 +1070,7 @@ clearText(): Promise\<void>
...
@@ -1070,7 +1070,7 @@ clearText(): Promise\<void>
```
js
```
js
async
function
demo
()
{
async
function
demo
()
{
let
driver
=
Driver
.
create
();
let
driver
=
Driver
.
create
();
let
button
=
await
driver
.
findComponent
(
ON
.
text
(
'
hello world
'
));
let
text
=
await
driver
.
findComponent
(
ON
.
text
(
'
hello world
'
));
await
text
.
clearText
();
await
text
.
clearText
();
}
}
```
```
...
@@ -1142,7 +1142,7 @@ scrollToTop(speed?: number): Promise\<void>
...
@@ -1142,7 +1142,7 @@ scrollToTop(speed?: number): Promise\<void>
```
js
```
js
async
function
demo
()
{
async
function
demo
()
{
let
driver
=
Driver
.
create
();
let
driver
=
Driver
.
create
();
let
button
=
await
driver
.
findComponent
(
ON
.
type
(
'
Scroll
'
));
let
scrollBar
=
await
driver
.
findComponent
(
ON
.
type
(
'
Scroll
'
));
await
scrollBar
.
scrollToTop
();
await
scrollBar
.
scrollToTop
();
}
}
```
```
...
@@ -1175,7 +1175,7 @@ scrollToBottom(speed?: number): Promise\<void>
...
@@ -1175,7 +1175,7 @@ scrollToBottom(speed?: number): Promise\<void>
```
js
```
js
async
function
demo
()
{
async
function
demo
()
{
let
driver
=
Driver
.
create
();
let
driver
=
Driver
.
create
();
let
button
=
await
driver
.
findComponent
(
ON
.
type
(
'
Scroll
'
));
let
scrollBar
=
await
driver
.
findComponent
(
ON
.
type
(
'
Scroll
'
));
await
scrollBar
.
scrollToBottom
();
await
scrollBar
.
scrollToBottom
();
}
}
```
```
...
@@ -1242,7 +1242,7 @@ pinchOut(scale: number): Promise\<void>
...
@@ -1242,7 +1242,7 @@ pinchOut(scale: number): Promise\<void>
```
js
```
js
async
function
demo
()
{
async
function
demo
()
{
let
driver
=
Driver
.
create
();
let
driver
=
Driver
.
create
();
let
button
=
await
driver
.
findComponent
(
ON
.
type
(
'
image
'
));
let
image
=
await
driver
.
findComponent
(
ON
.
type
(
'
image
'
));
await
image
.
pinchOut
(
1.5
);
await
image
.
pinchOut
(
1.5
);
}
}
```
```
...
@@ -1275,7 +1275,7 @@ pinchIn(scale: number): Promise\<void>
...
@@ -1275,7 +1275,7 @@ pinchIn(scale: number): Promise\<void>
```
js
```
js
async
function
demo
()
{
async
function
demo
()
{
let
driver
=
Driver
.
create
();
let
driver
=
Driver
.
create
();
let
button
=
await
driver
.
findComponent
(
ON
.
type
(
'
image
'
));
let
image
=
await
driver
.
findComponent
(
ON
.
type
(
'
image
'
));
await
image
.
pinchIn
(
0.5
);
await
image
.
pinchIn
(
0.5
);
}
}
```
```
...
@@ -2130,6 +2130,7 @@ injectMultiPointerAction(pointers: PointerMatrix, speed?: number): Promise\<bool
...
@@ -2130,6 +2130,7 @@ injectMultiPointerAction(pointers: PointerMatrix, speed?: number): Promise\<bool
```
js
```
js
async
function
demo
()
{
async
function
demo
()
{
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
});
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录