| MOUSE_BUTTON_LEFT | 0 | Left button on the mouse. |
| MOUSE_BUTTON_RIGHT | 1 | Right button on the mouse. |
| MOUSE_BUTTON_MIDDLE | 2 | Middle button on the mouse.|
## On<sup>9+</sup>
Since API version 9, the UiTest framework provides a wide range of UI component feature description APIs in the **On** class to filter and match components.
...
...
@@ -420,7 +445,7 @@ let on = ON.checkable(true); // Use the static constructor ON to create an On ob
isBefore(on: On): On
Specifies the attributes of the component before which the target component is located.
Specifies that the target component is located before the given attribute component.
| on | [On](#on9) | Yes | Attributes of the component before which the target component is located.|
| on | [On](#on9) | Yes | Information about the attribute component.|
**Return value**
...
...
@@ -439,14 +464,14 @@ Specifies the attributes of the component before which the target component is l
**Example**
```js
leton=ON.isBefore(ON.text('123'));// Use the static constructor ON to create an On object and specify the attributes of the component before which the target component is located.
leton=ON.isBefore(ON.text('123'));// Create an On object using the static constructor ON, specifying that the target component is located before the given attribute component.
```
### isAfter<sup>9+</sup>
isAfter(on: On): On
Specifies the attributes of the component after which the target component is located.
Specifies that the target component is located after the given attribute component.
| on | [On](#on9) | Yes | Attributes of the component after which the target component is located.|
| on | [On](#on9) | Yes | Information about the attribute component.|
**Return value**
...
...
@@ -465,7 +490,59 @@ Specifies the attributes of the component after which the target component is lo
**Example**
```js
leton=ON.isAfter(ON.text('123'));// Use the static constructor ON to create an On object and specify the attributes of the component after which the target component is located.
leton=ON.isAfter(ON.text('123'));// Create an On object using the static constructor ON, specifying that the target component is located after the given attribute component.
```
### within<sup>10+</sup>
within(on: On): On
Specifies that the target component is located within the given attribute component.
leton=ON.within(ON.type('List'));// Create an On object using the static constructor ON, specifying that the target component is located within the given attribute component.
```
### inWindow<sup>10+</sup>
inWindow(bundleName: string): On;
Specifies that the target component is within the given application window.
leton=ON.inWindow(ON.inWindow('com.uitestScene.acts'));// Create an On object using the static constructor ON, specifying that the target component is within the given application window.
```
## Component<sup>9+</sup>
...
...
@@ -1816,7 +1893,7 @@ For details about the error codes, see [UiTest Error Codes](../errorcodes/errorc
@@ -2078,7 +2155,7 @@ Simulates a fling operation on the screen.
| from | [Point](#point9) | Yes | Coordinates of the point where the finger touches the screen. |
| to | [Point](#point9) | Yes | Coordinates of the point where the finger leaves the screen. |
| stepLen | number | Yes | Fling step length, in pixels. |
| speed | number | Yes | Scroll speed, in pixel/s. The value ranges from 200 to 15000. If the set value is not in the range, the default value 600 is used.|
| speed | number | Yes | Fling speed, in pixel/s. The value ranges from 200 to 40000. If the set value is not in the range, the default value 600 is used.|
**Error codes**
...
...
@@ -2093,7 +2170,7 @@ For details about the error codes, see [UiTest Error Codes](../errorcodes/errorc
| direction | [UiDirection](#uidirection10) | Yes | Direction of the fling operation. |
| speed | number | Yes | Fling speed, in pixel/s. The value ranges from 200 to 40000. If the set value is not in the range, the default value 600 is used.|
**Error codes**
For details about the error codes, see [UiTest Error Codes](../errorcodes/errorcode-uitest.md).
mouseClick(p: Point, btnId: MouseButton, key1?: number, key2?: number): Promise<void>;
Injects a mouse click at the specified coordinates, with the optional key or key combination. For example, if the value of **key1** is **2072**, the **Ctrl** button is pressed with the mouse click.
Injects a mouse scroll action at the specified coordinates, with the optional key or key combination. For example, if the value of **key1** is **2072**, the **Ctrl** button is pressed with mouse scrolling.
| by | [By](#bydeprecated) | Yes | Attributes of the component before which the target component is located.|
| by | [By](#bydeprecated) | Yes | Information about the attribute component.|
**Return value**
...
...
@@ -2940,14 +3187,14 @@ This API is deprecated since API version 9. You are advised to use [isBefore<sup
**Example**
```js
letby=BY.isBefore(BY.text('123'));// Use the static constructor BY to create a By object and specify the attributes of the component before which the target component is located.
letby=BY.isBefore(BY.text('123'));// Use the static constructor BY to create a By object, specifying that the target component is located before the given attribute component.
```
### isAfter<sup>(deprecated)</sup>
isAfter(by: By): By
Specifies the attributes of the component after which the target component is located.
Specifies the target component is located after the given attribute component.
This API is deprecated since API version 9. You are advised to use [isAfter<sup>9+</sup>](#isafter9).
...
...
@@ -2957,7 +3204,7 @@ This API is deprecated since API version 9. You are advised to use [isAfter<sup>
| by | [By](#bydeprecated) | Yes | Attributes of the component before which the target component is located.|
| by | [By](#bydeprecated) | Yes | Information about the attribute component.|
**Return value**
...
...
@@ -2968,7 +3215,7 @@ This API is deprecated since API version 9. You are advised to use [isAfter<sup>
**Example**
```js
letby=BY.isAfter(BY.text('123'));// Use the static constructor BY to create a By object and specify the attributes of the component after which the target component is located.
letby=BY.isAfter(BY.text('123'));// Use the static constructor BY to create a By object, specifying that the target component is located after the given attribute component.
```
## UiComponent<sup>(deprecated)</sup>
...
...
@@ -3673,6 +3920,6 @@ This API is deprecated since API version 9. You are advised to use [screenCap<su