提交 dd087507 编写于 作者: Z zhouke

js-apis-uitest.md modify.Signed-off-by: <zhouke35@huawei.com>.

Signed-off-by: Nzhouke <zhouke35@huawei.com>
上级 55e10076
...@@ -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.
先完成此消息的编辑!
想要评论请 注册