diff --git a/api/@ohos.UiTest.d.ts b/api/@ohos.UiTest.d.ts index 47815947ca62de2bdfbfe135c3a02c5915da8aab..b13666221aabd1551138509fbe1ff65754ba86ce 100755 --- a/api/@ohos.UiTest.d.ts +++ b/api/@ohos.UiTest.d.ts @@ -1903,11 +1903,25 @@ declare class On { * @syscap SystemCapability.Test.UiTest * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} + * @since 11 * @test - * @arkts 1.1&1.2 */ text(txt: string, pattern?: MatchPattern): On; + /** + * Specifies the text for the target Component. + * + * @param { string } txt - the text value. + * @param { MatchPattern | null } [pattern] - the {@link MatchPattern} of the text value,Set it default {@link MatchPattern.EQUALS} if null or undefined. + * @returns { On } this {@link On} object. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. + * @syscap SystemCapability.Test.UiTest + * @crossplatform + * @atomicservice + * @since 20 + * @test + * @arkts 1.2 + */ + text(txt: string, pattern?: MatchPattern | null): On; /** * Specifies the id of the target Component. @@ -2011,11 +2025,25 @@ declare class On { * @syscap SystemCapability.Test.UiTest * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} + * @since arkts 11 * @test - * @arkts 1.1&1.2 */ clickable(b?: boolean): On; + /** + * Specifies the clickable status of the target Component. + * + * @param { boolean | null } [b] - the clickable status.Set it default true if null or undefined. + * @returns { On } this {@link On} object. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Incorrect parameter types; 2. Parameter verification failed. + * @syscap SystemCapability.Test.UiTest + * @crossplatform + * @atomicservice + * @since 20 + * @test + * @arkts 1.2 + */ + clickable(b?: boolean | null): On; + /** * Specifies the longClickable status of the target Component. @@ -2047,11 +2075,24 @@ declare class On { * @syscap SystemCapability.Test.UiTest * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} + * @since 11 * @test - * @arkts 1.1&1.2 */ longClickable(b?: boolean): On; + /** + * Specifies the longClickable status of the target Component. + * + * @param { boolean | null } [b] - the longClickable status.Set it default true if null or undefined. + * @returns { On } this {@link On} object. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Incorrect parameter types; 2. Parameter verification failed. + * @syscap SystemCapability.Test.UiTest + * @crossplatform + * @atomicservice + * @since 20 + * @test + * @arkts 1.2 + */ + longClickable(b?: boolean | null): On; /** * Specifies the scrollable status of the target Component. @@ -2083,11 +2124,24 @@ declare class On { * @syscap SystemCapability.Test.UiTest * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} + * @since 11 * @test - * @arkts 1.1&1.2 */ scrollable(b?: boolean): On; + /** + * Specifies the scrollable status of the target Component. + * + * @param { boolean | null } [b] - the scrollable status.Set it default true if null or undefined. + * @returns { On } this {@link On} object. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Incorrect parameter types; 2. Parameter verification failed. + * @syscap SystemCapability.Test.UiTest + * @crossplatform + * @atomicservice + * @since 20 + * @test + * @arkts 1.2 + */ + scrollable(b?: boolean | null): On; /** * Specifies the enabled status of the target Component. @@ -2119,11 +2173,24 @@ declare class On { * @syscap SystemCapability.Test.UiTest * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} + * @since 11 * @test - * @arkts 1.1&1.2 */ enabled(b?: boolean): On; + /** + * Specifies the enabled status of the target Component. + * + * @param { boolean | null } [b] - the enabled status.Set it default true if null or undefined. + * @returns { On } this {@link On} object. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Incorrect parameter types; 2. Parameter verification failed. + * @syscap SystemCapability.Test.UiTest + * @crossplatform + * @atomicservice + * @since 20 + * @test + * @arkts 1.2 + */ + enabled(b?: boolean | null): On; /** * Specifies the focused status of the target Component. @@ -2155,11 +2222,24 @@ declare class On { * @syscap SystemCapability.Test.UiTest * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} + * @since 11 * @test - * @arkts 1.1&1.2 */ focused(b?: boolean): On; + /** + * Specifies the focused status of the target Component. + * + * @param { boolean | null } [b] - the focused status.Set it default true if null or undefined. + * @returns { On } this {@link On} object. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Incorrect parameter types; 2. Parameter verification failed. + * @syscap SystemCapability.Test.UiTest + * @crossplatform + * @atomicservice + * @since 20 + * @test + * @arkts 1.2 + */ + focused(b?: boolean | null): On; /** * Specifies the selected status of the target Component. @@ -2191,11 +2271,24 @@ declare class On { * @syscap SystemCapability.Test.UiTest * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} + * @since 11 * @test - * @arkts 1.1&1.2 */ selected(b?: boolean): On; + /** + * Specifies the selected status of the target Component. + * + * @param { boolean | null } [b] the - selected status.Set it default true if null or undefined. + * @returns { On } this {@link On} object. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Incorrect parameter types; 2. Parameter verification failed. + * @syscap SystemCapability.Test.UiTest + * @crossplatform + * @atomicservice + * @since 20 + * @test + * @arkts 1.2 + */ + selected(b?: boolean | null): On; /** * Specifies the checked status of the target Component. @@ -2227,11 +2320,25 @@ declare class On { * @syscap SystemCapability.Test.UiTest * @crossplatform * @atomicservice + * @since 11 + * @test + * @arkts 1.2 + */ + checked(b?: boolean): On; + /** + * Specifies the checked status of the target Component. + * + * @param { boolean | null } [b] - the checked status.Set it default true if null or undefined. + * @returns { On } this {@link On} object. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Incorrect parameter types; 2. Parameter verification failed. + * @syscap SystemCapability.Test.UiTest + * @crossplatform + * @atomicservice * @since arkts {'1.1':'11','1.2':'20'} * @test * @arkts 1.1&1.2 */ - checked(b?: boolean): On; + checked(b?: boolean | null): On; /** * Specifies the checkable status of the target Component. @@ -2263,11 +2370,24 @@ declare class On { * @syscap SystemCapability.Test.UiTest * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} + * @since 11 * @test - * @arkts 1.1&1.2 */ checkable(b?: boolean): On; + /** + * Specifies the checkable status of the target Component. + * + * @param { boolean | null } [b] - the checkable status.Set it default true if null or undefined. + * @returns { On } this {@link On} object. + * @throws { BusinessError } 401 - Parameter error. 1. Incorrect parameter types; 2. Parameter verification failed. + * @syscap SystemCapability.Test.UiTest + * @crossplatform + * @atomicservice + * @since 20 + * @test + * @arkts 1.2 + */ + checkable(b?: boolean | null): On; /** * Requires that the target Component which is before another Component that specified by the given {@link On} @@ -2396,11 +2516,25 @@ declare class On { * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. * @syscap SystemCapability.Test.UiTest * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} + * @since 11 * @test - * @arkts 1.1&1.2 */ description(val: string, pattern?: MatchPattern): On; + /** + * Specifies the description for the target Component. + * + * @param { string } val - the description value. + * @param { MatchPattern | null } [pattern] - the {@link MatchPattern} of description value,set it default {@link MatchPattern.EQUALS} if null or undefined. + * @returns { On } this {@link On} object. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. + * @syscap SystemCapability.Test.UiTest + * @atomicservice + * @since 20 + * @test + * @arkts 1.2 + */ + description(val: string, pattern?: MatchPattern | null): On; + /** * Specifies the id of the target Component. * @@ -2438,11 +2572,24 @@ declare class On { * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. * @syscap SystemCapability.Test.UiTest * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} + * @since 11 * @test - * @arkts 1.1&1.2 */ hint(val: string, pattern?: MatchPattern): On; + /** + * Specifies the hint for the target Component. + * + * @param { string } val - the hint value. + * @param { MatchPattern | null } [pattern] - the {@link MatchPattern} of the text value,Set it default {@link MatchPattern.EQUALS} if null or undefined. + * @returns { On } this {@link On} object. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. + * @syscap SystemCapability.Test.UiTest + * @atomicservice + * @since 20 + * @test + * @arkts 1.2 + */ + hint(val: string, pattern?: MatchPattern | null): On; } /** @@ -3119,11 +3266,26 @@ declare class Component { * @syscap SystemCapability.Test.UiTest * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} + * @since 11 * @test - * @arkts 1.1&1.2 */ scrollToTop(speed?: number): Promise; + /** + * Scroll on this {@link Component} to the top,applicable to scrollable one. + * + * @param { number | null } [speed] - the speed of swipe(pixels per second),ranges from 200 to 40000.Set it default 600 if out of range or null or undefined. + * @returns { Promise } + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Incorrect parameter types; 2. Parameter verification failed. + * @throws { BusinessError } 17000002 - The async function is not called with await. + * @throws { BusinessError } 17000004 - The window or component is invisible or destroyed. + * @syscap SystemCapability.Test.UiTest + * @crossplatform + * @atomicservice + * @since 20 + * @test + * @arkts 1.2 + */ + scrollToTop(speed?: number | null): Promise; /** * Scroll on this {@link Component} to the bottom,applicable to scrollable one. @@ -3161,11 +3323,26 @@ declare class Component { * @syscap SystemCapability.Test.UiTest * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} + * @since 11 * @test - * @arkts 1.1&1.2 */ scrollToBottom(speed?: number): Promise; + /** + * Scroll on this {@link Component} to the bottom,applicable to scrollable one. + * + * @param { number | null } [speed] - the speed of swipe(pixels per second),ranges from 200 to 40000. Set it default 600 if out of range or null or undefined. + * @returns { Promise } + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Incorrect parameter types; 2. Parameter verification failed. + * @throws { BusinessError } 17000002 - The async function is not called with await. + * @throws { BusinessError } 17000004 - The window or component is invisible or destroyed. + * @syscap SystemCapability.Test.UiTest + * @crossplatform + * @atomicservice + * @since 20 + * @test + * @arkts 1.2 + */ + scrollToBottom(speed?: number | null): Promise; /** * Get the bounds rect of this {@link Component}. @@ -3426,8 +3603,8 @@ declare class Component { * Scroll on this {@link Component}to find matched {@link Component},applicable to scrollable one. * * @param { On } on - the attribute requirements of the target {@link Component}. - * @param { boolean } [vertical] - Whether the swipe direction is vertical, default is true. - * @param { number } [offset] - Offset from the swipe start/end point to the component border, default is 80. + * @param { boolean | null } [vertical] - Whether the swipe direction is vertical, default is true. + * @param { number | null } [offset] - Offset from the swipe start/end point to the component border, default is 80. * @returns { Promise } the found result,or null if not found. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. * @throws { BusinessError } 17000002 - The async function is not called with await. @@ -3438,7 +3615,7 @@ declare class Component { * @test * @arkts 1.2 */ - scrollSearch(on: On, vertical?: boolean, offset?: number): Promise; + scrollSearch(on: On, vertical?: boolean | null, offset?: number | null): Promise; } /** @@ -3879,11 +4056,27 @@ declare class Driver { * @syscap SystemCapability.Test.UiTest * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} + * @since 11 * @test - * @arkts 1.1&1.2 */ triggerCombineKeys(key0: number, key1: number, key2?: number): Promise; + /** + * Press two or three key combinations + * + * @param { number } key0 - the first keyCode. + * @param { number } key1 - the second keyCode. + * @param { number | null } [key2] - the third keyCode,set it default 0 if null or undefined. + * @returns { Promise } + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. + * @throws { BusinessError } 17000002 - The async function is not called with await. + * @syscap SystemCapability.Test.UiTest + * @crossplatform + * @atomicservice + * @since 20 + * @test + * @arkts 1.2 + */ + triggerCombineKeys(key0: number, key1: number, key2?: number | null): Promise; /** * Press two or three key combinations on the specified display. @@ -3901,6 +4094,23 @@ declare class Driver { * @test */ triggerCombineKeys(key0: number, key1: number, key2?: number, displayId?: number): Promise; + /** + * Press two or three key combinations on the specified display. + * + * @param { number } key0 - the first keyCode. + * @param { number } key1 - the second keyCode. + * @param { number | null } [key2] - the third keyCode,set it default 0 if null or undefined. + * @param { number | null } [displayId] - the Id of the specified display, default is the displayId of the main screen. + * @returns { Promise } + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. + * @throws { BusinessError } 17000002 - The async function is not called with await. + * @syscap SystemCapability.Test.UiTest + * @atomicservice + * @since 20 + * @test + * @arkts 1.2 + */ + triggerCombineKeys(key0: number, key1: number, key2?: number | null, displayId?: number | null): Promise; /** * Click on the specified location on the screen. @@ -4073,11 +4283,29 @@ declare class Driver { * @syscap SystemCapability.Test.UiTest * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} + * @since 11 * @test - * @arkts 1.1&1.2 */ swipe(startx: number, starty: number, endx: number, endy: number, speed?: number): Promise; + /** + * Swipe on the screen between the specified points. + * + * @param { number } startx - the x-coordinate of the starting point, not less than 0. + * @param { number } starty - the y-coordinate of the starting point, not less than 0. + * @param { number } endx - the x-coordinate of the ending point, not less than 0. + * @param { number } endy - the y-coordinate of the ending point, not less than 0. + * @param { number | null } [speed] - the speed of swipe(pixels per second),ranges from 200 to 40000. Set it default 600 if out of range or null or undefined. + * @returns { Promise } + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. + * @throws { BusinessError } 17000002 - The async function is not called with await. + * @syscap SystemCapability.Test.UiTest + * @crossplatform + * @atomicservice + * @since 20 + * @test + * @arkts 1.2 + */ + swipe(startx: number, starty: number, endx: number, endy: number, speed?: number | null): Promise; /** * Drag on the screen between the specified points. @@ -4107,11 +4335,28 @@ declare class Driver { * @throws { BusinessError } 17000002 - The async function is not called with await. * @syscap SystemCapability.Test.UiTest * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} + * @since 11 * @test - * @arkts 1.1&1.2 */ drag(startx: number, starty: number, endx: number, endy: number, speed?: number): Promise; + /** + * Drag on the screen between the specified points. + * + * @param { number } startx - the x-coordinate of the starting point, not less than 0. + * @param { number } starty - the y-coordinate of the starting point, not less than 0. + * @param { number } endx - the x-coordinate of the ending point, not less than 0. + * @param { number } endy - the y-coordinate of the ending point, not less than 0. + * @param { number | null } [speed] the speed of drag(pixels per second),ranges from 200 to 40000. Set it default 600 if out of range or null or undefined. + * @returns { Promise } + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. + * @throws { BusinessError } 17000002 - The async function is not called with await. + * @syscap SystemCapability.Test.UiTest + * @atomicservice + * @since 20 + * @test + * @arkts 1.2 + */ + drag(startx: number, starty: number, endx: number, endy: number, speed?: number | null): Promise; /** * Click on the specified location on the screen. @@ -4155,6 +4400,21 @@ declare class Driver { * @test */ longClickAt(point: Point, duration?: number): Promise; + /** + * LongClick on the specified location on the screen, specifies the duration if necessary. + * + * @param { Point } point - the coordinate point where the finger touches the screen. + * @param { number | null } [duration] - duration of longClick in millisecond, the minimum and default are 1500. + * @returns { Promise } + * @throws { BusinessError } 17000002 - The async function is not called with await. + * @throws { BusinessError } 17000007 - Parameter verification failed. + * @syscap SystemCapability.Test.UiTest + * @atomicservice + * @since 20 + * @test + * @arkts 1.2 + */ + longClickAt(point: Point, duration?: number | null): Promise; /** * Swipe on the screen between the specified points. @@ -4172,6 +4432,23 @@ declare class Driver { */ swipeBetween(from: Point, to: Point, speed?: number): Promise; + /** + * Swipe on the screen between the specified points. + * + * @param { Point } from - the coordinate point where the finger touches the screen. + * @param { Point } to - the coordinate point where the finger leaves the screen. + * @param { number | null } [speed] - speed of swipe(pixels per second),the value ranges from 200 to 40000.Set it default 600 if out out of range or null or undefined. + * @returns { Promise } + * @throws { BusinessError } 17000002 - The async function is not called with await. + * @throws { BusinessError } 17000007 - Parameter verification failed. + * @syscap SystemCapability.Test.UiTest + * @atomicservice + * @since 20 + * @test + * @arkts 1.2 + */ + swipeBetween(from: Point, to: Point, speed?: number | null): Promise; + /** * Drag on the screen between the specified points. * @@ -4188,6 +4465,23 @@ declare class Driver { * @test */ dragBetween(from: Point, to: Point, speed?: number, duration?: number): Promise; + /** + * Drag on the screen between the specified points. + * + * @param { Point } from - the coordinate point where the finger touches the screen. + * @param { Point } to - the coordinate point where the finger leaves the screen. + * @param { number | null } [speed] - speed of drag(pixels per second),the value ranges from 200 to 40000.Set it default 600 if out out of range or null or undefined. + * @param { number | null } [duration] - duration of longClick before drag in millisecond, the minimum and default values are 1500. + * @returns { Promise } + * @throws { BusinessError } 17000002 - The async function is not called with await. + * @throws { BusinessError } 17000007 - Parameter verification failed. + * @syscap SystemCapability.Test.UiTest + * @atomicservice + * @since 20 + * @test + * @arkts 1.2 + */ + dragBetween(from: Point, to: Point, speed?: number | null, duration?: number | null): Promise; /** * Capture current screen and save as picture which PNG format. @@ -4547,11 +4841,26 @@ declare class Driver { * @syscap SystemCapability.Test.UiTest * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} + * @since 11 * @test - * @arkts 1.1&1.2 */ injectMultiPointerAction(pointers: PointerMatrix, speed?: number): Promise; + /** + * Inject multi-pointer action on the device display. + * + * @param { PointerMatrix } pointers - the two-dimensional array of pointers to inject. + * @param { number | null } [speed] - the speed of swipe(pixels per second),ranges from 200 to 40000. Set it default 600 if out of range or null or undefined. + * @returns { Promise } true if the operation finished, false + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. + * @throws { BusinessError } 17000002 - The async function is not called with await. + * @syscap SystemCapability.Test.UiTest + * @crossplatform + * @atomicservice + * @since 20 + * @test + * @arkts 1.2 + */ + injectMultiPointerAction(pointers: PointerMatrix, speed?: number | null): Promise; /** * Inject fling on the device display. @@ -4637,11 +4946,27 @@ declare class Driver { * @throws { BusinessError } 17000002 - The async function is not called with await. * @syscap SystemCapability.Test.UiTest * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} + * @since 11 * @test - * @arkts 1.1&1.2 */ mouseClick(p: Point, btnId: MouseButton, key1?: number, key2?: number): Promise; + /** + * Click on the specified location on the screen with the specified mouse button, and press the specified key simultaneously if necessary. + * + * @param { Point } p - the coordinate of the specified location. + * @param { MouseButton } btnId - the button of Mouse. + * @param { number | null } [key1] - the first keyCode,set it default 0 if null or undefined. + * @param { number | null } [key2] - the second keyCode,set it default 0 if null or undefined. + * @returns { Promise } + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. + * @throws { BusinessError } 17000002 - The async function is not called with await. + * @syscap SystemCapability.Test.UiTest + * @atomicservice + * @since 20 + * @test + * @arkts 1.2 + */ + mouseClick(p: Point, btnId: MouseButton, key1?: number | null, key2?: number | null): Promise; /** * Move the mouse cursor to the specified location. @@ -4717,11 +5042,29 @@ declare class Driver { * @throws { BusinessError } 17000002 - The async function is not called with await. * @syscap SystemCapability.Test.UiTest * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} + * @since 11 * @test - * @arkts 1.1&1.2 */ mouseScroll(p: Point, down: boolean, d: number, key1?: number, key2?: number, speed?: number): Promise; + /** + * The mouse wheel scrolls the specified cell at the specified position, and press the specified key simultaneously if necessary. + * + * @param { Point } p - the coordinate of the specified location. + * @param { boolean } down - whether the mouse wheel rolls down. + * @param { number } d - the number of cells that the mouse wheel scrolls, each cell will make the target point shift 120 pixels. + * @param { number | null } [key1] - the first keyCode,set it default 0 if null or undefined. + * @param { number | null } [key2] - the second keyCode,set it default 0 if null or undefined. + * @param { number | null } [speed] - The Speed of mouse wheel rolls(cells per second),ranges from 1 to 500.Set it default 20 if out of range or null or undefined. + * @returns { Promise } + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. + * @throws { BusinessError } 17000002 - The async function is not called with await. + * @syscap SystemCapability.Test.UiTest + * @atomicservice + * @since 20 + * @test + * @arkts 1.2 + */ + mouseScroll(p: Point, down: boolean, d: number, key1?: number | null, key2?: number | null, speed?: number | null): Promise; /** * Capture the specified area of current screen and save as picture which PNG format. @@ -4745,11 +5088,25 @@ declare class Driver { * @throws { BusinessError } 17000002 - The async function is not called with await. * @syscap SystemCapability.Test.UiTest * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} + * @since 11 * @test - * @arkts 1.1&1.2 */ screenCapture(savePath: string, rect?: Rect): Promise; + /** + * Capture the specified area of current screen and save as picture which PNG format. + * + * @param { string } savePath - the path where to store the picture, must be in the application sandbox directory. + * @param { Rect | null } [rect] - the specified area of current screen, default to full screen.Set it default if null or undefined. + * @returns { Promise } true if screen-capturing and file-storing are completed successfully,false otherwise. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. + * @throws { BusinessError } 17000002 - The async function is not called with await. + * @syscap SystemCapability.Test.UiTest + * @atomicservice + * @since 20 + * @test + * @arkts 1.2 + */ + screenCapture(savePath: string, rect?: Rect | null): Promise; /** * Create an {@link UIEventObserver} object. @@ -4785,11 +5142,27 @@ declare class Driver { * @throws { BusinessError } 17000002 - The async function is not called with await. * @syscap SystemCapability.Test.UiTest * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} + * @since 11 * @test - * @arkts 1.1&1.2 */ mouseDoubleClick(p: Point, btnId: MouseButton, key1?: number, key2?: number): Promise; + /** + * Double click on the specified location on the screen with the specified mouse button, and press the specified key simultaneously if necessary. + * + * @param { Point } p - the coordinate of the specified location. + * @param { MouseButton } btnId - the button of Mouse. + * @param { number | null } [key1] - the first keyCode,set it default 0 if null or undefined. + * @param { number | null } [key2] - the second keyCode,set it default 0 if null or undefined. + * @returns { Promise } + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. + * @throws { BusinessError } 17000002 - The async function is not called with await. + * @syscap SystemCapability.Test.UiTest + * @atomicservice + * @since 20 + * @test + * @arkts 1.2 + */ + mouseDoubleClick(p: Point, btnId: MouseButton, key1?: number | null, key2?: number | null): Promise; /** * Long click on the specified location on the screen with the specified mouse button, and press the specified key simultaneously if necessary. @@ -4803,11 +5176,27 @@ declare class Driver { * @throws { BusinessError } 17000002 - The async function is not called with await. * @syscap SystemCapability.Test.UiTest * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} + * @since 11 * @test - * @arkts 1.1&1.2 */ mouseLongClick(p: Point, btnId: MouseButton, key1?: number, key2?: number): Promise; + /** + * Long click on the specified location on the screen with the specified mouse button, and press the specified key simultaneously if necessary. + * + * @param { Point } p - the coordinate of the specified location. + * @param { MouseButton } btnId - the button of Mouse. + * @param { number | null } [key1] - the first keyCode,set it default 0 if null or undefined. + * @param { number | null } [key2] - the second keyCode,set it default 0 if null or undefined. + * @returns { Promise } + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. + * @throws { BusinessError } 17000002 - The async function is not called with await. + * @syscap SystemCapability.Test.UiTest + * @atomicservice + * @since 20 + * @test + * @arkts 1.2 + */ + mouseLongClick(p: Point, btnId: MouseButton, key1?: number | null, key2?: number | null): Promise; /** * Long click on the specified location on the screen with the specified mouse button, and press the specified key simultaneously if necessary. @@ -4826,6 +5215,23 @@ declare class Driver { * @test */ mouseLongClick(p: Point, btnId: MouseButton, key1?: number, key2?: number, duration?: number): Promise; + /** + * Long click on the specified location on the screen with the specified mouse button, and press the specified key simultaneously if necessary. + * + * @param { Point } p - the coordinate of the specified location. + * @param { MouseButton } btnId - the button of Mouse. + * @param { number | null } [key1] - the first keyCode,set it default 0 if null or undefined. + * @param { number | null } [key2] - the second keyCode,set it default 0 if null or undefined. + * @param { number | null } [duration] - duration of mouse longClick in millisecond, the minimum and default are 1500. + * @returns { Promise } + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. + * @throws { BusinessError } 17000002 - The async function is not called with await. + * @syscap SystemCapability.Test.UiTest + * @atomicservice + * @since 20 + * @test + */ + mouseLongClick(p: Point, btnId: MouseButton, key1?: number | null, key2?: number | null, duration?: number | null): Promise; /** * Swipe on the screen between the specified points with mouse. @@ -4838,11 +5244,26 @@ declare class Driver { * @throws { BusinessError } 17000002 - The async function is not called with await. * @syscap SystemCapability.Test.UiTest * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} + * @since 11 * @test - * @arkts 1.1&1.2 */ mouseMoveWithTrack(from: Point, to: Point, speed?: number): Promise; + /** + * Swipe on the screen between the specified points with mouse. + * + * @param { Point } from - the starting point. + * @param { Point } to - the ending point. + * @param { number | null } [speed] - speed of swipe (pixels per second),the value ranges from 200 to 40000.Set it default 600 if out of range or null or undefined. + * @returns { Promise } + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. + * @throws { BusinessError } 17000002 - The async function is not called with await. + * @syscap SystemCapability.Test.UiTest + * @atomicservice + * @since 20 + * @test + * @arkts 1.2 + */ + mouseMoveWithTrack(from: Point, to: Point, speed?: number | null): Promise; /** * Hold down the left mouse button and drag on the screen between the specified points. @@ -4877,6 +5298,23 @@ declare class Driver { * @test */ mouseDrag(from: Point, to: Point, speed?: number, duration?: number): Promise; + /** + * Hold down the left mouse button and drag on the screen between the specified points. + * + * @param { Point } from - the starting point. + * @param { Point } to - the ending point. + * @param { number } [speed] - speed of drag (pixels per second),the value ranges from 200 to 40000,Set it default 600 if out of range or null or undefined. + * @param { number } [duration] - duration of longClick before drag in millisecond, the minimum and default are 1500. + * @returns { Promise } + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. + * @throws { BusinessError } 17000002 - The async function is not called with await. + * @syscap SystemCapability.Test.UiTest + * @atomicservice + * @since 20 + * @test + * @arkts 1.2 + */ + mouseDrag(from: Point, to: Point, speed?: number | null, duration?: number | null): Promise; /** * Inject text on the specified location. @@ -4922,11 +5360,26 @@ declare class Driver { * @throws { BusinessError } 17000005 This operation is not supported. * @syscap SystemCapability.Test.UiTest * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} + * @since 11 * @test - * @arkts 1.1&1.2 */ touchPadMultiFingerSwipe(fingers: number, direction: UiDirection, options?: TouchPadSwipeOptions): Promise; + /** + * Simulate touchpad multi-finger swipe gestures. + * @param { number } fingers Finger count of touchpad multi-finger swipe, ranges from 3 to 4. + * @param { UiDirection } direction Direction of touchpad multi-finger swipe. + * @param { TouchPadSwipeOptions | null } [options] Additional options touchpad multi-finger swipe gestures, set its parameters to default values if null or undefined. + * @returns { Promise } + * @throws { BusinessError } 401 Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. + * @throws { BusinessError } 17000002 The async function is not called with await. + * @throws { BusinessError } 17000005 This operation is not supported. + * @syscap SystemCapability.Test.UiTest + * @atomicservice + * @since 20 + * @test + * @arkts 1.2 + */ + touchPadMultiFingerSwipe(fingers: number, direction: UiDirection, options?: TouchPadSwipeOptions | null): Promise; /** * Simulate pen click operation. @@ -4951,11 +5404,24 @@ declare class Driver { * @throws { BusinessError } 17000002 The async function is not called with await. * @syscap SystemCapability.Test.UiTest * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} + * @since 11 * @test - * @arkts 1.1&1.2 */ penLongClick(point: Point, pressure?: number): Promise; + /** + * Simulate pen long click operation. + * @param { Point } point Coordinate of the specified location. + * @param { number } [pressure] Pressure of pen long click operation, default is 1.0, the value ranges from 0.0 to 1.0. + * @returns { Promise } + * @throws { BusinessError } 401 Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. + * @throws { BusinessError } 17000002 The async function is not called with await. + * @syscap SystemCapability.Test.UiTest + * @atomicservice + * @since 20 + * @test + * @arkts 1.2 + */ + penLongClick(point: Point, pressure?: number | null): Promise; /** * Simulate pen double click operation. @@ -4982,11 +5448,26 @@ declare class Driver { * @throws { BusinessError } 17000002 The async function is not called with await. * @syscap SystemCapability.Test.UiTest * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} + * @since 11 * @test - * @arkts 1.1&1.2 */ penSwipe(startPoint: Point, endPoint: Point, speed?: number, pressure?: number): Promise; + /** + * Simulate pen swipe operation. + * @param { Point } startPoint Coordinate of the specified location. + * @param { Point } endPoint Coordinate of the specified location. + * @param { number | null } [speed] Speed(pixels per second) of pen swipe, default is 600,the value ranges from 200 to 40000,set it 600 if out of range. + * @param { number | null } [pressure] Pressure of pen swipe operation, default is 1.0, the value ranges from 0.0 to 1.0. + * @returns { Promise } + * @throws { BusinessError } 401 Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. + * @throws { BusinessError } 17000002 The async function is not called with await. + * @syscap SystemCapability.Test.UiTest + * @atomicservice + * @since 20 + * @test + * @arkts 1.2 + */ + penSwipe(startPoint: Point, endPoint: Point, speed?: number | null, pressure?: number | null): Promise; /** * Inject pen multi-pointer action on the device display. @@ -4998,11 +5479,25 @@ declare class Driver { * @throws { BusinessError } 17000002 The async function is not called with await. * @syscap SystemCapability.Test.UiTest * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} + * @since 11 * @test - * @arkts 1.1&1.2 */ injectPenPointerAction(pointers: PointerMatrix, speed?: number, pressure?: number): Promise; + /** + * Inject pen multi-pointer action on the device display. + * @param { PointerMatrix } pointers The two-dimensional array of pointers to inject. + * @param { number | null } [speed] Speed(pixels per second) of inject pen pointer action, default is 600,the value ranges from 200 to 40000,set it 600 if out of range. + * @param { number | null } [pressure] Pressure of inject pen pointer action operation, default is 1.0, the value ranges from 0.0 to 1.0. + * @returns { Promise } + * @throws { BusinessError } 401 Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed. + * @throws { BusinessError } 17000002 The async function is not called with await. + * @syscap SystemCapability.Test.UiTest + * @atomicservice + * @since 20 + * @test + * @arkts 1.2 + */ + injectPenPointerAction(pointers: PointerMatrix, speed?: number | null, pressure?: number | null): Promise; /** * Inject a watch crown rotation event, specifies the rotation speed if necessary. @@ -5019,6 +5514,22 @@ declare class Driver { * @test */ crownRotate(d: number, speed?: number): Promise; + /** + * Inject a watch crown rotation event, specifies the rotation speed if necessary. + * + * @param { number } d The number of cells that watch rotates.Positive value indicate clockwise rotation,negative value indicate counterclockwise rotation. + * @param { number | null } [speed] The speed of watch crown rotates(cells per second),ranges from 1 to 500.Set it default 20 if out of range or undefined or null. + * @returns { Promise } + * @throws { BusinessError } 801 - Capability not support, function can not work correctly due to limited device capabilities. + * @throws { BusinessError } 17000002 - The async function is not called with await. + * @throws { BusinessError } 17000007 - Parameter verification failed. + * @syscap SystemCapability.Test.UiTest + * @atomicservice + * @since 20 + * @test + * @arkts 1.2 + */ + crownRotate(d: number, speed?: number | null): Promise; } /**