未验证 提交 cf474740 编写于 作者: O openharmony_ci 提交者: Gitee

!4643 js-apis-uitest.md修改错误API说明及示例代码

Merge pull request !4643 from 周柯/master
...@@ -860,7 +860,7 @@ async function demo() { ...@@ -860,7 +860,7 @@ async function demo() {
### UiComponent.scrollSearch ### UiComponent.scrollSearch
scrollSearch(by:By): Promise\<UiComponent> scrollSearch(by: By): Promise\<UiComponent>
在控件上滑动查找目标控件(适用于List等支持滑动的控件)。 在控件上滑动查找目标控件(适用于List等支持滑动的控件)。
...@@ -926,7 +926,7 @@ async function demo() { ...@@ -926,7 +926,7 @@ async function demo() {
### UiComponent.dragTo<sup>9+</sup> ### UiComponent.dragTo<sup>9+</sup>
dragTo(by:By): Promise\<void> dragTo(target: UiComponent): Promise\<void>
将控件拖拽至目标控件处。 将控件拖拽至目标控件处。
...@@ -935,8 +935,8 @@ dragTo(by:By): Promise\<void> ...@@ -935,8 +935,8 @@ dragTo(by:By): Promise\<void>
**参数:** **参数:**
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| ------ | ---- | ---- | -------------------- | | ------ | ----------- | ---- | ---------- |
| by | By | 是 | 目标控件的属性要求。 | | target | UiComponent | 是 | 目标控件。 |
**示例:** **示例:**
...@@ -944,7 +944,8 @@ dragTo(by:By): Promise\<void> ...@@ -944,7 +944,8 @@ dragTo(by:By): Promise\<void>
async function demo() { async function demo() {
let driver = UiDriver.create() let driver = UiDriver.create()
let button = await driver.findComponent(BY.type('button')) let button = await driver.findComponent(BY.type('button'))
await button.dragTo(BY.text('hello world')) let text = await driver.findComponent(BY.text('hello world'))
await button.dragTo(text)
} }
} }
``` ```
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册