diff --git a/api/@ohos.uitest.d.ts b/api/@ohos.uitest.d.ts index 354d22d738c1e27bcb0748521934a62ba752b84f..618cd1403ad0427efc2e25f78c9c891518371c22 100755 --- a/api/@ohos.uitest.d.ts +++ b/api/@ohos.uitest.d.ts @@ -49,6 +49,16 @@ ENDS_WITH = 3 } +/** + * Represents the point on the device screen. + * + * @since 9 + */ +declare interface Point { + readonly X: number; + readonly Y: number; +} + /** * Represents the rectangle area on the device screen. * @@ -371,18 +381,20 @@ declare interface Rect { /** * Scroll on this {@link UiComponent} to the top,applicable to scrollable one. * @syscap SystemCapability.Test.UiTest + * @param speed the speed of swipe (pixels per second), default is 600. * @since 9 * @test */ - scrollToTop(): Promise; + scrollToTop(speed?: number): Promise; /** * Scroll on this {@link UiComponent} to the bottom,applicable to scrollable one. * @syscap SystemCapability.Test.UiTest + * @param speed the speed of swipe (pixels per second), default is 600. * @since 9 * @test */ - scrollToBottom(): Promise; + scrollToBottom(speed?: number): Promise; /** * Scroll on this {@link UiComponent}to find matched {@link UiComponent},applicable to scrollable one. @@ -394,7 +406,7 @@ declare interface Rect { */ scrollSearch(by:By):Promise; - /** + /** * Get the bounds rect of this {@link UiComponent}. * @syscap SystemCapability.Test.UiTest * @return the bounds rect object. @@ -403,6 +415,15 @@ declare interface Rect { */ getBounds(): Promise; + /** + * Get the boundsCenter of this {@link UiComponent}. + * @syscap SystemCapability.Test.UiTest + * @return the boundsCenter object. + * @since 9 + * @test + */ + getBoundsCenter(): Promise; + /** * Drag this {@link UiComponent} to the bounds rect of target UiComponent. * @syscap SystemCapability.Test.UiTest @@ -535,22 +556,24 @@ declare interface Rect { * @param starty the y-coordinate of the starting point. * @param endx the x-coordinate of the ending point. * @param endy the y-coordinate of the ending point. + * @param speed the speed of swipe (pixels per second), default is 600. * @since 8 * @test */ - swipe(startx:number,starty:number,endx:number,endy:number):Promise; + swipe(startx: number, starty: number, endx: number, endy: number, speed?: number): Promise; -/** + /** * Drag on the screen between the specified points. * @syscap SystemCapability.Test.UiTest * @param startx the x-coordinate of the starting point. * @param starty the y-coordinate of the starting point. * @param endx the x-coordinate of the ending point. * @param endy the y-coordinate of the ending point. + * @param speed the speed of swipe (pixels per second), default is 600. * @since 9 * @test */ - drag(startx: number, starty: number, endx: number, endy: number): Promise; + drag(startx: number, starty: number, endx: number, endy: number, speed?: number): Promise; /** * Capture current screen and save as picture which PNG format.