From 4007fad2f9d4bd8cf9f2536dd301eae844a79819 Mon Sep 17 00:00:00 2001 From: jianqirui Date: Wed, 14 Sep 2022 21:07:20 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E5=8F=98=E6=9B=B4uitestkit=E7=9A=84api?= =?UTF-8?q?=E5=92=8C=E9=94=99=E8=AF=AF=E7=A0=81=E8=AF=B4=E6=98=8E=20Signed?= =?UTF-8?q?-off-by:=20jianqirui=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/@ohos.uitest.d.ts | 1756 +++++++++++++++++++++++++++-------------- 1 file changed, 1171 insertions(+), 585 deletions(-) diff --git a/api/@ohos.uitest.d.ts b/api/@ohos.uitest.d.ts index c758260873..7d0eb03a93 100644 --- a/api/@ohos.uitest.d.ts +++ b/api/@ohos.uitest.d.ts @@ -13,591 +13,1085 @@ * limitations under the License. */ +/** + * Enumerates the string value match pattern. + * @syscap SystemCapability.Test.UiTest + * @since 8 + */ +declare enum MatchPattern { + /** + * Equals to a string. + * @syscap SystemCapability.Test.UiTest + * @since 8 + * @test + */ + EQUALS = 0, + /** + * Contains a substring. + * @syscap SystemCapability.Test.UiTest + * @since 8 + * @test + */ + CONTAINS = 1, + /** + * StartsWith a substring. + * @syscap SystemCapability.Test.UiTest + * @since 8 + * @test + */ + STARTS_WITH = 2, + /** + * EndsWith a substring. + * @syscap SystemCapability.Test.UiTest + * @since 8 + * @test + */ + ENDS_WITH = 3 +} + +/** + * Describes the attribute requirements for the target UiComponents. + * + * @since 8 + * @deprecated since 9 + * @syscap SystemCapability.Test.UiTest + */ +declare class By { + /** + * Specifies the text for the target UiComponent. + * @syscap SystemCapability.Test.UiTest + * @param txt the text value. + * @param pattern the {@link MatchPattern} of the text value,default to {@link MatchPattern.EQUALS} + * @return Returns this {@link By} object. + * @since 8 + * @test + */ + text(txt: string, pattern?: MatchPattern): By; + + /** + * Specifies the inspectorKey of the target UiComponent. + * @syscap SystemCapability.Test.UiTest + * @param key the inspectorKey value. + * @return Returns this {@link By} object. + * @since 8 + * @test + */ + key(key: string): By; + + /** + * Specifies the id of the target UiComponent. + * @syscap SystemCapability.Test.UiTest + * @param id the id value. + * @return Returns this {@link By} object. + * @since 8 + * @test + */ + id(id: number): By; + + /** + * Specifies the type of the target UiComponent. + * @syscap SystemCapability.Test.UiTest + * @param tp the type value. + * @return Returns this {@link By} object. + * @since 8 + * @test + */ + type(tp: string): By; + + /** + * Specifies the clickable status of the target UiComponent. + * @syscap SystemCapability.Test.UiTest + * @param b the clickable status,default to true. + * @return Returns this {@link By} object. + * @since 8 + * @test + */ + clickable(b?: boolean): By; + + /** + * Specifies the scrollable status of the target UiComponent. + * @syscap SystemCapability.Test.UiTest + * @param b the scrollable status,default to true. + * @return Returns this {@link By} object. + * @since 8 + * @test + */ + scrollable(b?: boolean): By; + + /** + * Specifies the enabled status of the target UiComponent. + * @syscap SystemCapability.Test.UiTest + * @param b the enabled status,default to true. + * @return Returns this {@link By} object. + * @since 8 + * @test + */ + enabled(b?: boolean): By; + + /** + * Specifies the focused status of the target UiComponent. + * @syscap SystemCapability.Test.UiTest + * @param b the focused status,default to true. + * @return Returns this {@link By} object. + * @since 8 + * @test + */ + focused(b?: boolean): By; + + /** + * Specifies the selected status of the target UiComponent. + * @syscap SystemCapability.Test.UiTest + * @param b the selected status,default to true. + * @return Returns this {@link By} object. + * @since 8 + * @test + */ + selected(b?: boolean): By; + + /** + * Requires that the target UiComponent which is before another UiComponent that specified by the given {@link By} + * object,used to locate UiComponent relatively. + * @syscap SystemCapability.Test.UiTest + * @param by describes the attribute requirements of UiComponent which the target one is in front of. + * @return Returns this {@link By} object. + * @since 8 + * @test + */ + isBefore(by: By): By; + + /** + * Requires that the target UiComponent which is after another UiComponent that specified by the given {@link By} + * object,used to locate UiComponent relatively. + * @syscap SystemCapability.Test.UiTest + * @param by describes the attribute requirements of UiComponent which the target one is in back of. + * @return Returns this {@link By} object. + * @since 8 + * @test + */ + isAfter(by: By): By; +} + +/** + * Represents a UiComponent of the ohos application,user can perform operations or query attributes on it. + * + * @since 8 + * @deprecated since 9 + * @test + * @syscap SystemCapability.Test.UiTest + */ +declare class UiComponent { + /** + * Click this {@link UiComponent}. + * @syscap SystemCapability.Test.UiTest + * @since 8 + * @test + */ + click(): Promise; + + /** + * Double click this {@link UiComponent}. + * @syscap SystemCapability.Test.UiTest + * @since 8 + * @test + */ + doubleClick(): Promise; + + /** + * Long click this {@link UiComponent}. + * @syscap SystemCapability.Test.UiTest + * @since 8 + * @test + */ + longClick(): Promise; + + /** + * Get the id attribute value. + * @syscap SystemCapability.Test.UiTest + * @returns the id value. + * @since 8 + * @test + */ + getId(): Promise; + + /** + * Get the inspectorKey attribute value. + * @syscap SystemCapability.Test.UiTest + * @returns the inspectorKey value. + * @since 8 + * @test + */ + getKey(): Promise; + + /** + * Get the text attribute value. + * @syscap SystemCapability.Test.UiTest + * @since 8 + * @test + */ + getText(): Promise; + + /** + * Get the type name. + * @syscap SystemCapability.Test.UiTest + * @returns the type name. + * @since 8 + * @test + */ + getType(): Promise; + + /** + * Get the clickable status of this {@link UiComponent}. + * @syscap SystemCapability.Test.UiTest + * @returns the clickable status. + * @since 8 + * @test + */ + isClickable(): Promise; + + /** + * Get the scrollable status of this {@link UiComponent}. + * @syscap SystemCapability.Test.UiTest + * @returns the scrollable status. + * @since 8 + * @test + */ + isScrollable(): Promise; + + /** + * Get the enabled status of this {@link UiComponent}. + * @syscap SystemCapability.Test.UiTest + * @returns the enabled status. + * @since 8 + * @test + */ + isEnabled(): Promise; + + /** + * Get the focused status of this {@link UiComponent}. + * @syscap SystemCapability.Test.UiTest + * @returns the focused status. + * @since 8 + * @test + */ + isFocused(): Promise; + + /** + * Get the selected status of this {@link UiComponent}. + * @syscap SystemCapability.Test.UiTest + * @returns the selected status. + * @since 8 + * @test + */ + isSelected(): Promise; + + /** + * Inject text to this {@link UiComponent},applicable to TextInput. + * @syscap SystemCapability.Test.UiTest + * @param text the text to inject. + * @since 8 + * @test + */ + inputText(text: string): Promise; + + /** + * Scroll on this {@link UiComponent}to find matched {@link UiComponent},applicable to scrollable one. + * @syscap SystemCapability.Test.UiTest + * @param by the attribute requirements of the target {@link UiComponent}. + * @return the found result,or undefined if not found. + * @since 8 + * @test + */ + scrollSearch(by: By): Promise; +} + +/** + * The unified facade of UiTest framework,can be used to find {@link UiComponent},trigger keyEvents,perform + * coordinates-based UI actions,capture screen and so on. + * + * @since 8 + * @deprecated since 9 + * @test + * @syscap SystemCapability.Test.UiTest + */ +declare class UiDriver { + /** + * Create an {@link UiDriver} object. + * @syscap SystemCapability.Test.UiTest + * @returns the {@link UiDriver} object. + * @since 8 + * @test + */ + static create(): UiDriver; + + /** + * Delay with specified duration. + * @syscap SystemCapability.Test.UiTest + * @param duration the delay duration in milliseconds. + * @since 8 + * @test + */ + delayMs(duration: number): Promise; + + /** + * Find the first matched {@link UiComponent} on current UI. + * @syscap SystemCapability.Test.UiTest + * @param by the attribute requirements of the target {@link UiComponent}. + * @returns the first matched {@link UiComponent} or undefined. + * @since 8 + * @test + */ + findComponent(by: By): Promise; + + /** + * Find all the matched {@link UiComponent}s on current UI. + * @syscap SystemCapability.Test.UiTest + * @param by the attribute requirements of the target {@link UiComponent}. + * @returns the matched {@link UiComponent}s list. + * @since 8 + * @test + */ + findComponents(by: By): Promise>; + + /** + * Assert t the matched {@link UiComponent}s exists on current UI;if not,assertError will be raised. + * @syscap SystemCapability.Test.UiTest + * @param by the attribute requirements of the target {@link UiComponent}. + * @throws Throws this exception if following error occurs:{@code ComponentExistAssertion Failure}. + * @since 8 + * @test + */ + assertComponentExist(by: By): Promise; + + /** + * Press the BACK key. + * @syscap SystemCapability.Test.UiTest + * @since 8 + * @test + */ + pressBack(): Promise; + + /** + * Press the specified key. + * @syscap SystemCapability.Test.UiTest + * @param keyCode the target keyCode. + * @since 8 + * @test + */ + triggerKey(keyCode: number): Promise; + + /** + * Click on the specified location on the screen. + * @syscap SystemCapability.Test.UiTest + * @param x the x-coordinate. + * @param y the y-coordinate. + * @since 8 + * @test + */ + click(x: number, y: number): Promise; + + /** + * DoubleClick on the specified location on the screen. + * @syscap SystemCapability.Test.UiTest + * @param x the x-coordinate. + * @param y the y-coordinate. + * @since 8 + * @test + */ + doubleClick(x: number, y: number): Promise; + + /** + * LongClick on the specified location on the screen. + * @syscap SystemCapability.Test.UiTest + * @param x the x-coordinate. + * @param y the y-coordinate. + * @since 8 + * @test + */ + longClick(x: number, y: number): Promise; + + /** + * Swipe 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. + * @since 8 + * @test + */ + swipe(startx: number, starty: number, endx: number, endy: number): Promise; + + /** + * Capture current screen and save as picture which PNG format. + * @syscap SystemCapability.Test.UiTest + * @param savePath the path where to store the picture. + * @returns true if screen-capturing and file-storing are completed successfully,false otherwise. + * @since 8 + * @test + */ + screenCap(savePath: string): Promise; +} + + +/** + * Describes the window mode of the tested window + * @syscap SystemCapability.Test.UiTest + * @since 9 + */ +declare enum WindowMode { + FULLSCREEN, + PRIMARY, + SECONDARY, + FLOATING +} + /** * Resize direction for the window. * @syscap SystemCapability.Test.UiTest * @since 9 */ - declare enum ResizeDirection{ - LEFT, - RIGHT, - UP, - DOWN, - LEFT_UP, - LEFT_DOWN, - RIGHT_UP, - RIGHT_DOWN - } +declare enum ResizeDirection { + LEFT, + RIGHT, + UP, + DOWN, + LEFT_UP, + LEFT_DOWN, + RIGHT_UP, + RIGHT_DOWN +} + +/** + * Describes the rotation of the device display + * @syscap SystemCapability.Test.UiTest + * @since 9 + */ +declare enum DisplayRotation { + ROTATION_0, + ROTATION_90, + ROTATION_180, + ROTATION_270 +} + /** - * Enumerates the string value match pattern. + * Represents the point on the device screen. * @syscap SystemCapability.Test.UiTest - * @since 8 + * @since 9 */ - declare enum MatchPattern{ - /** - * Equals to a string. - * @syscap SystemCapability.Test.UiTest - * @since 8 - * @test - */ - EQUALS = 0, - /** - * Contains a substring. - * @syscap SystemCapability.Test.UiTest - * @since 8 - * @test - */ - CONTAINS = 1, - /** - * StartsWith a substring. - * @syscap SystemCapability.Test.UiTest - * @since 8 - * @test - */ - STARTS_WITH = 2, - /** - * EndsWith a substring. - * @syscap SystemCapability.Test.UiTest - * @since 8 - * @test - */ - ENDS_WITH = 3 +declare interface Point { + readonly X: number; + readonly Y: number; } -/** - * Describes the window mode of the tested window - * @syscap SystemCapability.Test.UiTest - * @since 9 - */ - declare enum WindowMode{ - FULLSCREEN, - PRIMARY, - SECONDARY, - FLOATING - } +/** + * Represents the rectangle area on the device screen. + * @syscap SystemCapability.Test.UiTest + * @since 9 + */ +declare interface Rect { + readonly leftX: number; + readonly topY: number; + readonly rightX: number; + readonly bottomY: number; +} + +/** + * Represents filer condition to get the window . + * @syscap SystemCapability.Test.UiTest + * @since 9 + */ +declare interface WindowFilter { + readonly bundleName?: string; + readonly title?: string; + readonly focused?: boolean; + readonly actived?: boolean; +} + +/** + * Describes the attribute requirements for the target Components. + * + * @since 9 + * @syscap SystemCapability.Test.UiTest + */ +declare class On { + /** + * Specifies the text for the target Component. + * @syscap SystemCapability.Test.UiTest + * @param txt the text value. + * @param pattern the {@link MatchPattern} of the text value, default to {@link MatchPattern.EQUALS} + * @return Returns this {@link On} object. + * @throws {BusinessError} 401 if the input parameters are invalid. + * @throws {BusinessError} 17000006 if there is a system internal error. + * @since 9 + * @test + */ + text(txt: string, pattern?: MatchPattern): On; + + /** + * Specifies the id of the target Component. + * @syscap SystemCapability.Test.UiTest + * @param id the id value. + * @return Returns this {@link On} object. + * @throws {BusinessError} 401 if the input parameters are invalid. + * @throws {BusinessError} 17000006 if there is a system internal error. + * @since 9 + * @test + */ + id(id: string): On; + + /** + * Specifies the type of the target Component. + * @syscap SystemCapability.Test.UiTest + * @param tp the type value. + * @return Returns this {@link On} object. + * @throws {BusinessError} 401 if the input parameters are invalid. + * @throws {BusinessError} 17000006 if there is a system internal error. + * @since 9 + * @test + */ + type(tp: string): On; + + /** + * Specifies the clickable status of the target Component. + * @syscap SystemCapability.Test.UiTest + * @param b the clickable status,default to true. + * @return Returns this {@link On} object. + * @throws {BusinessError} 401 if the input parameters are invalid. + * @throws {BusinessError} 17000006 if there is a system internal error. + * @since 9 + * @test + */ + clickable(b?: boolean): On; + + /** + * Specifies the longClickable status of the target Component. + * @syscap SystemCapability.Test.UiTest + * @param b the clickable status,default to true. + * @return Returns this {@link On} object. + * @throws {BusinessError} 401 if the input parameters are invalid. + * @throws {BusinessError} 17000006 if there is a system internal error. + * @since 9 + * @test + */ + longClickable(b?: boolean): On; + + /** + * Specifies the scrollable status of the target Component. + * @syscap SystemCapability.Test.UiTest + * @param b the scrollable status,default to true. + * @return Returns this {@link On} object. + * @throws {BusinessError} 401 if the input parameters are invalid. + * @throws {BusinessError} 17000006 if there is a system internal error. + * @since 9 + * @test + */ + scrollable(b?: boolean): On; + + /** + * Specifies the enabled status of the target Component. + * @syscap SystemCapability.Test.UiTest + * @param b the enabled status,default to true. + * @return Returns this {@link On} object. + * @throws {BusinessError} 401 if the input parameters are invalid. + * @throws {BusinessError} 17000006 if there is a system internal error. + * @since 9 + * @test + */ + enabled(b?: boolean): On; + + /** + * Specifies the focused status of the target Component. + * @syscap SystemCapability.Test.UiTest + * @param b the focused status,default to true. + * @return Returns this {@link On} object. + * @throws {BusinessError} 401 if the input parameters are invalid. + * @throws {BusinessError} 17000006 if there is a system internal error. + * @since 9 + * @test + */ + focused(b?: boolean): On; + + /** + * Specifies the selected status of the target Component. + * @syscap SystemCapability.Test.UiTest + * @param b the selected status,default to true. + * @return Returns this {@link On} object. + * @throws {BusinessError} 401 if the input parameters are invalid. + * @throws {BusinessError} 17000006 if there is a system internal error. + * @since 9 + * @test + */ + selected(b?: boolean): On; + + /** + * Specifies the checked status of the target Component. + * @syscap SystemCapability.Test.UiTest + * @param b the checked status,default to false. + * @return Returns this {@link On} object. + * @throws {BusinessError} 401 if the input parameters are invalid. + * @throws {BusinessError} 17000006 if there is a system internal error. + * @since 9 + * @test + */ + checked(b?: boolean): On; + + /** + * Specifies the checkable status of the target Component. + * @syscap SystemCapability.Test.UiTest + * @param b the checkable status,default to false. + * @return Returns this {@link On} object. + * @throws {BusinessError} 401 if the input parameters are invalid. + * @throws {BusinessError} 17000006 if there is a system internal error. + * @since 9 + * @test + */ + checkable(b?: boolean): On; + + /** + * Requires that the target Component which is before another Component that specified by the given {@link On} + * object,used to locate Component relatively. + * @syscap SystemCapability.Test.UiTest + * @param on describes the attribute requirements of Component which the target one is in front of. + * @return Returns this {@link On} object. + * @throws {BusinessError} 401 if the input parameters are invalid. + * @throws {BusinessError} 17000006 if there is a system internal error. + * @since 9 + * @test + */ + isBefore(on: On): On; + + /** + * Requires that the target Component which is after another Component that specified by the given {@link On} + * object,used to locate Component relatively. + * @syscap SystemCapability.Test.UiTest + * @param on describes the attribute requirements of Component which the target one is in back of. + * @return Returns this {@link On} object. + * @throws {BusinessError} 401 if the input parameters are invalid. + * @throws {BusinessError} 17000006 if there is a system internal error. + * @since 9 + * @test + */ + isAfter(on: On): On; +} /** - * Describes the rotation of the device display - * @syscap SystemCapability.Test.UiTest + * Represents an Component of the ohos application,user can perform operations or query attributes on it. + * * @since 9 - */ -declare enum DisplayRotation { - ROTATION_0, - ROTATION_90, - ROTATION_180, - ROTATION_270 -} - -/** - * Represents the point on the device screen. + * @test * @syscap SystemCapability.Test.UiTest - * @since 9 */ -declare interface Point { - readonly X: number; - readonly Y: number; -} +declare class Component { + /** + * Click this {@link Component}. + * @syscap SystemCapability.Test.UiTest + * @since 9 + * @throws {BusinessError} 17000002 if the async function was not called with await. + * @throws {BusinessError} 17000004 if the component is invisible or destroyed. + * @throws {BusinessError} 17000006 if there is a system internal error. + * @test + */ + click(): Promise; -/** - * Represents the rectangle area on the device screen. - * @syscap SystemCapability.Test.UiTest - * @since 9 - */ -declare interface Rect { - readonly leftX: number; - readonly topY: number; - readonly rightX: number; - readonly bottomY: number; -} + /** + * Double click this {@link Component}. + * @syscap SystemCapability.Test.UiTest + * @since 9 + * @throws {BusinessError} 17000002 if the async function was not called with await. + * @throws {BusinessError} 17000004 if the component is invisible or destroyed. + * @throws {BusinessError} 17000006 if there is a system internal error. + * @test + */ + doubleClick(): Promise; -/** - * Represents filer condition to get the window . - * @syscap SystemCapability.Test.UiTest - * @since 9 - */ -declare interface WindowFilter { - readonly bundleName?: string; - readonly title?: string; - readonly focused?: boolean; - readonly actived?: boolean; -} + /** + * Long click this {@link Component}. + * @syscap SystemCapability.Test.UiTest + * @since 9 + * @throws {BusinessError} 17000002 if the async function was not called with await. + * @throws {BusinessError} 17000004 if the component is invisible or destroyed. + * @throws {BusinessError} 17000006 if there is a system internal error. + * @test + */ + longClick(): Promise; -/** - * Describes the attribute requirements for the target UiComponents. - * - * @since 8 - * @syscap SystemCapability.Test.UiTest - */ - declare class By{ - - /** - * Specifies the text for the target UiComponent. - * @syscap SystemCapability.Test.UiTest - * @param txt the text value. - * @param pattern the {@link MatchPattern} of the text value,default to {@link MatchPattern.EQUALS} - * @return Returns this {@link By} object. - * @since 8 - * @test - */ - text(txt:string,pattern?:MatchPattern):By; - - /** - * Specifies the inspectorKey of the target UiComponent. - * @syscap SystemCapability.Test.UiTest - * @param key the inspectorKey value. - * @return Returns this {@link By} object. - * @since 8 - * @test - */ - key(key:string):By; - - /** - * Specifies the id of the target UiComponent. - * @syscap SystemCapability.Test.UiTest - * @param id the id value. - * @return Returns this {@link By} object. - * @since 8 - * @test - */ - id(id:number):By; - - /** - * Specifies the type of the target UiComponent. - * @syscap SystemCapability.Test.UiTest - * @param tp the type value. - * @return Returns this {@link By} object. - * @since 8 - * @test - */ - type(tp:string):By; - - /** - * Specifies the clickable status of the target UiComponent. - * @syscap SystemCapability.Test.UiTest - * @param b the clickable status,default to true. - * @return Returns this {@link By} object. - * @since 8 - * @test - */ - clickable(b?:boolean):By; - - /** - * Specifies the longClickable status of the target UiComponent. - * @syscap SystemCapability.Test.UiTest - * @param b the clickable status,default to true. - * @return Returns this {@link By} object. - * @since 9 - * @test - */ - longClickable(b?: boolean): By; - - /** - * Specifies the scrollable status of the target UiComponent. - * @syscap SystemCapability.Test.UiTest - * @param b the scrollable status,default to true. - * @return Returns this {@link By} object. - * @since 8 - * @test - */ - scrollable(b?:boolean):By; - - /** - * Specifies the enabled status of the target UiComponent. - * @syscap SystemCapability.Test.UiTest - * @param b the enabled status,default to true. - * @return Returns this {@link By} object. - * @since 8 - * @test - */ - enabled(b?:boolean):By; - - /** - * Specifies the focused status of the target UiComponent. - * @syscap SystemCapability.Test.UiTest - * @param b the focused status,default to true. - * @return Returns this {@link By} object. - * @since 8 - * @test - */ - focused(b?:boolean):By; - - /** - * Specifies the selected status of the target UiComponent. - * @syscap SystemCapability.Test.UiTest - * @param b the selected status,default to true. - * @return Returns this {@link By} object. - * @since 8 - * @test - */ - selected(b?:boolean):By; - - /** - * Specifies the checked status of the target UiComponent. - * @syscap SystemCapability.Test.UiTest - * @param b the checked status,default to false. - * @return Returns this {@link By} object. - * @since 9 - * @test - */ - checked(b?: boolean): By; - - /** - * Specifies the checkable status of the target UiComponent. - * @syscap SystemCapability.Test.UiTest - * @param b the checkable status,default to false. - * @return Returns this {@link By} object. - * @since 9 - * @test - */ - checkable(b?: boolean): By; - - /** - * Requires that the target UiComponent which is before another UiComponent that specified by the given {@link By} - * object,used to locate UiComponent relatively. - * @syscap SystemCapability.Test.UiTest - * @param by describes the attribute requirements of UiComponent which the target one is in front of. - * @return Returns this {@link By} object. - * @since 8 - * @test - */ - isBefore(by:By):By; - - /** - * Requires that the target UiComponent which is after another UiComponent that specified by the given {@link By} - * object,used to locate UiComponent relatively. - * @syscap SystemCapability.Test.UiTest - * @param by describes the attribute requirements of UiComponent which the target one is in back of. - * @return Returns this {@link By} object. - * @since 8 - * @test - */ - isAfter(by:By):By; - } + /** + * Get the id attribute value. + * @syscap SystemCapability.Test.UiTest + * @returns the id value. + * @throws {BusinessError} 17000002 if the async function was not called with await. + * @throws {BusinessError} 17000004 if the component is invisible or destroyed. + * @throws {BusinessError} 17000006 if there is a system internal error. + * @since 9 + * @test + */ + getId(): Promise; -/** - * Represents a UiComponent of the ohos application,user can perform operations or query attributes on it. - * - * @since 8 - * @test - * @syscap SystemCapability.Test.UiTest - */ -declare class UiComponent{ - /** - * Click this {@link UiComponent}. - * @syscap SystemCapability.Test.UiTest - * @since 8 - * @test - */ - click():Promise; - - /** - * Double click this {@link UiComponent}. - * @syscap SystemCapability.Test.UiTest - * @since 8 - * @test - */ - doubleClick():Promise; - - /** - * Long click this {@link UiComponent}. - * @syscap SystemCapability.Test.UiTest - * @since 8 - * @test - */ - longClick():Promise; - - /** - * Get the id attribute value. - * @syscap SystemCapability.Test.UiTest - * @returns the id value. - * @since 8 - * @test - */ - getId():Promise; - - /** - * Get the inspectorKey attribute value. - * @syscap SystemCapability.Test.UiTest - * @returns the inspectorKey value. - * @since 8 - * @test - */ - getKey():Promise; - - /** - * Get the text attribute value. - * @syscap SystemCapability.Test.UiTest - * @since 8 - * @test - */ - getText():Promise; - - /** - * Get the type name. - * @syscap SystemCapability.Test.UiTest - * @returns the type name. - * @since 8 - * @test - */ - getType():Promise; - - /** - * Get the clickable status of this {@link UiComponent}. - * @syscap SystemCapability.Test.UiTest - * @returns the clickable status. - * @since 8 - * @test - */ - isClickable():Promise; - - /** - * Get the longClickable status of this {@link UiComponent}. - * @syscap SystemCapability.Test.UiTest - * @returns the longClickable status. - * @since 9 - * @test - */ - isLongClickable(): Promise; - - /** - * Get the scrollable status of this {@link UiComponent}. - * @syscap SystemCapability.Test.UiTest - * @returns the scrollable status. - * @since 8 - * @test - */ - isScrollable():Promise; - - /** - * Get the enabled status of this {@link UiComponent}. - * @syscap SystemCapability.Test.UiTest - * @returns the enabled status. - * @since 8 - * @test - */ - isEnabled():Promise; - - /** - * Get the focused status of this {@link UiComponent}. - * @syscap SystemCapability.Test.UiTest - * @returns the focused status. - * @since 8 - * @test - */ - isFocused():Promise; - - /** - * Get the selected status of this {@link UiComponent}. - * @syscap SystemCapability.Test.UiTest - * @returns the selected status. - * @since 8 - * @test - */ - isSelected():Promise; - - /** - * Get the checked status of this {@link UiComponent}. - * @syscap SystemCapability.Test.UiTest - * @returns the checked status. - * @since 9 - * @test - */ - isChecked(): Promise; - - /** - * Get the checkable status of this {@link UiComponent}. - * @syscap SystemCapability.Test.UiTest - * @returns the checkable status. - * @since 9 - * @test - */ - isCheckable(): Promise; - - /** - * Inject text to this {@link UiComponent},applicable to TextInput. - * @syscap SystemCapability.Test.UiTest - * @param text the text to inject. - * @since 8 - * @test - */ - inputText(text: string):Promise; - - /** - * Clear text of this {@link UiComponent},applicable to TextInput. - * @syscap SystemCapability.Test.UiTest - * @since 9 - * @test - */ - clearText(): Promise; - - /** - * 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,the value ranges from 200 to 3000,set it 600 if out of range. - * @since 9 - * @test - */ - 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,the value ranges from 200 to 3000,set it 600 if out of range. - * @since 9 - * @test - */ - scrollToBottom(speed?: number): Promise; - - /** - * Scroll on this {@link UiComponent}to find matched {@link UiComponent},applicable to scrollable one. - * @syscap SystemCapability.Test.UiTest - * @param by the attribute requirements of the target {@link UiComponent}. - * @return the found result,or undefined if not found. - * @since 8 - * @test - */ - scrollSearch(by:By):Promise; - - /** - * Get the bounds rect of this {@link UiComponent}. - * @syscap SystemCapability.Test.UiTest - * @return the bounds rect object. - * @since 9 - * @test - */ - 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 - * @param target the target {@link UiComponent}. - * @since 9 - * @test - */ - dragTo(target: UiComponent): Promise; - - /** - * Pinch enlarge this {@link UiComponent} to the target scale. - * @syscap SystemCapability.Test.UiTest - * @param scale the scale of the pinch enlarge this {@link UiComponent}'s size. - * @since 9 - * @test - */ - pinchOut(scale: number): Promise; - - /** - * Pinch shrink this {@link UiComponent} to the target scale. - * @syscap SystemCapability.Test.UiTest - * @param scale the scale of the pinch shrink this {@link UiComponent}'s size. - * @since 9 - * @test - */ - pinchIn(scale: number): Promise; + /** + * Get the text attribute value. + * @syscap SystemCapability.Test.UiTest + * @throws {BusinessError} 17000002 if the async function was not called with await. + * @throws {BusinessError} 17000004 if the component is invisible or destroyed. + * @throws {BusinessError} 17000006 if there is a system internal error. + * @since 9 + * @test + */ + getText(): Promise; + + /** + * Get the type name. + * @syscap SystemCapability.Test.UiTest + * @returns the type name. + * @throws {BusinessError} 17000002 if the async function was not called with await. + * @throws {BusinessError} 17000004 if the component is invisible or destroyed. + * @throws {BusinessError} 17000006 if there is a system internal error. + * @since 9 + * @test + */ + getType(): Promise; + + /** + * Get the clickable status of this {@link Component}. + * @syscap SystemCapability.Test.UiTest + * @returns the clickable status. + * @throws {BusinessError} 17000002 if the async function was not called with await. + * @throws {BusinessError} 17000004 if the component is invisible or destroyed. + * @throws {BusinessError} 17000006 if there is a system internal error. + * @since 9 + * @test + */ + isClickable(): Promise; + + /** + * Get the longClickable status of this {@link Component}. + * @syscap SystemCapability.Test.UiTest + * @returns the longClickable status. + * @throws {BusinessError} 17000002 if the async function was not called with await. + * @throws {BusinessError} 17000004 if the component is invisible or destroyed. + * @throws {BusinessError} 17000006 if there is a system internal error. + * @since 9 + * @test + */ + isLongClickable(): Promise; + + /** + * Get the scrollable status of this {@link Component}. + * @syscap SystemCapability.Test.UiTest + * @returns the scrollable status. + * @throws {BusinessError} 17000002 if the async function was not called with await. + * @throws {BusinessError} 17000004 if the component is invisible or destroyed. + * @throws {BusinessError} 17000006 if there is a system internal error. + * @since 9 + * @test + */ + isScrollable(): Promise; + + /** + * Get the enabled status of this {@link Component}. + * @syscap SystemCapability.Test.UiTest + * @returns the enabled status. + * @throws {BusinessError} 17000002 if the async function was not called with await. + * @throws {BusinessError} 17000004 if the component is invisible or destroyed. + * @throws {BusinessError} 17000006 if there is a system internal error. + * @since 9 + * @test + */ + isEnabled(): Promise; + + /** + * Get the focused status of this {@link Component}. + * @syscap SystemCapability.Test.UiTest + * @returns the focused status. + * @throws {BusinessError} 17000002 if the async function was not called with await. + * @throws {BusinessError} 17000004 if the component is invisible or destroyed. + * @throws {BusinessError} 17000006 if there is a system internal error. + * @since 9 + * @test + */ + isFocused(): Promise; + + /** + * Get the selected status of this {@link Component}. + * @syscap SystemCapability.Test.UiTest + * @returns the selected status. + * @throws {BusinessError} 17000002 if the async function was not called with await. + * @throws {BusinessError} 17000004 if the component is invisible or destroyed. + * @throws {BusinessError} 17000006 if there is a system internal error. + * @since 9 + * @test + */ + isSelected(): Promise; + + /** + * Get the checked status of this {@link Component}. + * @syscap SystemCapability.Test.UiTest + * @returns the checked status. + * @throws {BusinessError} 17000002 if the async function was not called with await. + * @throws {BusinessError} 17000004 if the component is invisible or destroyed. + * @throws {BusinessError} 17000006 if there is a system internal error. + * @since 9 + * @test + */ + isChecked(): Promise; + + /** + * Get the checkable status of this {@link Component}. + * @syscap SystemCapability.Test.UiTest + * @returns the checkable status. + * @throws {BusinessError} 17000002 if the async function was not called with await. + * @throws {BusinessError} 17000004 if the component is invisible or destroyed. + * @throws {BusinessError} 17000006 if there is a system internal error. + * @since 9 + * @test + */ + isCheckable(): Promise; + + /** + * Inject text to this {@link Component},applicable to TextInput. + * @syscap SystemCapability.Test.UiTest + * @param text the text to inject. + * @throws {BusinessError} 401 if the input parameters are invalid. + * @throws {BusinessError} 17000002 if the async function was not called with await. + * @throws {BusinessError} 17000004 if the component is invisible or destroyed. + * @throws {BusinessError} 17000006 if there is a system internal error. + * @since 9 + * @test + */ + inputText(text: string): Promise; + + /** + * Clear text of this {@link Component},applicable to TextInput. + * @syscap SystemCapability.Test.UiTest + * @throws {BusinessError} 17000002 if the async function was not called with await. + * @throws {BusinessError} 17000004 if the component is invisible or destroyed. + * @throws {BusinessError} 17000006 if there is a system internal error. + * @since 9 + * @test + */ + clearText(): Promise; + + /** + * Scroll on this {@link Component} to the top,applicable to scrollable one. + * @syscap SystemCapability.Test.UiTest + * @param speed the speed of swipe (pixels per second),default is 600,the value ranges from 200 to 15000,set it 600 if out of range. + * @throws {BusinessError} 401 if the input parameters are invalid. + * @throws {BusinessError} 17000002 if the async function was not called with await. + * @throws {BusinessError} 17000004 if the component is invisible or destroyed. + * @throws {BusinessError} 17000006 if there is a system internal error. + * @since 9 + * @test + */ + scrollToTop(speed?: number): Promise; + + /** + * Scroll on this {@link Component} to the bottom,applicable to scrollable one. + * @syscap SystemCapability.Test.UiTest + * @param speed the speed of swipe (pixels per second),default is 600,the value ranges from 200 to 15000,set it 600 if out of range. + * @throws {BusinessError} 401 if the input parameters are invalid. + * @throws {BusinessError} 17000002 if the async function was not called with await. + * @throws {BusinessError} 17000004 if the component is invisible or destroyed. + * @throws {BusinessError} 17000006 if there is a system internal error. + * @since 9 + * @test + */ + scrollToBottom(speed?: number): Promise; + + /** + * Scroll on this {@link Component}to find matched {@link Component},applicable to scrollable one. + * @syscap SystemCapability.Test.UiTest + * @param on the attribute requirements of the target {@link Component}. + * @return the found result,or undefined if not found. + * @throws {BusinessError} 401 if the input parameters are invalid. + * @throws {BusinessError} 17000002 if the async function was not called with await. + * @throws {BusinessError} 17000004 if the component is invisible or destroyed. + * @throws {BusinessError} 17000006 if there is a system internal error. + * @since 9 + * @test + */ + scrollSearch(on: On): Promise; + + /** + * Get the bounds rect of this {@link Component}. + * @syscap SystemCapability.Test.UiTest + * @return the bounds rect object. + * @throws {BusinessError} 17000002 if the async function was not called with await. + * @throws {BusinessError} 17000004 if the component is invisible or destroyed. + * @throws {BusinessError} 17000006 if there is a system internal error. + * @since 9 + * @test + */ + getBounds(): Promise; + + /** + * Get the boundsCenter of this {@link Component}. + * @syscap SystemCapability.Test.UiTest + * @return the boundsCenter object. + * @throws {BusinessError} 17000002 if the async function was not called with await. + * @throws {BusinessError} 17000004 if the component is invisible or destroyed. + * @throws {BusinessError} 17000006 if there is a system internal error. + * @since 9 + * @test + */ + getBoundsCenter(): Promise; + + /** + * Drag this {@link Component} to the bounds rect of target Component. + * @syscap SystemCapability.Test.UiTest + * @param target the target {@link Component}. + * @throws {BusinessError} 401 if the input parameters are invalid. + * @throws {BusinessError} 17000002 if the async function was not called with await. + * @throws {BusinessError} 17000004 if the component is invisible or destroyed. + * @throws {BusinessError} 17000006 if there is a system internal error. + * @since 9 + * @test + */ + dragTo(target: Component): Promise; + + /** + * Pinch enlarge this {@link Component} to the target scale. + * @syscap SystemCapability.Test.UiTest + * @param scale the scale of the pinch enlarge this {@link Component}'s size. + * @throws {BusinessError} 401 if the input parameters are invalid. + * @throws {BusinessError} 17000002 if the async function was not called with await. + * @throws {BusinessError} 17000004 if the component is invisible or destroyed. + * @throws {BusinessError} 17000006 if there is a system internal error. + * @since 9 + * @test + */ + pinchOut(scale: number): Promise; + + /** + * Pinch shrink this {@link Component} to the target scale. + * @syscap SystemCapability.Test.UiTest + * @param scale the scale of the pinch shrink this {@link Component}'s size. + * @throws {BusinessError} 401 if the input parameters are invalid. + * @throws {BusinessError} 17000002 if the async function was not called with await. + * @throws {BusinessError} 17000004 if the component is invisible or destroyed. + * @throws {BusinessError} 17000006 if there is a system internal error. + * @since 9 + * @test + */ + pinchIn(scale: number): Promise; } /** - * The unified facade of UiTest framework,can be used to find {@link UiComponent},trigger keyEvents,perform + * The unified facade of UiTest framework,can be used to find {@link Component},trigger keyEvents,perform * coordinates-based UI actions,capture screen and so on. * - * @since 8 + * @since 9 * @test * @syscap SystemCapability.Test.UiTest */ - declare class UiDriver{ +declare class Driver { /** - * Create an {@link UiDriver} object. + * Create an {@link Driver} object. * @syscap SystemCapability.Test.UiTest - * @returns the {@link UiDriver} object. - * @since 8 + * @returns the {@link Driver} object. + * @throws {BusinessError} 17000001 if the test framework failed to initialize. + * @throws {BusinessError} 17000006 if there is a system internal error. + * @since 9 * @test */ - static create():UiDriver; + static create(): Driver; /** * Delay with specified duration. * @syscap SystemCapability.Test.UiTest * @param duration the delay duration in milliseconds. - * @since 8 + * @throws {BusinessError} 401 if the input parameters are invalid. + * @throws {BusinessError} 17000002 if the async function was not called with await. + * @throws {BusinessError} 17000006 if there is a system internal error. + * @since 9 * @test */ - delayMs(duration:number):Promise; + delayMs(duration: number): Promise; /** - * Find the first matched {@link UiComponent} on current UI. + * Find the first matched {@link Component} on current UI. * @syscap SystemCapability.Test.UiTest - * @param by the attribute requirements of the target {@link UiComponent}. - * @returns the first matched {@link UiComponent} or undefined. - * @since 8 + * @param on the attribute requirements of the target {@link Component}. + * @returns the first matched {@link Component} or undefined. + * @throws {BusinessError} 401 if the input parameters are invalid. + * @throws {BusinessError} 17000002 if the async function was not called with await. + * @throws {BusinessError} 17000006 if there is a system internal error. + * @since 9 * @test */ - findComponent(by:By):Promise; + findComponent(on: On): Promise; /** * Find the first matched {@link UiWindow} window. * @syscap SystemCapability.Test.UiTest * @param filter the filer condition of the target {@link UiWindow}. * @returns the first matched {@link UiWindow} or undefined. + * @throws {BusinessError} 401 if the input parameters are invalid. + * @throws {BusinessError} 17000002 if the async function was not called with await. + * @throws {BusinessError} 17000006 if there is a system internal error. * @since 9 * @test */ - findWindow(filter:WindowFilter):Promise; + findWindow(filter: WindowFilter): Promise; /** - * Find the first matched {@link UiComponent} on current UI during the time given. + * Find the first matched {@link Component} on current UI during the time given. * @syscap SystemCapability.Test.UiTest - * @param by the attribute requirements of the target {@link UiComponent}. + * @param on the attribute requirements of the target {@link Component}. * @param time duration of finding in milliseconds - * @returns the first matched {@link UiComponent} or undefined. + * @returns the first matched {@link Component} or undefined. + * @throws {BusinessError} 401 if the input parameters are invalid. + * @throws {BusinessError} 17000002 if the async function was not called with await. + * @throws {BusinessError} 17000006 if there is a system internal error. * @since 9 * @test */ - waitForComponent(by: By, time: number): Promise; + waitForComponent(on: On, time: number): Promise; /** - * Find all the matched {@link UiComponent}s on current UI. + * Find all the matched {@link Component}s on current UI. * @syscap SystemCapability.Test.UiTest - * @param by the attribute requirements of the target {@link UiComponent}. - * @returns the matched {@link UiComponent}s list. - * @since 8 + * @param on the attribute requirements of the target {@link Component}. + * @returns the matched {@link Component}s list. + * @throws {BusinessError} 401 if the input parameters are invalid. + * @throws {BusinessError} 17000002 if the async function was not called with await. + * @throws {BusinessError} 17000006 if there is a system internal error. + * @since 9 * @test */ - findComponents(by:By):Promise>; + findComponents(on: On): Promise>; /** - * Assert t the matched {@link UiComponent}s exists on current UI;if not,assertError will be raised. + * Assert t the matched {@link Component}s exists on current UI;if not,assertError will be raised. * @syscap SystemCapability.Test.UiTest - * @param by the attribute requirements of the target {@link UiComponent}. - * @throws Throws this exception if following error occurs:{@code ComponentExistAssertion Failure}. - * @since 8 + * @param on the attribute requirements of the target {@link Component}. + * @throws {BusinessError} 401 if the input parameters are invalid. + * @throws {BusinessError} 17000002 if the async function was not called with await. + * @throws {BusinessError} 17000006 if there is a system internal error. + * @since 9 * @test */ - assertComponentExist(by:By):Promise; + assertComponentExist(on: On): Promise; /** * Press the BACK key. * @syscap SystemCapability.Test.UiTest - * @since 8 + * @throws {BusinessError} 17000002 if the async function was not called with await. + * @throws {BusinessError} 17000006 if there is a system internal error. + * @since 9 * @test */ - pressBack():Promise; + pressBack(): Promise; /** * Press the specified key. * @syscap SystemCapability.Test.UiTest * @param keyCode the target keyCode. - * @since 8 + * @throws {BusinessError} 401 if the input parameters are invalid. + * @throws {BusinessError} 17000002 if the async function was not called with await. + * @throws {BusinessError} 17000006 if there is a system internal error. + * @since 9 * @test */ - triggerKey(keyCode:number):Promise; + triggerKey(keyCode: number): Promise; /** * Press two or three key combinations @@ -605,6 +1099,9 @@ declare class UiComponent{ * @param key0 the first keyCode. * @param key1 the second keyCode. * @param key2 the third keyCode. + * @throws {BusinessError} 401 if the input parameters are invalid. + * @throws {BusinessError} 17000002 if the async function was not called with await. + * @throws {BusinessError} 17000006 if there is a system internal error. * @since 9 * @test */ @@ -615,43 +1112,39 @@ declare class UiComponent{ * @syscap SystemCapability.Test.UiTest * @param x the x-coordinate. * @param y the y-coordinate. - * @since 8 + * @throws {BusinessError} 401 if the input parameters are invalid. + * @throws {BusinessError} 17000002 if the async function was not called with await. + * @throws {BusinessError} 17000006 if there is a system internal error. + * @since 9 * @test */ - click(x:number,y:number):Promise; + click(x: number, y: number): Promise; /** * DoubleClick on the specified location on the screen. * @syscap SystemCapability.Test.UiTest * @param x the x-coordinate. * @param y the y-coordinate. - * @since 8 + * @throws {BusinessError} 401 if the input parameters are invalid. + * @throws {BusinessError} 17000002 if the async function was not called with await. + * @throws {BusinessError} 17000006 if there is a system internal error. + * @since 9 * @test */ - doubleClick(x:number,y:number):Promise; + doubleClick(x: number, y: number): Promise; /** * LongClick on the specified location on the screen. * @syscap SystemCapability.Test.UiTest * @param x the x-coordinate. * @param y the y-coordinate. - * @since 8 - * @test - */ - longClick(x:number,y:number):Promise; - - /** - * Swipe 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. - * @deprecated since 9 - * @since 8 + * @throws {BusinessError} 401 if the input parameters are invalid. + * @throws {BusinessError} 17000002 if the async function was not called with await. + * @throws {BusinessError} 17000006 if there is a system internal error. + * @since 9 * @test */ - swipe(startx:number,starty:number,endx:number,endy:number):Promise; + longClick(x: number, y: number): Promise; /** * Swipe on the screen between the specified points. @@ -660,20 +1153,26 @@ declare class UiComponent{ * @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,the value ranges from 200 to 3000,set it 600 if out of range. + * @param speed the speed of swipe (pixels per second),default is 600,the value ranges from 200 to 15000,set it 600 if out of range. + * @throws {BusinessError} 401 if the input parameters are invalid. + * @throws {BusinessError} 17000002 if the async function was not called with await. + * @throws {BusinessError} 17000006 if there is a system internal error. * @since 9 * @test */ - swipe(startx:number,starty:number,endx:number,endy:number, speed?: 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,the value ranges from 200 to 3000,set it 600 if out of range. + * @param speed the speed of swipe (pixels per second),default is 600,the value ranges from 200 to 15000,set it 600 if out of range. + * @throws {BusinessError} 401 if the input parameters are invalid. + * @throws {BusinessError} 17000002 if the async function was not called with await. + * @throws {BusinessError} 17000006 if there is a system internal error. * @since 9 * @test */ @@ -684,71 +1183,90 @@ declare class UiComponent{ * @syscap SystemCapability.Test.UiTest * @param savePath the path where to store the picture. * @returns true if screen-capturing and file-storing are completed successfully,false otherwise. - * @since 8 + * @throws {BusinessError} 401 if the input parameters are invalid. + * @throws {BusinessError} 17000002 if the async function was not called with await. + * @throws {BusinessError} 17000006 if there is a system internal error. + * @since 9 * @test */ - screenCap(savePath:string):Promise; + screenCap(savePath: string): Promise; /** * Set the rotation of the device display. * @syscap SystemCapability.Test.UiTest * @param rotation the target rotation to set. + * @throws {BusinessError} 401 if the input parameters are invalid. + * @throws {BusinessError} 17000002 if the async function was not called with await. + * @throws {BusinessError} 17000006 if there is a system internal error. * @since 9 * @test */ - setDisplayRotation(rotation: DisplayRotation):Promise; + setDisplayRotation(rotation: DisplayRotation): Promise; /** * Get the rotation of the device display. * @syscap SystemCapability.Test.UiTest * @returns the current display rotation. + * @throws {BusinessError} 17000002 if the async function was not called with await. + * @throws {BusinessError} 17000006 if there is a system internal error. * @since 9 * @test */ - getDisplayRotation():Promise; + getDisplayRotation(): Promise; /** * Enable/disable the rotation of device display. * @syscap SystemCapability.Test.UiTest * @param enabled enable the rotation or not. + * @throws {BusinessError} 401 if the input parameters are invalid. + * @throws {BusinessError} 17000002 if the async function was not called with await. + * @throws {BusinessError} 17000006 if there is a system internal error. * @since 9 * @test */ - setDisplayRotationEnabled(enabled:boolean):Promise; + setDisplayRotationEnabled(enabled: boolean): Promise; /** * Get the size of the device display. * @syscap SystemCapability.Test.UiTest * @returns the size of the device display. + * @throws {BusinessError} 17000002 if the async function was not called with await. + * @throws {BusinessError} 17000006 if there is a system internal error. * @since 9 * @test */ - getDisplaySize():Promise; + getDisplaySize(): Promise; /** * Get the density of the device display. * @syscap SystemCapability.Test.UiTest * @returns the density of the device display. + * @throws {BusinessError} 17000002 if the async function was not called with await. + * @throws {BusinessError} 17000006 if there is a system internal error. * @since 9 * @test */ - getDisplayDensity():Promise; + getDisplayDensity(): Promise; /** * Wake up the device display. * @syscap SystemCapability.Test.UiTest + * @throws {BusinessError} 17000002 if the async function was not called with await. + * @throws {BusinessError} 17000006 if there is a system internal error. * @since 9 * @test */ - wakeUpDisplay():Promise; + wakeUpDisplay(): Promise; /** * Press the home key. * @syscap SystemCapability.Test.UiTest + * @throws {BusinessError} 17000002 if the async function was not called with await. + * @throws {BusinessError} 17000006 if there is a system internal error. * @since 9 * @test */ - pressHome():Promise; + pressHome(): Promise; /** * Wait for the UI become idle. @@ -756,10 +1274,13 @@ declare class UiComponent{ * @param idleTime the threshold of UI idle time, in millisecond. * @param timeout the maximum time to wait for idle, in millisecond. * @returns true if wait for idle succeed in the timeout, false otherwise. + * @throws {BusinessError} 401 if the input parameters are invalid. + * @throws {BusinessError} 17000002 if the async function was not called with await. + * @throws {BusinessError} 17000006 if there is a system internal error. * @since 9 * @test */ - waitForIdle(idleTime: number, timeout: number):Promise; + waitForIdle(idleTime: number, timeout: number): Promise; /** * Inject fling on the device display. @@ -767,157 +1288,210 @@ declare class UiComponent{ * @param from the coordinate point where the finger touches the screen. * @param to the coordinate point where the finger leaves the screen. * @param stepLen the length of each step, in pixels. - * @param speed the speed of fling (pixels per second),default is 600,the value ranges from 200 to 3000,set it 600 if out of range. + * @param speed the speed of fling (pixels per second),default is 600,the value ranges from 200 to 15000,set it 600 if out of range. + * @throws {BusinessError} 401 if the input parameters are invalid. + * @throws {BusinessError} 17000002 if the async function was not called with await. + * @throws {BusinessError} 17000006 if there is a system internal error. * @since 9 * @test */ - fling(from: Point, to: Point, stepLen: number, speed: number):Promise; + fling(from: Point, to: Point, stepLen: number, speed: number): Promise; /** * Inject multi-pointer action on the device display. * @syscap SystemCapability.Test.UiTest * @param pointers the two-dimensional array of pointers to inject. - * @param speed the speed of swipe (pixels per second),default is 600,the value ranges from 200 to 3000,set it 600 if out of range. + * @param speed the speed of swipe (pixels per second),default is 600,the value ranges from 200 to 15000,set it 600 if out of range. + * @returns true if the operation finished, false + * @throws {BusinessError} 401 if the input parameters are invalid. + * @throws {BusinessError} 17000002 if the async function was not called with await. + * @throws {BusinessError} 17000006 if there is a system internal error. * @since 9 * @test */ - injectMultiPointerAction(pointers: PointerMatrix, speed?: number):Promise; + injectMultiPointerAction(pointers: PointerMatrix, speed?: number): Promise; } /** - * - * * @since 9 * @test * @syscap SystemCapability.Test.UiTest */ - declare class UiWindow{ +declare class UiWindow { /** * Get the bundle name of this {@link UiWindow}. * @syscap SystemCapability.Test.UiTest * @returns the bundle name. + * @throws {BusinessError} 17000002 if the async function was not called with await. + * @throws {BusinessError} 17000004 if the window is invisible or destroyed. + * @throws {BusinessError} 17000006 if there is a system internal error. * @since 9 * @test */ - getBundleName():Promise; + getBundleName(): Promise; /** * Get the bounds rect of this {@link UiWindow}. * @syscap SystemCapability.Test.UiTest * @return the bounds rect object. + * @throws {BusinessError} 17000002 if the async function was not called with await. + * @throws {BusinessError} 17000004 if the window is invisible or destroyed. + * @throws {BusinessError} 17000006 if there is a system internal error. * @since 9 * @test */ - getBounds():Promise; - + getBounds(): Promise; + /** * Get the title of this {@link UiWindow}. * @syscap SystemCapability.Test.UiTest * @returns the title value. + * @throws {BusinessError} 17000002 if the async function was not called with await. + * @throws {BusinessError} 17000004 if the window is invisible or destroyed. + * @throws {BusinessError} 17000006 if there is a system internal error. * @since 9 * @test */ - getTitle():Promise; - + getTitle(): Promise; + /** - * Get the windoe mode of this {@link UiWindow}. + * Get the window mode of this {@link UiWindow}. * @syscap SystemCapability.Test.UiTest - * @returns the {@link WindowMode} object. + * @returns the {@link WindowMode} object + * @throws {BusinessError} 17000002 if the async function was not called with await. + * @throws {BusinessError} 17000004 if the window is invisible or destroyed. + * @throws {BusinessError} 17000006 if there is a system internal error. * @since 9 * @test */ - getWindowMode():Promise; + getWindowMode(): Promise; /** * Get the focused status of this {@link UiWindow}. * @syscap SystemCapability.Test.UiTest * @returns the focused status + * @throws {BusinessError} 17000002 if the async function was not called with await. + * @throws {BusinessError} 17000004 if the window is invisible or destroyed. + * @throws {BusinessError} 17000006 if there is a system internal error. * @since 9 * @test */ - isFocused():Promise; + isFocused(): Promise; /** - * Get the actived status of this {@link UiWindow}. + * Get the active status of this {@link UiWindow}. * @syscap SystemCapability.Test.UiTest * @returns the actived status + * @throws {BusinessError} 17000002 if the async function was not called with await. + * @throws {BusinessError} 17000004 if the window is invisible or destroyed. + * @throws {BusinessError} 17000006 if there is a system internal error. * @since 9 * @test */ - isActived():Promise; + isActived(): Promise; /** * Set the focused status of this {@link UiWindow}. * @syscap SystemCapability.Test.UiTest - * @returns the result of focus action + * @throws {BusinessError} 17000002 if the async function was not called with await. + * @throws {BusinessError} 17000004 if the window is invisible or destroyed. + * @throws {BusinessError} 17000006 if there is a system internal error. * @since 9 * @test */ - focus():Promise; + focus(): Promise; /** * Move this {@link UiWindow} to the specified points. * @syscap SystemCapability.Test.UiTest - * @returns the result of move action + * @param x the x coordinate of destination. + * @param y the y coordinate of destination. + * @throws {BusinessError} 401 if the input parameters are invalid. + * @throws {BusinessError} 17000002 if the async function was not called with await. + * @throws {BusinessError} 17000004 if the window is invisible or destroyed. + * @throws {BusinessError} 17000005 if the action is not supported on this window. + * @throws {BusinessError} 17000006 if there is a system internal error. * @since 9 * @test */ - moveTo(x: number, y: number):Promise; + moveTo(x: number, y: number): Promise; /** * Resize this {@link UiWindow} to the specified size for the specified direction. * @syscap SystemCapability.Test.UiTest - * @returns the result of resize action + * @param wide the expected wide of the window after resizing. + * @param height the expected height of the window after resizing. + * @param direction the expected direction of the window after resizing. + * @throws {BusinessError} 401 if the input parameters are invalid. + * @throws {BusinessError} 17000002 if the async function was not called with await. + * @throws {BusinessError} 17000004 if the window is invisible or destroyed. + * @throws {BusinessError} 17000005 if the action is not supported on this window. + * @throws {BusinessError} 17000006 if there is a system internal error. * @since 9 * @test */ - resize(wide: number, height: number, direction: ResizeDirection):Promise; + resize(wide: number, height: number, direction: ResizeDirection): Promise; /** * Change this {@link UiWindow} into split screen mode. * @syscap SystemCapability.Test.UiTest - * @returns the result of split action + * @throws {BusinessError} 17000002 if the async function was not called with await. + * @throws {BusinessError} 17000004 if the window is invisible or destroyed. + * @throws {BusinessError} 17000005 if the action is not supported on this window. + * @throws {BusinessError} 17000006 if there is a system internal error. * @since 9 * @test */ - split():Promise; + split(): Promise; /** * Maximize this {@link UiWindow}. * @syscap SystemCapability.Test.UiTest - * @returns the result of maximize action + * @throws {BusinessError} 17000002 if the async function was not called with await. + * @throws {BusinessError} 17000004 if the window is invisible or destroyed. + * @throws {BusinessError} 17000005 if the action is not supported on this window. + * @throws {BusinessError} 17000006 if there is a system internal error. * @since 9 * @test */ - maximize():Promise; + maximize(): Promise; /** * Minimize this {@link UiWindow}. * @syscap SystemCapability.Test.UiTest - * @returns the result of minimize action + * @throws {BusinessError} 17000002 if the async function was not called with await. + * @throws {BusinessError} 17000004 if the window is invisible or destroyed. + * @throws {BusinessError} 17000005 if the action is not supported on this window. + * @throws {BusinessError} 17000006 if there is a system internal error. * @since 9 * @test */ - minimize():Promise; + minimize(): Promise; /** * Resume this {@link UiWindow}. * @syscap SystemCapability.Test.UiTest - * @returns the result of resume action + * @throws {BusinessError} 17000002 if the async function was not called with await. + * @throws {BusinessError} 17000004 if the window is invisible or destroyed. + * @throws {BusinessError} 17000005 if the action is not supported on this window. + * @throws {BusinessError} 17000006 if there is a system internal error. * @since 9 * @test */ - resume():Promise; + resume(): Promise; /** * Close this {@link UiWindow}. * @syscap SystemCapability.Test.UiTest - * @returns the result of close action + * @throws {BusinessError} 17000002 if the async function was not called with await. + * @throws {BusinessError} 17000004 if the window is invisible or destroyed. + * @throws {BusinessError} 17000005 if the action is not supported on this window. + * @throws {BusinessError} 17000006 if there is a system internal error. * @since 9 * @test */ - close():Promise; - } + close(): Promise; +} /** * Represents a two-dimensional array of pointers on the device display, it's used to build a @@ -928,35 +1502,47 @@ declare class UiComponent{ * @syscap SystemCapability.Test.UiTest */ declare class PointerMatrix { - /** + /** * Create an {@link PointerMatrix} object. * @syscap SystemCapability.Test.UiTest * @param fingers the number of fingers. * @param steps the number of steps of each finger trace. * @returns the {@link PointerMatrix} object. + * @throws {BusinessError} 401 if the input parameters are invalid. + * @throws {BusinessError} 17000006 if there is a system internal error. * @since 9 * @test */ - static create(fingers: number, steps: number):PointerMatrix; + static create(fingers: number, steps: number): PointerMatrix; - /** - * Set the point value of an element in the PointerMatrix. - * @syscap SystemCapability.Test.UiTest - * @param finger the index of target finger to set. - * @param step the index of target step to set. - * @param point the coordinate of target step to set. - * @since 9 - * @test - */ - setPoint(finger: number, step: number, point: Point):void; + /** + * Set the point value of an element in the PointerMatrix. + * @syscap SystemCapability.Test.UiTest + * @param finger the index of target finger to set. + * @param step the index of target step to set. + * @param point the coordinate of target step to set. + * @throws {BusinessError} 401 if the input parameters are invalid. + * @throws {BusinessError} 17000006 if there is a system internal error. + * @since 9 + * @test + */ + setPoint(finger: number, step: number, point: Point): void; } /** * The static builder for building {@link By}object conveniently,usage example:BY.text('txt').enabled(true). * @syscap SystemCapability.Test.UiTest * @since 8 + * @deprecated since 9 + * @test + */ +declare const BY: By; +/** + * The static builder for building {@link On}object conveniently,usage example:ON.text('txt').enabled(true). + * @syscap SystemCapability.Test.UiTest + * @since 9 * @test */ - declare const BY:By; +declare const ON: On; - export {UiComponent,UiDriver,UiWindow,BY,MatchPattern,DisplayRotation,ResizeDirection,WindowMode,PointerMatrix}; +export {UiComponent, UiDriver, Component, Driver, UiWindow, ON, BY, MatchPattern, DisplayRotation, ResizeDirection, WindowMode, PointerMatrix}; -- Gitee From 68d4ff3d67a4fd0c12cd1f6be91e2a359913d30a Mon Sep 17 00:00:00 2001 From: jianqirui Date: Mon, 10 Oct 2022 13:11:00 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E7=A7=BB=E9=99=A4jsdoc=E4=B8=AD=E7=9A=84?= =?UTF-8?q?=E5=86=85=E9=83=A8=E9=94=99=E8=AF=AF=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: jianqirui --- api/@ohos.uitest.d.ts | 81 ++----------------------------------------- 1 file changed, 2 insertions(+), 79 deletions(-) diff --git a/api/@ohos.uitest.d.ts b/api/@ohos.uitest.d.ts index 7d0eb03a93..97fc90e569 100644 --- a/api/@ohos.uitest.d.ts +++ b/api/@ohos.uitest.d.ts @@ -521,7 +521,6 @@ declare class On { * @param pattern the {@link MatchPattern} of the text value, default to {@link MatchPattern.EQUALS} * @return Returns this {@link On} object. * @throws {BusinessError} 401 if the input parameters are invalid. - * @throws {BusinessError} 17000006 if there is a system internal error. * @since 9 * @test */ @@ -533,7 +532,6 @@ declare class On { * @param id the id value. * @return Returns this {@link On} object. * @throws {BusinessError} 401 if the input parameters are invalid. - * @throws {BusinessError} 17000006 if there is a system internal error. * @since 9 * @test */ @@ -545,7 +543,6 @@ declare class On { * @param tp the type value. * @return Returns this {@link On} object. * @throws {BusinessError} 401 if the input parameters are invalid. - * @throws {BusinessError} 17000006 if there is a system internal error. * @since 9 * @test */ @@ -557,7 +554,6 @@ declare class On { * @param b the clickable status,default to true. * @return Returns this {@link On} object. * @throws {BusinessError} 401 if the input parameters are invalid. - * @throws {BusinessError} 17000006 if there is a system internal error. * @since 9 * @test */ @@ -569,7 +565,6 @@ declare class On { * @param b the clickable status,default to true. * @return Returns this {@link On} object. * @throws {BusinessError} 401 if the input parameters are invalid. - * @throws {BusinessError} 17000006 if there is a system internal error. * @since 9 * @test */ @@ -581,7 +576,6 @@ declare class On { * @param b the scrollable status,default to true. * @return Returns this {@link On} object. * @throws {BusinessError} 401 if the input parameters are invalid. - * @throws {BusinessError} 17000006 if there is a system internal error. * @since 9 * @test */ @@ -593,7 +587,6 @@ declare class On { * @param b the enabled status,default to true. * @return Returns this {@link On} object. * @throws {BusinessError} 401 if the input parameters are invalid. - * @throws {BusinessError} 17000006 if there is a system internal error. * @since 9 * @test */ @@ -605,7 +598,6 @@ declare class On { * @param b the focused status,default to true. * @return Returns this {@link On} object. * @throws {BusinessError} 401 if the input parameters are invalid. - * @throws {BusinessError} 17000006 if there is a system internal error. * @since 9 * @test */ @@ -617,7 +609,6 @@ declare class On { * @param b the selected status,default to true. * @return Returns this {@link On} object. * @throws {BusinessError} 401 if the input parameters are invalid. - * @throws {BusinessError} 17000006 if there is a system internal error. * @since 9 * @test */ @@ -629,7 +620,6 @@ declare class On { * @param b the checked status,default to false. * @return Returns this {@link On} object. * @throws {BusinessError} 401 if the input parameters are invalid. - * @throws {BusinessError} 17000006 if there is a system internal error. * @since 9 * @test */ @@ -641,7 +631,6 @@ declare class On { * @param b the checkable status,default to false. * @return Returns this {@link On} object. * @throws {BusinessError} 401 if the input parameters are invalid. - * @throws {BusinessError} 17000006 if there is a system internal error. * @since 9 * @test */ @@ -654,7 +643,6 @@ declare class On { * @param on describes the attribute requirements of Component which the target one is in front of. * @return Returns this {@link On} object. * @throws {BusinessError} 401 if the input parameters are invalid. - * @throws {BusinessError} 17000006 if there is a system internal error. * @since 9 * @test */ @@ -667,7 +655,6 @@ declare class On { * @param on describes the attribute requirements of Component which the target one is in back of. * @return Returns this {@link On} object. * @throws {BusinessError} 401 if the input parameters are invalid. - * @throws {BusinessError} 17000006 if there is a system internal error. * @since 9 * @test */ @@ -688,7 +675,6 @@ declare class Component { * @since 9 * @throws {BusinessError} 17000002 if the async function was not called with await. * @throws {BusinessError} 17000004 if the component is invisible or destroyed. - * @throws {BusinessError} 17000006 if there is a system internal error. * @test */ click(): Promise; @@ -699,7 +685,6 @@ declare class Component { * @since 9 * @throws {BusinessError} 17000002 if the async function was not called with await. * @throws {BusinessError} 17000004 if the component is invisible or destroyed. - * @throws {BusinessError} 17000006 if there is a system internal error. * @test */ doubleClick(): Promise; @@ -710,7 +695,6 @@ declare class Component { * @since 9 * @throws {BusinessError} 17000002 if the async function was not called with await. * @throws {BusinessError} 17000004 if the component is invisible or destroyed. - * @throws {BusinessError} 17000006 if there is a system internal error. * @test */ longClick(): Promise; @@ -721,7 +705,6 @@ declare class Component { * @returns the id value. * @throws {BusinessError} 17000002 if the async function was not called with await. * @throws {BusinessError} 17000004 if the component is invisible or destroyed. - * @throws {BusinessError} 17000006 if there is a system internal error. * @since 9 * @test */ @@ -732,7 +715,6 @@ declare class Component { * @syscap SystemCapability.Test.UiTest * @throws {BusinessError} 17000002 if the async function was not called with await. * @throws {BusinessError} 17000004 if the component is invisible or destroyed. - * @throws {BusinessError} 17000006 if there is a system internal error. * @since 9 * @test */ @@ -744,7 +726,6 @@ declare class Component { * @returns the type name. * @throws {BusinessError} 17000002 if the async function was not called with await. * @throws {BusinessError} 17000004 if the component is invisible or destroyed. - * @throws {BusinessError} 17000006 if there is a system internal error. * @since 9 * @test */ @@ -756,7 +737,6 @@ declare class Component { * @returns the clickable status. * @throws {BusinessError} 17000002 if the async function was not called with await. * @throws {BusinessError} 17000004 if the component is invisible or destroyed. - * @throws {BusinessError} 17000006 if there is a system internal error. * @since 9 * @test */ @@ -768,7 +748,6 @@ declare class Component { * @returns the longClickable status. * @throws {BusinessError} 17000002 if the async function was not called with await. * @throws {BusinessError} 17000004 if the component is invisible or destroyed. - * @throws {BusinessError} 17000006 if there is a system internal error. * @since 9 * @test */ @@ -780,7 +759,6 @@ declare class Component { * @returns the scrollable status. * @throws {BusinessError} 17000002 if the async function was not called with await. * @throws {BusinessError} 17000004 if the component is invisible or destroyed. - * @throws {BusinessError} 17000006 if there is a system internal error. * @since 9 * @test */ @@ -792,7 +770,6 @@ declare class Component { * @returns the enabled status. * @throws {BusinessError} 17000002 if the async function was not called with await. * @throws {BusinessError} 17000004 if the component is invisible or destroyed. - * @throws {BusinessError} 17000006 if there is a system internal error. * @since 9 * @test */ @@ -804,7 +781,6 @@ declare class Component { * @returns the focused status. * @throws {BusinessError} 17000002 if the async function was not called with await. * @throws {BusinessError} 17000004 if the component is invisible or destroyed. - * @throws {BusinessError} 17000006 if there is a system internal error. * @since 9 * @test */ @@ -816,7 +792,6 @@ declare class Component { * @returns the selected status. * @throws {BusinessError} 17000002 if the async function was not called with await. * @throws {BusinessError} 17000004 if the component is invisible or destroyed. - * @throws {BusinessError} 17000006 if there is a system internal error. * @since 9 * @test */ @@ -828,7 +803,6 @@ declare class Component { * @returns the checked status. * @throws {BusinessError} 17000002 if the async function was not called with await. * @throws {BusinessError} 17000004 if the component is invisible or destroyed. - * @throws {BusinessError} 17000006 if there is a system internal error. * @since 9 * @test */ @@ -840,7 +814,6 @@ declare class Component { * @returns the checkable status. * @throws {BusinessError} 17000002 if the async function was not called with await. * @throws {BusinessError} 17000004 if the component is invisible or destroyed. - * @throws {BusinessError} 17000006 if there is a system internal error. * @since 9 * @test */ @@ -853,7 +826,6 @@ declare class Component { * @throws {BusinessError} 401 if the input parameters are invalid. * @throws {BusinessError} 17000002 if the async function was not called with await. * @throws {BusinessError} 17000004 if the component is invisible or destroyed. - * @throws {BusinessError} 17000006 if there is a system internal error. * @since 9 * @test */ @@ -864,7 +836,6 @@ declare class Component { * @syscap SystemCapability.Test.UiTest * @throws {BusinessError} 17000002 if the async function was not called with await. * @throws {BusinessError} 17000004 if the component is invisible or destroyed. - * @throws {BusinessError} 17000006 if there is a system internal error. * @since 9 * @test */ @@ -877,7 +848,6 @@ declare class Component { * @throws {BusinessError} 401 if the input parameters are invalid. * @throws {BusinessError} 17000002 if the async function was not called with await. * @throws {BusinessError} 17000004 if the component is invisible or destroyed. - * @throws {BusinessError} 17000006 if there is a system internal error. * @since 9 * @test */ @@ -890,7 +860,6 @@ declare class Component { * @throws {BusinessError} 401 if the input parameters are invalid. * @throws {BusinessError} 17000002 if the async function was not called with await. * @throws {BusinessError} 17000004 if the component is invisible or destroyed. - * @throws {BusinessError} 17000006 if there is a system internal error. * @since 9 * @test */ @@ -904,7 +873,6 @@ declare class Component { * @throws {BusinessError} 401 if the input parameters are invalid. * @throws {BusinessError} 17000002 if the async function was not called with await. * @throws {BusinessError} 17000004 if the component is invisible or destroyed. - * @throws {BusinessError} 17000006 if there is a system internal error. * @since 9 * @test */ @@ -916,7 +884,6 @@ declare class Component { * @return the bounds rect object. * @throws {BusinessError} 17000002 if the async function was not called with await. * @throws {BusinessError} 17000004 if the component is invisible or destroyed. - * @throws {BusinessError} 17000006 if there is a system internal error. * @since 9 * @test */ @@ -928,7 +895,6 @@ declare class Component { * @return the boundsCenter object. * @throws {BusinessError} 17000002 if the async function was not called with await. * @throws {BusinessError} 17000004 if the component is invisible or destroyed. - * @throws {BusinessError} 17000006 if there is a system internal error. * @since 9 * @test */ @@ -941,7 +907,6 @@ declare class Component { * @throws {BusinessError} 401 if the input parameters are invalid. * @throws {BusinessError} 17000002 if the async function was not called with await. * @throws {BusinessError} 17000004 if the component is invisible or destroyed. - * @throws {BusinessError} 17000006 if there is a system internal error. * @since 9 * @test */ @@ -954,7 +919,6 @@ declare class Component { * @throws {BusinessError} 401 if the input parameters are invalid. * @throws {BusinessError} 17000002 if the async function was not called with await. * @throws {BusinessError} 17000004 if the component is invisible or destroyed. - * @throws {BusinessError} 17000006 if there is a system internal error. * @since 9 * @test */ @@ -967,7 +931,6 @@ declare class Component { * @throws {BusinessError} 401 if the input parameters are invalid. * @throws {BusinessError} 17000002 if the async function was not called with await. * @throws {BusinessError} 17000004 if the component is invisible or destroyed. - * @throws {BusinessError} 17000006 if there is a system internal error. * @since 9 * @test */ @@ -988,7 +951,6 @@ declare class Driver { * @syscap SystemCapability.Test.UiTest * @returns the {@link Driver} object. * @throws {BusinessError} 17000001 if the test framework failed to initialize. - * @throws {BusinessError} 17000006 if there is a system internal error. * @since 9 * @test */ @@ -1000,7 +962,6 @@ declare class Driver { * @param duration the delay duration in milliseconds. * @throws {BusinessError} 401 if the input parameters are invalid. * @throws {BusinessError} 17000002 if the async function was not called with await. - * @throws {BusinessError} 17000006 if there is a system internal error. * @since 9 * @test */ @@ -1013,7 +974,6 @@ declare class Driver { * @returns the first matched {@link Component} or undefined. * @throws {BusinessError} 401 if the input parameters are invalid. * @throws {BusinessError} 17000002 if the async function was not called with await. - * @throws {BusinessError} 17000006 if there is a system internal error. * @since 9 * @test */ @@ -1026,7 +986,6 @@ declare class Driver { * @returns the first matched {@link UiWindow} or undefined. * @throws {BusinessError} 401 if the input parameters are invalid. * @throws {BusinessError} 17000002 if the async function was not called with await. - * @throws {BusinessError} 17000006 if there is a system internal error. * @since 9 * @test */ @@ -1040,7 +999,6 @@ declare class Driver { * @returns the first matched {@link Component} or undefined. * @throws {BusinessError} 401 if the input parameters are invalid. * @throws {BusinessError} 17000002 if the async function was not called with await. - * @throws {BusinessError} 17000006 if there is a system internal error. * @since 9 * @test */ @@ -1053,7 +1011,6 @@ declare class Driver { * @returns the matched {@link Component}s list. * @throws {BusinessError} 401 if the input parameters are invalid. * @throws {BusinessError} 17000002 if the async function was not called with await. - * @throws {BusinessError} 17000006 if there is a system internal error. * @since 9 * @test */ @@ -1065,7 +1022,7 @@ declare class Driver { * @param on the attribute requirements of the target {@link Component}. * @throws {BusinessError} 401 if the input parameters are invalid. * @throws {BusinessError} 17000002 if the async function was not called with await. - * @throws {BusinessError} 17000006 if there is a system internal error. + * @throws {BusinessError} 17000003 if the assertion failed. * @since 9 * @test */ @@ -1075,7 +1032,6 @@ declare class Driver { * Press the BACK key. * @syscap SystemCapability.Test.UiTest * @throws {BusinessError} 17000002 if the async function was not called with await. - * @throws {BusinessError} 17000006 if there is a system internal error. * @since 9 * @test */ @@ -1087,7 +1043,6 @@ declare class Driver { * @param keyCode the target keyCode. * @throws {BusinessError} 401 if the input parameters are invalid. * @throws {BusinessError} 17000002 if the async function was not called with await. - * @throws {BusinessError} 17000006 if there is a system internal error. * @since 9 * @test */ @@ -1101,7 +1056,6 @@ declare class Driver { * @param key2 the third keyCode. * @throws {BusinessError} 401 if the input parameters are invalid. * @throws {BusinessError} 17000002 if the async function was not called with await. - * @throws {BusinessError} 17000006 if there is a system internal error. * @since 9 * @test */ @@ -1114,7 +1068,6 @@ declare class Driver { * @param y the y-coordinate. * @throws {BusinessError} 401 if the input parameters are invalid. * @throws {BusinessError} 17000002 if the async function was not called with await. - * @throws {BusinessError} 17000006 if there is a system internal error. * @since 9 * @test */ @@ -1127,7 +1080,6 @@ declare class Driver { * @param y the y-coordinate. * @throws {BusinessError} 401 if the input parameters are invalid. * @throws {BusinessError} 17000002 if the async function was not called with await. - * @throws {BusinessError} 17000006 if there is a system internal error. * @since 9 * @test */ @@ -1140,7 +1092,6 @@ declare class Driver { * @param y the y-coordinate. * @throws {BusinessError} 401 if the input parameters are invalid. * @throws {BusinessError} 17000002 if the async function was not called with await. - * @throws {BusinessError} 17000006 if there is a system internal error. * @since 9 * @test */ @@ -1156,7 +1107,6 @@ declare class Driver { * @param speed the speed of swipe (pixels per second),default is 600,the value ranges from 200 to 15000,set it 600 if out of range. * @throws {BusinessError} 401 if the input parameters are invalid. * @throws {BusinessError} 17000002 if the async function was not called with await. - * @throws {BusinessError} 17000006 if there is a system internal error. * @since 9 * @test */ @@ -1172,7 +1122,6 @@ declare class Driver { * @param speed the speed of swipe (pixels per second),default is 600,the value ranges from 200 to 15000,set it 600 if out of range. * @throws {BusinessError} 401 if the input parameters are invalid. * @throws {BusinessError} 17000002 if the async function was not called with await. - * @throws {BusinessError} 17000006 if there is a system internal error. * @since 9 * @test */ @@ -1185,7 +1134,6 @@ declare class Driver { * @returns true if screen-capturing and file-storing are completed successfully,false otherwise. * @throws {BusinessError} 401 if the input parameters are invalid. * @throws {BusinessError} 17000002 if the async function was not called with await. - * @throws {BusinessError} 17000006 if there is a system internal error. * @since 9 * @test */ @@ -1197,7 +1145,6 @@ declare class Driver { * @param rotation the target rotation to set. * @throws {BusinessError} 401 if the input parameters are invalid. * @throws {BusinessError} 17000002 if the async function was not called with await. - * @throws {BusinessError} 17000006 if there is a system internal error. * @since 9 * @test */ @@ -1208,7 +1155,6 @@ declare class Driver { * @syscap SystemCapability.Test.UiTest * @returns the current display rotation. * @throws {BusinessError} 17000002 if the async function was not called with await. - * @throws {BusinessError} 17000006 if there is a system internal error. * @since 9 * @test */ @@ -1220,7 +1166,6 @@ declare class Driver { * @param enabled enable the rotation or not. * @throws {BusinessError} 401 if the input parameters are invalid. * @throws {BusinessError} 17000002 if the async function was not called with await. - * @throws {BusinessError} 17000006 if there is a system internal error. * @since 9 * @test */ @@ -1231,7 +1176,6 @@ declare class Driver { * @syscap SystemCapability.Test.UiTest * @returns the size of the device display. * @throws {BusinessError} 17000002 if the async function was not called with await. - * @throws {BusinessError} 17000006 if there is a system internal error. * @since 9 * @test */ @@ -1242,7 +1186,6 @@ declare class Driver { * @syscap SystemCapability.Test.UiTest * @returns the density of the device display. * @throws {BusinessError} 17000002 if the async function was not called with await. - * @throws {BusinessError} 17000006 if there is a system internal error. * @since 9 * @test */ @@ -1252,7 +1195,6 @@ declare class Driver { * Wake up the device display. * @syscap SystemCapability.Test.UiTest * @throws {BusinessError} 17000002 if the async function was not called with await. - * @throws {BusinessError} 17000006 if there is a system internal error. * @since 9 * @test */ @@ -1262,7 +1204,6 @@ declare class Driver { * Press the home key. * @syscap SystemCapability.Test.UiTest * @throws {BusinessError} 17000002 if the async function was not called with await. - * @throws {BusinessError} 17000006 if there is a system internal error. * @since 9 * @test */ @@ -1276,7 +1217,6 @@ declare class Driver { * @returns true if wait for idle succeed in the timeout, false otherwise. * @throws {BusinessError} 401 if the input parameters are invalid. * @throws {BusinessError} 17000002 if the async function was not called with await. - * @throws {BusinessError} 17000006 if there is a system internal error. * @since 9 * @test */ @@ -1291,7 +1231,6 @@ declare class Driver { * @param speed the speed of fling (pixels per second),default is 600,the value ranges from 200 to 15000,set it 600 if out of range. * @throws {BusinessError} 401 if the input parameters are invalid. * @throws {BusinessError} 17000002 if the async function was not called with await. - * @throws {BusinessError} 17000006 if there is a system internal error. * @since 9 * @test */ @@ -1305,7 +1244,6 @@ declare class Driver { * @returns true if the operation finished, false * @throws {BusinessError} 401 if the input parameters are invalid. * @throws {BusinessError} 17000002 if the async function was not called with await. - * @throws {BusinessError} 17000006 if there is a system internal error. * @since 9 * @test */ @@ -1324,7 +1262,6 @@ declare class UiWindow { * @returns the bundle name. * @throws {BusinessError} 17000002 if the async function was not called with await. * @throws {BusinessError} 17000004 if the window is invisible or destroyed. - * @throws {BusinessError} 17000006 if there is a system internal error. * @since 9 * @test */ @@ -1336,7 +1273,6 @@ declare class UiWindow { * @return the bounds rect object. * @throws {BusinessError} 17000002 if the async function was not called with await. * @throws {BusinessError} 17000004 if the window is invisible or destroyed. - * @throws {BusinessError} 17000006 if there is a system internal error. * @since 9 * @test */ @@ -1348,7 +1284,6 @@ declare class UiWindow { * @returns the title value. * @throws {BusinessError} 17000002 if the async function was not called with await. * @throws {BusinessError} 17000004 if the window is invisible or destroyed. - * @throws {BusinessError} 17000006 if there is a system internal error. * @since 9 * @test */ @@ -1360,7 +1295,6 @@ declare class UiWindow { * @returns the {@link WindowMode} object * @throws {BusinessError} 17000002 if the async function was not called with await. * @throws {BusinessError} 17000004 if the window is invisible or destroyed. - * @throws {BusinessError} 17000006 if there is a system internal error. * @since 9 * @test */ @@ -1372,7 +1306,6 @@ declare class UiWindow { * @returns the focused status * @throws {BusinessError} 17000002 if the async function was not called with await. * @throws {BusinessError} 17000004 if the window is invisible or destroyed. - * @throws {BusinessError} 17000006 if there is a system internal error. * @since 9 * @test */ @@ -1384,7 +1317,6 @@ declare class UiWindow { * @returns the actived status * @throws {BusinessError} 17000002 if the async function was not called with await. * @throws {BusinessError} 17000004 if the window is invisible or destroyed. - * @throws {BusinessError} 17000006 if there is a system internal error. * @since 9 * @test */ @@ -1395,7 +1327,6 @@ declare class UiWindow { * @syscap SystemCapability.Test.UiTest * @throws {BusinessError} 17000002 if the async function was not called with await. * @throws {BusinessError} 17000004 if the window is invisible or destroyed. - * @throws {BusinessError} 17000006 if there is a system internal error. * @since 9 * @test */ @@ -1410,7 +1341,6 @@ declare class UiWindow { * @throws {BusinessError} 17000002 if the async function was not called with await. * @throws {BusinessError} 17000004 if the window is invisible or destroyed. * @throws {BusinessError} 17000005 if the action is not supported on this window. - * @throws {BusinessError} 17000006 if there is a system internal error. * @since 9 * @test */ @@ -1426,7 +1356,6 @@ declare class UiWindow { * @throws {BusinessError} 17000002 if the async function was not called with await. * @throws {BusinessError} 17000004 if the window is invisible or destroyed. * @throws {BusinessError} 17000005 if the action is not supported on this window. - * @throws {BusinessError} 17000006 if there is a system internal error. * @since 9 * @test */ @@ -1438,7 +1367,6 @@ declare class UiWindow { * @throws {BusinessError} 17000002 if the async function was not called with await. * @throws {BusinessError} 17000004 if the window is invisible or destroyed. * @throws {BusinessError} 17000005 if the action is not supported on this window. - * @throws {BusinessError} 17000006 if there is a system internal error. * @since 9 * @test */ @@ -1450,7 +1378,6 @@ declare class UiWindow { * @throws {BusinessError} 17000002 if the async function was not called with await. * @throws {BusinessError} 17000004 if the window is invisible or destroyed. * @throws {BusinessError} 17000005 if the action is not supported on this window. - * @throws {BusinessError} 17000006 if there is a system internal error. * @since 9 * @test */ @@ -1462,7 +1389,6 @@ declare class UiWindow { * @throws {BusinessError} 17000002 if the async function was not called with await. * @throws {BusinessError} 17000004 if the window is invisible or destroyed. * @throws {BusinessError} 17000005 if the action is not supported on this window. - * @throws {BusinessError} 17000006 if there is a system internal error. * @since 9 * @test */ @@ -1474,7 +1400,6 @@ declare class UiWindow { * @throws {BusinessError} 17000002 if the async function was not called with await. * @throws {BusinessError} 17000004 if the window is invisible or destroyed. * @throws {BusinessError} 17000005 if the action is not supported on this window. - * @throws {BusinessError} 17000006 if there is a system internal error. * @since 9 * @test */ @@ -1486,7 +1411,6 @@ declare class UiWindow { * @throws {BusinessError} 17000002 if the async function was not called with await. * @throws {BusinessError} 17000004 if the window is invisible or destroyed. * @throws {BusinessError} 17000005 if the action is not supported on this window. - * @throws {BusinessError} 17000006 if there is a system internal error. * @since 9 * @test */ @@ -1509,7 +1433,6 @@ declare class PointerMatrix { * @param steps the number of steps of each finger trace. * @returns the {@link PointerMatrix} object. * @throws {BusinessError} 401 if the input parameters are invalid. - * @throws {BusinessError} 17000006 if there is a system internal error. * @since 9 * @test */ @@ -1522,7 +1445,7 @@ declare class PointerMatrix { * @param step the index of target step to set. * @param point the coordinate of target step to set. * @throws {BusinessError} 401 if the input parameters are invalid. - * @throws {BusinessError} 17000006 if there is a system internal error. + * @since 9 * @test */ -- Gitee From d78483a66830aa090ef36f5865fe843bd3df733c Mon Sep 17 00:00:00 2001 From: jianqirui Date: Tue, 11 Oct 2022 21:22:18 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E5=BA=9F=E5=BC=83api=E5=8A=A0=E5=85=A5usei?= =?UTF-8?q?nstead=E6=B3=A8=E8=A7=A3&=E6=8F=8F=E8=BF=B0=E8=AF=AD=E5=8F=A5?= =?UTF-8?q?=E6=94=B9=E6=AD=A3=20Signed-off-by:=20jianqirui=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/@ohos.uitest.d.ts | 568 ++++++++++++++++++++++++------------------ 1 file changed, 322 insertions(+), 246 deletions(-) diff --git a/api/@ohos.uitest.d.ts b/api/@ohos.uitest.d.ts index 97fc90e569..f5545b8ade 100644 --- a/api/@ohos.uitest.d.ts +++ b/api/@ohos.uitest.d.ts @@ -54,26 +54,31 @@ declare enum MatchPattern { * * @since 8 * @deprecated since 9 + * @useinstead {@link On} * @syscap SystemCapability.Test.UiTest */ declare class By { /** * Specifies the text for the target UiComponent. * @syscap SystemCapability.Test.UiTest - * @param txt the text value. - * @param pattern the {@link MatchPattern} of the text value,default to {@link MatchPattern.EQUALS} + * @param txt The text value. + * @param pattern The {@link MatchPattern} of the text value,default to {@link MatchPattern.EQUALS} * @return Returns this {@link By} object. * @since 8 + * @deprecated since 9 + * @useinstead {@link On.text} * @test */ text(txt: string, pattern?: MatchPattern): By; /** - * Specifies the inspectorKey of the target UiComponent. + * Specifies the inspector key of the target UiComponent. * @syscap SystemCapability.Test.UiTest - * @param key the inspectorKey value. + * @param key The inspectorKey value. * @return Returns this {@link By} object. * @since 8 + * @deprecated since 9 + * @useinstead {@link On.id} * @test */ key(key: string): By; @@ -81,9 +86,10 @@ declare class By { /** * Specifies the id of the target UiComponent. * @syscap SystemCapability.Test.UiTest - * @param id the id value. + * @param id The id value. * @return Returns this {@link By} object. * @since 8 + * @deprecated since 9 * @test */ id(id: number): By; @@ -91,9 +97,11 @@ declare class By { /** * Specifies the type of the target UiComponent. * @syscap SystemCapability.Test.UiTest - * @param tp the type value. + * @param tp The type value. * @return Returns this {@link By} object. * @since 8 + * @deprecated since 9 + * @useinstead {@link On.type} * @test */ type(tp: string): By; @@ -101,9 +109,11 @@ declare class By { /** * Specifies the clickable status of the target UiComponent. * @syscap SystemCapability.Test.UiTest - * @param b the clickable status,default to true. + * @param b The clickable status,default to true. * @return Returns this {@link By} object. * @since 8 + * @deprecated since 9 + * @useinstead {@link On.clickable} * @test */ clickable(b?: boolean): By; @@ -111,9 +121,11 @@ declare class By { /** * Specifies the scrollable status of the target UiComponent. * @syscap SystemCapability.Test.UiTest - * @param b the scrollable status,default to true. + * @param b The scrollable status,default to true. * @return Returns this {@link By} object. * @since 8 + * @deprecated since 9 + * @useinstead {@link On.scrollable} * @test */ scrollable(b?: boolean): By; @@ -121,9 +133,11 @@ declare class By { /** * Specifies the enabled status of the target UiComponent. * @syscap SystemCapability.Test.UiTest - * @param b the enabled status,default to true. + * @param b The enabled status,default to true. * @return Returns this {@link By} object. * @since 8 + * @deprecated since 9 + * @useinstead {@link On.enabled} * @test */ enabled(b?: boolean): By; @@ -131,9 +145,11 @@ declare class By { /** * Specifies the focused status of the target UiComponent. * @syscap SystemCapability.Test.UiTest - * @param b the focused status,default to true. + * @param b The focused status,default to true. * @return Returns this {@link By} object. * @since 8 + * @deprecated since 9 + * @useinstead {@link On.focused} * @test */ focused(b?: boolean): By; @@ -141,31 +157,37 @@ declare class By { /** * Specifies the selected status of the target UiComponent. * @syscap SystemCapability.Test.UiTest - * @param b the selected status,default to true. + * @param b The selected status,default to true. * @return Returns this {@link By} object. * @since 8 + * @deprecated since 9 + * @useinstead {@link On.selected} * @test */ selected(b?: boolean): By; /** - * Requires that the target UiComponent which is before another UiComponent that specified by the given {@link By} + * Requires the target UiComponent which is before another UiComponent that specified by the given {@link By} * object,used to locate UiComponent relatively. * @syscap SystemCapability.Test.UiTest - * @param by describes the attribute requirements of UiComponent which the target one is in front of. + * @param by Describes the attribute requirements of UiComponent which the target one is in front of. * @return Returns this {@link By} object. * @since 8 + * @deprecated since 9 + * @useinstead {@link On.isBefore} * @test */ isBefore(by: By): By; /** - * Requires that the target UiComponent which is after another UiComponent that specified by the given {@link By} + * Requires the target UiComponent which is after another UiComponent that specified by the given {@link By} * object,used to locate UiComponent relatively. * @syscap SystemCapability.Test.UiTest - * @param by describes the attribute requirements of UiComponent which the target one is in back of. + * @param by Describes the attribute requirements of UiComponent which the target one is in back of. * @return Returns this {@link By} object. * @since 8 + * @deprecated since 9 + * @useinstead {@link On.isAfter} * @test */ isAfter(by: By): By; @@ -176,6 +198,7 @@ declare class By { * * @since 8 * @deprecated since 9 + * @useinstead {@link Component} * @test * @syscap SystemCapability.Test.UiTest */ @@ -184,6 +207,8 @@ declare class UiComponent { * Click this {@link UiComponent}. * @syscap SystemCapability.Test.UiTest * @since 8 + * @deprecated since 9 + * @useinstead {@link Component.click} * @test */ click(): Promise; @@ -192,6 +217,8 @@ declare class UiComponent { * Double click this {@link UiComponent}. * @syscap SystemCapability.Test.UiTest * @since 8 + * @deprecated since 9 + * @useinstead {@link Component.doubleClick} * @test */ doubleClick(): Promise; @@ -200,6 +227,8 @@ declare class UiComponent { * Long click this {@link UiComponent}. * @syscap SystemCapability.Test.UiTest * @since 8 + * @deprecated since 9 + * @useinstead {@link Component.longClick} * @test */ longClick(): Promise; @@ -209,6 +238,7 @@ declare class UiComponent { * @syscap SystemCapability.Test.UiTest * @returns the id value. * @since 8 + * @deprecated since 9 * @test */ getId(): Promise; @@ -218,6 +248,8 @@ declare class UiComponent { * @syscap SystemCapability.Test.UiTest * @returns the inspectorKey value. * @since 8 + * @deprecated since 9 + * @useinstead {@link Component.getId} * @test */ getKey(): Promise; @@ -226,6 +258,8 @@ declare class UiComponent { * Get the text attribute value. * @syscap SystemCapability.Test.UiTest * @since 8 + * @deprecated since 9 + * @useinstead {@link Component.getText} * @test */ getText(): Promise; @@ -235,6 +269,8 @@ declare class UiComponent { * @syscap SystemCapability.Test.UiTest * @returns the type name. * @since 8 + * @deprecated since 9 + * @useinstead {@link Component.getType} * @test */ getType(): Promise; @@ -244,6 +280,8 @@ declare class UiComponent { * @syscap SystemCapability.Test.UiTest * @returns the clickable status. * @since 8 + * @deprecated since 9 + * @useinstead {@link Component.isClickable} * @test */ isClickable(): Promise; @@ -253,6 +291,8 @@ declare class UiComponent { * @syscap SystemCapability.Test.UiTest * @returns the scrollable status. * @since 8 + * @deprecated since 9 + * @useinstead {@link Component.isScrollable} * @test */ isScrollable(): Promise; @@ -262,6 +302,8 @@ declare class UiComponent { * @syscap SystemCapability.Test.UiTest * @returns the enabled status. * @since 8 + * @deprecated since 9 + * @useinstead {@link Component.isEnabled} * @test */ isEnabled(): Promise; @@ -271,6 +313,8 @@ declare class UiComponent { * @syscap SystemCapability.Test.UiTest * @returns the focused status. * @since 8 + * @deprecated since 9 + * @useinstead {@link Component.isFocused} * @test */ isFocused(): Promise; @@ -280,6 +324,8 @@ declare class UiComponent { * @syscap SystemCapability.Test.UiTest * @returns the selected status. * @since 8 + * @deprecated since 9 + * @useinstead {@link Component.isSelected} * @test */ isSelected(): Promise; @@ -287,8 +333,10 @@ declare class UiComponent { /** * Inject text to this {@link UiComponent},applicable to TextInput. * @syscap SystemCapability.Test.UiTest - * @param text the text to inject. + * @param text The text to inject. * @since 8 + * @deprecated since 9 + * @useinstead {@link Component.inputText} * @test */ inputText(text: string): Promise; @@ -296,9 +344,11 @@ declare class UiComponent { /** * Scroll on this {@link UiComponent}to find matched {@link UiComponent},applicable to scrollable one. * @syscap SystemCapability.Test.UiTest - * @param by the attribute requirements of the target {@link UiComponent}. + * @param by The attribute requirements of the target {@link UiComponent}. * @return the found result,or undefined if not found. * @since 8 + * @deprecated since 9 + * @useinstead {@link Component.scrollSearch} * @test */ scrollSearch(by: By): Promise; @@ -310,6 +360,7 @@ declare class UiComponent { * * @since 8 * @deprecated since 9 + * @useinstead {@link Driver} * @test * @syscap SystemCapability.Test.UiTest */ @@ -319,6 +370,8 @@ declare class UiDriver { * @syscap SystemCapability.Test.UiTest * @returns the {@link UiDriver} object. * @since 8 + * @deprecated since 9 + * @useinstead {@link Driver.create} * @test */ static create(): UiDriver; @@ -326,8 +379,10 @@ declare class UiDriver { /** * Delay with specified duration. * @syscap SystemCapability.Test.UiTest - * @param duration the delay duration in milliseconds. + * @param duration The delay duration in milliseconds. * @since 8 + * @deprecated since 9 + * @useinstead {@link Driver.delayMs} * @test */ delayMs(duration: number): Promise; @@ -335,9 +390,11 @@ declare class UiDriver { /** * Find the first matched {@link UiComponent} on current UI. * @syscap SystemCapability.Test.UiTest - * @param by the attribute requirements of the target {@link UiComponent}. + * @param by The attribute requirements of the target {@link UiComponent}. * @returns the first matched {@link UiComponent} or undefined. * @since 8 + * @deprecated since 9 + * @useinstead {@link Driver.findComponent} * @test */ findComponent(by: By): Promise; @@ -345,9 +402,11 @@ declare class UiDriver { /** * Find all the matched {@link UiComponent}s on current UI. * @syscap SystemCapability.Test.UiTest - * @param by the attribute requirements of the target {@link UiComponent}. + * @param by The attribute requirements of the target {@link UiComponent}. * @returns the matched {@link UiComponent}s list. * @since 8 + * @deprecated since 9 + * @useinstead {@link Driver.findComponents} * @test */ findComponents(by: By): Promise>; @@ -355,9 +414,11 @@ declare class UiDriver { /** * Assert t the matched {@link UiComponent}s exists on current UI;if not,assertError will be raised. * @syscap SystemCapability.Test.UiTest - * @param by the attribute requirements of the target {@link UiComponent}. + * @param by The attribute requirements of the target {@link UiComponent}. * @throws Throws this exception if following error occurs:{@code ComponentExistAssertion Failure}. * @since 8 + * @deprecated since 9 + * @useinstead {@link Driver.assertComponentExist} * @test */ assertComponentExist(by: By): Promise; @@ -366,6 +427,8 @@ declare class UiDriver { * Press the BACK key. * @syscap SystemCapability.Test.UiTest * @since 8 + * @deprecated since 9 + * @useinstead {@link Driver.pressBack} * @test */ pressBack(): Promise; @@ -375,6 +438,8 @@ declare class UiDriver { * @syscap SystemCapability.Test.UiTest * @param keyCode the target keyCode. * @since 8 + * @deprecated since 9 + * @useinstead {@link Driver.pressHome} * @test */ triggerKey(keyCode: number): Promise; @@ -382,9 +447,11 @@ declare class UiDriver { /** * Click on the specified location on the screen. * @syscap SystemCapability.Test.UiTest - * @param x the x-coordinate. - * @param y the y-coordinate. + * @param x The x-coordinate. + * @param y The y-coordinate. * @since 8 + * @deprecated since 9 + * @useinstead {@link Driver.click} * @test */ click(x: number, y: number): Promise; @@ -392,9 +459,11 @@ declare class UiDriver { /** * DoubleClick on the specified location on the screen. * @syscap SystemCapability.Test.UiTest - * @param x the x-coordinate. - * @param y the y-coordinate. + * @param x The x-coordinate. + * @param y The y-coordinate. * @since 8 + * @deprecated since 9 + * @useinstead {@link Driver.doubleClick} * @test */ doubleClick(x: number, y: number): Promise; @@ -402,9 +471,11 @@ declare class UiDriver { /** * LongClick on the specified location on the screen. * @syscap SystemCapability.Test.UiTest - * @param x the x-coordinate. - * @param y the y-coordinate. + * @param x The x-coordinate. + * @param y The y-coordinate. * @since 8 + * @deprecated since 9 + * @useinstead {@link Driver.longClick} * @test */ longClick(x: number, y: number): Promise; @@ -412,11 +483,13 @@ declare class UiDriver { /** * Swipe 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 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. * @since 8 + * @deprecated since 9 + * @useinstead {@link Driver.swipe} * @test */ swipe(startx: number, starty: number, endx: number, endy: number): Promise; @@ -427,6 +500,8 @@ declare class UiDriver { * @param savePath the path where to store the picture. * @returns true if screen-capturing and file-storing are completed successfully,false otherwise. * @since 8 + * @deprecated since 9 + * @useinstead {@link Driver.screenCap} * @test */ screenCap(savePath: string): Promise; @@ -517,10 +592,10 @@ declare class On { /** * Specifies the text for the target Component. * @syscap SystemCapability.Test.UiTest - * @param txt the text value. - * @param pattern the {@link MatchPattern} of the text value, default to {@link MatchPattern.EQUALS} + * @param txt The text value. + * @param pattern The {@link MatchPattern} of the text value, default to {@link MatchPattern.EQUALS} * @return Returns this {@link On} object. - * @throws {BusinessError} 401 if the input parameters are invalid. + * @throws {BusinessError} 401 - if the input parameters are invalid. * @since 9 * @test */ @@ -529,9 +604,9 @@ declare class On { /** * Specifies the id of the target Component. * @syscap SystemCapability.Test.UiTest - * @param id the id value. + * @param id The id value. * @return Returns this {@link On} object. - * @throws {BusinessError} 401 if the input parameters are invalid. + * @throws {BusinessError} 401 - if the input parameters are invalid. * @since 9 * @test */ @@ -540,9 +615,9 @@ declare class On { /** * Specifies the type of the target Component. * @syscap SystemCapability.Test.UiTest - * @param tp the type value. + * @param tp The type value. * @return Returns this {@link On} object. - * @throws {BusinessError} 401 if the input parameters are invalid. + * @throws {BusinessError} 401 - if the input parameters are invalid. * @since 9 * @test */ @@ -551,9 +626,9 @@ declare class On { /** * Specifies the clickable status of the target Component. * @syscap SystemCapability.Test.UiTest - * @param b the clickable status,default to true. + * @param b The clickable status,default to true. * @return Returns this {@link On} object. - * @throws {BusinessError} 401 if the input parameters are invalid. + * @throws {BusinessError} 401 - if the input parameters are invalid. * @since 9 * @test */ @@ -562,9 +637,9 @@ declare class On { /** * Specifies the longClickable status of the target Component. * @syscap SystemCapability.Test.UiTest - * @param b the clickable status,default to true. + * @param b The clickable status,default to true. * @return Returns this {@link On} object. - * @throws {BusinessError} 401 if the input parameters are invalid. + * @throws {BusinessError} 401 - if the input parameters are invalid. * @since 9 * @test */ @@ -573,9 +648,9 @@ declare class On { /** * Specifies the scrollable status of the target Component. * @syscap SystemCapability.Test.UiTest - * @param b the scrollable status,default to true. + * @param b The scrollable status,default to true. * @return Returns this {@link On} object. - * @throws {BusinessError} 401 if the input parameters are invalid. + * @throws {BusinessError} 401 - if the input parameters are invalid. * @since 9 * @test */ @@ -584,9 +659,9 @@ declare class On { /** * Specifies the enabled status of the target Component. * @syscap SystemCapability.Test.UiTest - * @param b the enabled status,default to true. + * @param b The enabled status,default to true. * @return Returns this {@link On} object. - * @throws {BusinessError} 401 if the input parameters are invalid. + * @throws {BusinessError} 401 - if the input parameters are invalid. * @since 9 * @test */ @@ -595,9 +670,9 @@ declare class On { /** * Specifies the focused status of the target Component. * @syscap SystemCapability.Test.UiTest - * @param b the focused status,default to true. + * @param b The focused status,default to true. * @return Returns this {@link On} object. - * @throws {BusinessError} 401 if the input parameters are invalid. + * @throws {BusinessError} 401 - if the input parameters are invalid. * @since 9 * @test */ @@ -606,9 +681,9 @@ declare class On { /** * Specifies the selected status of the target Component. * @syscap SystemCapability.Test.UiTest - * @param b the selected status,default to true. + * @param b The selected status,default to true. * @return Returns this {@link On} object. - * @throws {BusinessError} 401 if the input parameters are invalid. + * @throws {BusinessError} 401 - if the input parameters are invalid. * @since 9 * @test */ @@ -617,9 +692,9 @@ declare class On { /** * Specifies the checked status of the target Component. * @syscap SystemCapability.Test.UiTest - * @param b the checked status,default to false. + * @param b The checked status,default to false. * @return Returns this {@link On} object. - * @throws {BusinessError} 401 if the input parameters are invalid. + * @throws {BusinessError} 401 - if the input parameters are invalid. * @since 9 * @test */ @@ -628,9 +703,9 @@ declare class On { /** * Specifies the checkable status of the target Component. * @syscap SystemCapability.Test.UiTest - * @param b the checkable status,default to false. + * @param b The checkable status,default to false. * @return Returns this {@link On} object. - * @throws {BusinessError} 401 if the input parameters are invalid. + * @throws {BusinessError} 401 - if the input parameters are invalid. * @since 9 * @test */ @@ -640,9 +715,9 @@ declare class On { * Requires that the target Component which is before another Component that specified by the given {@link On} * object,used to locate Component relatively. * @syscap SystemCapability.Test.UiTest - * @param on describes the attribute requirements of Component which the target one is in front of. + * @param on Describes the attribute requirements of Component which the target one is in front of. * @return Returns this {@link On} object. - * @throws {BusinessError} 401 if the input parameters are invalid. + * @throws {BusinessError} 401 - if the input parameters are invalid. * @since 9 * @test */ @@ -652,9 +727,9 @@ declare class On { * Requires that the target Component which is after another Component that specified by the given {@link On} * object,used to locate Component relatively. * @syscap SystemCapability.Test.UiTest - * @param on describes the attribute requirements of Component which the target one is in back of. + * @param on Describes the attribute requirements of Component which the target one is in back of. * @return Returns this {@link On} object. - * @throws {BusinessError} 401 if the input parameters are invalid. + * @throws {BusinessError} 401 - if the input parameters are invalid. * @since 9 * @test */ @@ -673,8 +748,8 @@ declare class Component { * Click this {@link Component}. * @syscap SystemCapability.Test.UiTest * @since 9 - * @throws {BusinessError} 17000002 if the async function was not called with await. - * @throws {BusinessError} 17000004 if the component is invisible or destroyed. + * @throws {BusinessError} 17000002 - if the async function was not called with await. + * @throws {BusinessError} 17000004 - if the component is invisible or destroyed. * @test */ click(): Promise; @@ -683,8 +758,8 @@ declare class Component { * Double click this {@link Component}. * @syscap SystemCapability.Test.UiTest * @since 9 - * @throws {BusinessError} 17000002 if the async function was not called with await. - * @throws {BusinessError} 17000004 if the component is invisible or destroyed. + * @throws {BusinessError} 17000002 - if the async function was not called with await. + * @throws {BusinessError} 17000004 - if the component is invisible or destroyed. * @test */ doubleClick(): Promise; @@ -693,8 +768,8 @@ declare class Component { * Long click this {@link Component}. * @syscap SystemCapability.Test.UiTest * @since 9 - * @throws {BusinessError} 17000002 if the async function was not called with await. - * @throws {BusinessError} 17000004 if the component is invisible or destroyed. + * @throws {BusinessError} 17000002 - if the async function was not called with await. + * @throws {BusinessError} 17000004 - if the component is invisible or destroyed. * @test */ longClick(): Promise; @@ -703,8 +778,8 @@ declare class Component { * Get the id attribute value. * @syscap SystemCapability.Test.UiTest * @returns the id value. - * @throws {BusinessError} 17000002 if the async function was not called with await. - * @throws {BusinessError} 17000004 if the component is invisible or destroyed. + * @throws {BusinessError} 17000002 - if the async function was not called with await. + * @throws {BusinessError} 17000004 - if the component is invisible or destroyed. * @since 9 * @test */ @@ -713,8 +788,8 @@ declare class Component { /** * Get the text attribute value. * @syscap SystemCapability.Test.UiTest - * @throws {BusinessError} 17000002 if the async function was not called with await. - * @throws {BusinessError} 17000004 if the component is invisible or destroyed. + * @throws {BusinessError} 17000002 - if the async function was not called with await. + * @throws {BusinessError} 17000004 - if the component is invisible or destroyed. * @since 9 * @test */ @@ -724,8 +799,8 @@ declare class Component { * Get the type name. * @syscap SystemCapability.Test.UiTest * @returns the type name. - * @throws {BusinessError} 17000002 if the async function was not called with await. - * @throws {BusinessError} 17000004 if the component is invisible or destroyed. + * @throws {BusinessError} 17000002 - if the async function was not called with await. + * @throws {BusinessError} 17000004 - if the component is invisible or destroyed. * @since 9 * @test */ @@ -735,8 +810,8 @@ declare class Component { * Get the clickable status of this {@link Component}. * @syscap SystemCapability.Test.UiTest * @returns the clickable status. - * @throws {BusinessError} 17000002 if the async function was not called with await. - * @throws {BusinessError} 17000004 if the component is invisible or destroyed. + * @throws {BusinessError} 17000002 - if the async function was not called with await. + * @throws {BusinessError} 17000004 - if the component is invisible or destroyed. * @since 9 * @test */ @@ -746,8 +821,8 @@ declare class Component { * Get the longClickable status of this {@link Component}. * @syscap SystemCapability.Test.UiTest * @returns the longClickable status. - * @throws {BusinessError} 17000002 if the async function was not called with await. - * @throws {BusinessError} 17000004 if the component is invisible or destroyed. + * @throws {BusinessError} 17000002 - if the async function was not called with await. + * @throws {BusinessError} 17000004 - if the component is invisible or destroyed. * @since 9 * @test */ @@ -757,8 +832,8 @@ declare class Component { * Get the scrollable status of this {@link Component}. * @syscap SystemCapability.Test.UiTest * @returns the scrollable status. - * @throws {BusinessError} 17000002 if the async function was not called with await. - * @throws {BusinessError} 17000004 if the component is invisible or destroyed. + * @throws {BusinessError} 17000002 - if the async function was not called with await. + * @throws {BusinessError} 17000004 - if the component is invisible or destroyed. * @since 9 * @test */ @@ -768,8 +843,8 @@ declare class Component { * Get the enabled status of this {@link Component}. * @syscap SystemCapability.Test.UiTest * @returns the enabled status. - * @throws {BusinessError} 17000002 if the async function was not called with await. - * @throws {BusinessError} 17000004 if the component is invisible or destroyed. + * @throws {BusinessError} 17000002 - if the async function was not called with await. + * @throws {BusinessError} 17000004 - if the component is invisible or destroyed. * @since 9 * @test */ @@ -779,8 +854,8 @@ declare class Component { * Get the focused status of this {@link Component}. * @syscap SystemCapability.Test.UiTest * @returns the focused status. - * @throws {BusinessError} 17000002 if the async function was not called with await. - * @throws {BusinessError} 17000004 if the component is invisible or destroyed. + * @throws {BusinessError} 17000002 - if the async function was not called with await. + * @throws {BusinessError} 17000004 - if the component is invisible or destroyed. * @since 9 * @test */ @@ -790,8 +865,8 @@ declare class Component { * Get the selected status of this {@link Component}. * @syscap SystemCapability.Test.UiTest * @returns the selected status. - * @throws {BusinessError} 17000002 if the async function was not called with await. - * @throws {BusinessError} 17000004 if the component is invisible or destroyed. + * @throws {BusinessError} 17000002 - if the async function was not called with await. + * @throws {BusinessError} 17000004 - if the component is invisible or destroyed. * @since 9 * @test */ @@ -801,8 +876,8 @@ declare class Component { * Get the checked status of this {@link Component}. * @syscap SystemCapability.Test.UiTest * @returns the checked status. - * @throws {BusinessError} 17000002 if the async function was not called with await. - * @throws {BusinessError} 17000004 if the component is invisible or destroyed. + * @throws {BusinessError} 17000002 - if the async function was not called with await. + * @throws {BusinessError} 17000004 - if the component is invisible or destroyed. * @since 9 * @test */ @@ -812,8 +887,8 @@ declare class Component { * Get the checkable status of this {@link Component}. * @syscap SystemCapability.Test.UiTest * @returns the checkable status. - * @throws {BusinessError} 17000002 if the async function was not called with await. - * @throws {BusinessError} 17000004 if the component is invisible or destroyed. + * @throws {BusinessError} 17000002 - if the async function was not called with await. + * @throws {BusinessError} 17000004 - if the component is invisible or destroyed. * @since 9 * @test */ @@ -822,10 +897,10 @@ declare class Component { /** * Inject text to this {@link Component},applicable to TextInput. * @syscap SystemCapability.Test.UiTest - * @param text the text to inject. - * @throws {BusinessError} 401 if the input parameters are invalid. - * @throws {BusinessError} 17000002 if the async function was not called with await. - * @throws {BusinessError} 17000004 if the component is invisible or destroyed. + * @param text The text to inject. + * @throws {BusinessError} 401 - if the input parameters are invalid. + * @throws {BusinessError} 17000002 - if the async function was not called with await. + * @throws {BusinessError} 17000004 - if the component is invisible or destroyed. * @since 9 * @test */ @@ -834,8 +909,8 @@ declare class Component { /** * Clear text of this {@link Component},applicable to TextInput. * @syscap SystemCapability.Test.UiTest - * @throws {BusinessError} 17000002 if the async function was not called with await. - * @throws {BusinessError} 17000004 if the component is invisible or destroyed. + * @throws {BusinessError} 17000002 - if the async function was not called with await. + * @throws {BusinessError} 17000004 - if the component is invisible or destroyed. * @since 9 * @test */ @@ -844,10 +919,10 @@ declare class Component { /** * Scroll on this {@link Component} to the top,applicable to scrollable one. * @syscap SystemCapability.Test.UiTest - * @param speed the speed of swipe (pixels per second),default is 600,the value ranges from 200 to 15000,set it 600 if out of range. - * @throws {BusinessError} 401 if the input parameters are invalid. - * @throws {BusinessError} 17000002 if the async function was not called with await. - * @throws {BusinessError} 17000004 if the component is invisible or destroyed. + * @param speed The speed of swipe (pixels per second),default is 600,the value ranges from 200 to 15000,set it 600 if out of range. + * @throws {BusinessError} 401 - if the input parameters are invalid. + * @throws {BusinessError} 17000002 - if the async function was not called with await. + * @throws {BusinessError} 17000004 - if the component is invisible or destroyed. * @since 9 * @test */ @@ -856,10 +931,10 @@ declare class Component { /** * Scroll on this {@link Component} to the bottom,applicable to scrollable one. * @syscap SystemCapability.Test.UiTest - * @param speed the speed of swipe (pixels per second),default is 600,the value ranges from 200 to 15000,set it 600 if out of range. - * @throws {BusinessError} 401 if the input parameters are invalid. - * @throws {BusinessError} 17000002 if the async function was not called with await. - * @throws {BusinessError} 17000004 if the component is invisible or destroyed. + * @param speed The speed of swipe (pixels per second),default is 600,the value ranges from 200 to 15000,set it 600 if out of range. + * @throws {BusinessError} 401 - if the input parameters are invalid. + * @throws {BusinessError} 17000002 - if the async function was not called with await. + * @throws {BusinessError} 17000004 - if the component is invisible or destroyed. * @since 9 * @test */ @@ -868,11 +943,11 @@ declare class Component { /** * Scroll on this {@link Component}to find matched {@link Component},applicable to scrollable one. * @syscap SystemCapability.Test.UiTest - * @param on the attribute requirements of the target {@link Component}. + * @param on The attribute requirements of the target {@link Component}. * @return the found result,or undefined if not found. - * @throws {BusinessError} 401 if the input parameters are invalid. - * @throws {BusinessError} 17000002 if the async function was not called with await. - * @throws {BusinessError} 17000004 if the component is invisible or destroyed. + * @throws {BusinessError} 401 - if the input parameters are invalid. + * @throws {BusinessError} 17000002 - if the async function was not called with await. + * @throws {BusinessError} 17000004 - if the component is invisible or destroyed. * @since 9 * @test */ @@ -882,8 +957,8 @@ declare class Component { * Get the bounds rect of this {@link Component}. * @syscap SystemCapability.Test.UiTest * @return the bounds rect object. - * @throws {BusinessError} 17000002 if the async function was not called with await. - * @throws {BusinessError} 17000004 if the component is invisible or destroyed. + * @throws {BusinessError} 17000002 - if the async function was not called with await. + * @throws {BusinessError} 17000004 - if the component is invisible or destroyed. * @since 9 * @test */ @@ -893,8 +968,8 @@ declare class Component { * Get the boundsCenter of this {@link Component}. * @syscap SystemCapability.Test.UiTest * @return the boundsCenter object. - * @throws {BusinessError} 17000002 if the async function was not called with await. - * @throws {BusinessError} 17000004 if the component is invisible or destroyed. + * @throws {BusinessError} 17000002 - if the async function was not called with await. + * @throws {BusinessError} 17000004 - if the component is invisible or destroyed. * @since 9 * @test */ @@ -903,10 +978,10 @@ declare class Component { /** * Drag this {@link Component} to the bounds rect of target Component. * @syscap SystemCapability.Test.UiTest - * @param target the target {@link Component}. - * @throws {BusinessError} 401 if the input parameters are invalid. - * @throws {BusinessError} 17000002 if the async function was not called with await. - * @throws {BusinessError} 17000004 if the component is invisible or destroyed. + * @param target The target {@link Component}. + * @throws {BusinessError} 401 - if the input parameters are invalid. + * @throws {BusinessError} 17000002 - if the async function was not called with await. + * @throws {BusinessError} 17000004 - if the component is invisible or destroyed. * @since 9 * @test */ @@ -915,10 +990,10 @@ declare class Component { /** * Pinch enlarge this {@link Component} to the target scale. * @syscap SystemCapability.Test.UiTest - * @param scale the scale of the pinch enlarge this {@link Component}'s size. - * @throws {BusinessError} 401 if the input parameters are invalid. - * @throws {BusinessError} 17000002 if the async function was not called with await. - * @throws {BusinessError} 17000004 if the component is invisible or destroyed. + * @param scale The scale of the pinch enlarge this {@link Component}'s size. + * @throws {BusinessError} 401 - if the input parameters are invalid. + * @throws {BusinessError} 17000002 - if the async function was not called with await. + * @throws {BusinessError} 17000004 - if the component is invisible or destroyed. * @since 9 * @test */ @@ -927,10 +1002,10 @@ declare class Component { /** * Pinch shrink this {@link Component} to the target scale. * @syscap SystemCapability.Test.UiTest - * @param scale the scale of the pinch shrink this {@link Component}'s size. - * @throws {BusinessError} 401 if the input parameters are invalid. - * @throws {BusinessError} 17000002 if the async function was not called with await. - * @throws {BusinessError} 17000004 if the component is invisible or destroyed. + * @param scale The scale of the pinch shrink this {@link Component}'s size. + * @throws {BusinessError} 401 - if the input parameters are invalid. + * @throws {BusinessError} 17000002 - if the async function was not called with await. + * @throws {BusinessError} 17000004 - if the component is invisible or destroyed. * @since 9 * @test */ @@ -950,7 +1025,7 @@ declare class Driver { * Create an {@link Driver} object. * @syscap SystemCapability.Test.UiTest * @returns the {@link Driver} object. - * @throws {BusinessError} 17000001 if the test framework failed to initialize. + * @throws {BusinessError} 17000001 - if the test framework failed to initialize. * @since 9 * @test */ @@ -959,9 +1034,9 @@ declare class Driver { /** * Delay with specified duration. * @syscap SystemCapability.Test.UiTest - * @param duration the delay duration in milliseconds. - * @throws {BusinessError} 401 if the input parameters are invalid. - * @throws {BusinessError} 17000002 if the async function was not called with await. + * @param duration The delay duration in milliseconds. + * @throws {BusinessError} 401 - if the input parameters are invalid. + * @throws {BusinessError} 17000002 - if the async function was not called with await. * @since 9 * @test */ @@ -970,10 +1045,10 @@ declare class Driver { /** * Find the first matched {@link Component} on current UI. * @syscap SystemCapability.Test.UiTest - * @param on the attribute requirements of the target {@link Component}. + * @param on The attribute requirements of the target {@link Component}. * @returns the first matched {@link Component} or undefined. - * @throws {BusinessError} 401 if the input parameters are invalid. - * @throws {BusinessError} 17000002 if the async function was not called with await. + * @throws {BusinessError} 401 - if the input parameters are invalid. + * @throws {BusinessError} 17000002 - if the async function was not called with await. * @since 9 * @test */ @@ -982,10 +1057,10 @@ declare class Driver { /** * Find the first matched {@link UiWindow} window. * @syscap SystemCapability.Test.UiTest - * @param filter the filer condition of the target {@link UiWindow}. + * @param filter The filer condition of the target {@link UiWindow}. * @returns the first matched {@link UiWindow} or undefined. - * @throws {BusinessError} 401 if the input parameters are invalid. - * @throws {BusinessError} 17000002 if the async function was not called with await. + * @throws {BusinessError} 401 - if the input parameters are invalid. + * @throws {BusinessError} 17000002 - if the async function was not called with await. * @since 9 * @test */ @@ -994,11 +1069,11 @@ declare class Driver { /** * Find the first matched {@link Component} on current UI during the time given. * @syscap SystemCapability.Test.UiTest - * @param on the attribute requirements of the target {@link Component}. - * @param time duration of finding in milliseconds + * @param on The attribute requirements of the target {@link Component}. + * @param time Duration of finding in milliseconds * @returns the first matched {@link Component} or undefined. - * @throws {BusinessError} 401 if the input parameters are invalid. - * @throws {BusinessError} 17000002 if the async function was not called with await. + * @throws {BusinessError} 401 - if the input parameters are invalid. + * @throws {BusinessError} 17000002 - if the async function was not called with await. * @since 9 * @test */ @@ -1007,10 +1082,10 @@ declare class Driver { /** * Find all the matched {@link Component}s on current UI. * @syscap SystemCapability.Test.UiTest - * @param on the attribute requirements of the target {@link Component}. + * @param on The attribute requirements of the target {@link Component}. * @returns the matched {@link Component}s list. - * @throws {BusinessError} 401 if the input parameters are invalid. - * @throws {BusinessError} 17000002 if the async function was not called with await. + * @throws {BusinessError} 401 - if the input parameters are invalid. + * @throws {BusinessError} 17000002 - if the async function was not called with await. * @since 9 * @test */ @@ -1019,10 +1094,10 @@ declare class Driver { /** * Assert t the matched {@link Component}s exists on current UI;if not,assertError will be raised. * @syscap SystemCapability.Test.UiTest - * @param on the attribute requirements of the target {@link Component}. - * @throws {BusinessError} 401 if the input parameters are invalid. - * @throws {BusinessError} 17000002 if the async function was not called with await. - * @throws {BusinessError} 17000003 if the assertion failed. + * @param on The attribute requirements of the target {@link Component}. + * @throws {BusinessError} 401 - if the input parameters are invalid. + * @throws {BusinessError} 17000002 - if the async function was not called with await. + * @throws {BusinessError} 17000003 - if the assertion failed. * @since 9 * @test */ @@ -1031,7 +1106,7 @@ declare class Driver { /** * Press the BACK key. * @syscap SystemCapability.Test.UiTest - * @throws {BusinessError} 17000002 if the async function was not called with await. + * @throws {BusinessError} 17000002 - if the async function was not called with await. * @since 9 * @test */ @@ -1041,8 +1116,8 @@ declare class Driver { * Press the specified key. * @syscap SystemCapability.Test.UiTest * @param keyCode the target keyCode. - * @throws {BusinessError} 401 if the input parameters are invalid. - * @throws {BusinessError} 17000002 if the async function was not called with await. + * @throws {BusinessError} 401 - if the input parameters are invalid. + * @throws {BusinessError} 17000002 - if the async function was not called with await. * @since 9 * @test */ @@ -1054,8 +1129,8 @@ declare class Driver { * @param key0 the first keyCode. * @param key1 the second keyCode. * @param key2 the third keyCode. - * @throws {BusinessError} 401 if the input parameters are invalid. - * @throws {BusinessError} 17000002 if the async function was not called with await. + * @throws {BusinessError} 401 - if the input parameters are invalid. + * @throws {BusinessError} 17000002 - if the async function was not called with await. * @since 9 * @test */ @@ -1064,10 +1139,10 @@ declare class Driver { /** * Click on the specified location on the screen. * @syscap SystemCapability.Test.UiTest - * @param x the x-coordinate. - * @param y the y-coordinate. - * @throws {BusinessError} 401 if the input parameters are invalid. - * @throws {BusinessError} 17000002 if the async function was not called with await. + * @param x The x-coordinate. + * @param y The y-coordinate. + * @throws {BusinessError} 401 - if the input parameters are invalid. + * @throws {BusinessError} 17000002 - if the async function was not called with await. * @since 9 * @test */ @@ -1076,10 +1151,10 @@ declare class Driver { /** * DoubleClick on the specified location on the screen. * @syscap SystemCapability.Test.UiTest - * @param x the x-coordinate. - * @param y the y-coordinate. - * @throws {BusinessError} 401 if the input parameters are invalid. - * @throws {BusinessError} 17000002 if the async function was not called with await. + * @param x The x-coordinate. + * @param y The y-coordinate. + * @throws {BusinessError} 401 - if the input parameters are invalid. + * @throws {BusinessError} 17000002 - if the async function was not called with await. * @since 9 * @test */ @@ -1088,10 +1163,10 @@ declare class Driver { /** * LongClick on the specified location on the screen. * @syscap SystemCapability.Test.UiTest - * @param x the x-coordinate. - * @param y the y-coordinate. - * @throws {BusinessError} 401 if the input parameters are invalid. - * @throws {BusinessError} 17000002 if the async function was not called with await. + * @param x The x-coordinate. + * @param y The y-coordinate. + * @throws {BusinessError} 401 - if the input parameters are invalid. + * @throws {BusinessError} 17000002 - if the async function was not called with await. * @since 9 * @test */ @@ -1100,13 +1175,13 @@ declare class Driver { /** * Swipe 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,the value ranges from 200 to 15000,set it 600 if out of range. - * @throws {BusinessError} 401 if the input parameters are invalid. - * @throws {BusinessError} 17000002 if the async function was not called with await. + * @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,the value ranges from 200 to 15000,set it 600 if out of range. + * @throws {BusinessError} 401 - if the input parameters are invalid. + * @throws {BusinessError} 17000002 - if the async function was not called with await. * @since 9 * @test */ @@ -1115,13 +1190,13 @@ declare class Driver { /** * 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,the value ranges from 200 to 15000,set it 600 if out of range. - * @throws {BusinessError} 401 if the input parameters are invalid. - * @throws {BusinessError} 17000002 if the async function was not called with await. + * @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,the value ranges from 200 to 15000,set it 600 if out of range. + * @throws {BusinessError} 401 - if the input parameters are invalid. + * @throws {BusinessError} 17000002 - if the async function was not called with await. * @since 9 * @test */ @@ -1132,8 +1207,8 @@ declare class Driver { * @syscap SystemCapability.Test.UiTest * @param savePath the path where to store the picture. * @returns true if screen-capturing and file-storing are completed successfully,false otherwise. - * @throws {BusinessError} 401 if the input parameters are invalid. - * @throws {BusinessError} 17000002 if the async function was not called with await. + * @throws {BusinessError} 401 - if the input parameters are invalid. + * @throws {BusinessError} 17000002 - if the async function was not called with await. * @since 9 * @test */ @@ -1142,9 +1217,9 @@ declare class Driver { /** * Set the rotation of the device display. * @syscap SystemCapability.Test.UiTest - * @param rotation the target rotation to set. - * @throws {BusinessError} 401 if the input parameters are invalid. - * @throws {BusinessError} 17000002 if the async function was not called with await. + * @param rotation The target rotation to set. + * @throws {BusinessError} 401 - if the input parameters are invalid. + * @throws {BusinessError} 17000002 - if the async function was not called with await. * @since 9 * @test */ @@ -1154,7 +1229,7 @@ declare class Driver { * Get the rotation of the device display. * @syscap SystemCapability.Test.UiTest * @returns the current display rotation. - * @throws {BusinessError} 17000002 if the async function was not called with await. + * @throws {BusinessError} 17000002 - if the async function was not called with await. * @since 9 * @test */ @@ -1163,9 +1238,9 @@ declare class Driver { /** * Enable/disable the rotation of device display. * @syscap SystemCapability.Test.UiTest - * @param enabled enable the rotation or not. - * @throws {BusinessError} 401 if the input parameters are invalid. - * @throws {BusinessError} 17000002 if the async function was not called with await. + * @param enabled Enable the rotation or not. + * @throws {BusinessError} 401 - if the input parameters are invalid. + * @throws {BusinessError} 17000002 - if the async function was not called with await. * @since 9 * @test */ @@ -1175,7 +1250,7 @@ declare class Driver { * Get the size of the device display. * @syscap SystemCapability.Test.UiTest * @returns the size of the device display. - * @throws {BusinessError} 17000002 if the async function was not called with await. + * @throws {BusinessError} 17000002 - if the async function was not called with await. * @since 9 * @test */ @@ -1185,7 +1260,7 @@ declare class Driver { * Get the density of the device display. * @syscap SystemCapability.Test.UiTest * @returns the density of the device display. - * @throws {BusinessError} 17000002 if the async function was not called with await. + * @throws {BusinessError} 17000002 - if the async function was not called with await. * @since 9 * @test */ @@ -1194,7 +1269,7 @@ declare class Driver { /** * Wake up the device display. * @syscap SystemCapability.Test.UiTest - * @throws {BusinessError} 17000002 if the async function was not called with await. + * @throws {BusinessError} 17000002 - if the async function was not called with await. * @since 9 * @test */ @@ -1203,7 +1278,7 @@ declare class Driver { /** * Press the home key. * @syscap SystemCapability.Test.UiTest - * @throws {BusinessError} 17000002 if the async function was not called with await. + * @throws {BusinessError} 17000002 - if the async function was not called with await. * @since 9 * @test */ @@ -1213,10 +1288,10 @@ declare class Driver { * Wait for the UI become idle. * @syscap SystemCapability.Test.UiTest * @param idleTime the threshold of UI idle time, in millisecond. - * @param timeout the maximum time to wait for idle, in millisecond. + * @param timeout The maximum time to wait for idle, in millisecond. * @returns true if wait for idle succeed in the timeout, false otherwise. - * @throws {BusinessError} 401 if the input parameters are invalid. - * @throws {BusinessError} 17000002 if the async function was not called with await. + * @throws {BusinessError} 401 - if the input parameters are invalid. + * @throws {BusinessError} 17000002 - if the async function was not called with await. * @since 9 * @test */ @@ -1225,12 +1300,12 @@ declare class Driver { /** * Inject fling on the device display. * @syscap SystemCapability.Test.UiTest - * @param from the coordinate point where the finger touches the screen. - * @param to the coordinate point where the finger leaves the screen. + * @param from The coordinate point where the finger touches the screen. + * @param to The coordinate point where the finger leaves the screen. * @param stepLen the length of each step, in pixels. - * @param speed the speed of fling (pixels per second),default is 600,the value ranges from 200 to 15000,set it 600 if out of range. - * @throws {BusinessError} 401 if the input parameters are invalid. - * @throws {BusinessError} 17000002 if the async function was not called with await. + * @param speed The speed of fling (pixels per second),default is 600,the value ranges from 200 to 15000,set it 600 if out of range. + * @throws {BusinessError} 401 - if the input parameters are invalid. + * @throws {BusinessError} 17000002 - if the async function was not called with await. * @since 9 * @test */ @@ -1239,11 +1314,11 @@ declare class Driver { /** * Inject multi-pointer action on the device display. * @syscap SystemCapability.Test.UiTest - * @param pointers the two-dimensional array of pointers to inject. - * @param speed the speed of swipe (pixels per second),default is 600,the value ranges from 200 to 15000,set it 600 if out of range. + * @param pointers The two-dimensional array of pointers to inject. + * @param speed The speed of swipe (pixels per second),default is 600,the value ranges from 200 to 15000,set it 600 if out of range. * @returns true if the operation finished, false - * @throws {BusinessError} 401 if the input parameters are invalid. - * @throws {BusinessError} 17000002 if the async function was not called with await. + * @throws {BusinessError} 401 - if the input parameters are invalid. + * @throws {BusinessError} 17000002 - if the async function was not called with await. * @since 9 * @test */ @@ -1260,8 +1335,8 @@ declare class UiWindow { * Get the bundle name of this {@link UiWindow}. * @syscap SystemCapability.Test.UiTest * @returns the bundle name. - * @throws {BusinessError} 17000002 if the async function was not called with await. - * @throws {BusinessError} 17000004 if the window is invisible or destroyed. + * @throws {BusinessError} 17000002 - if the async function was not called with await. + * @throws {BusinessError} 17000004 - if the window is invisible or destroyed. * @since 9 * @test */ @@ -1271,8 +1346,8 @@ declare class UiWindow { * Get the bounds rect of this {@link UiWindow}. * @syscap SystemCapability.Test.UiTest * @return the bounds rect object. - * @throws {BusinessError} 17000002 if the async function was not called with await. - * @throws {BusinessError} 17000004 if the window is invisible or destroyed. + * @throws {BusinessError} 17000002 - if the async function was not called with await. + * @throws {BusinessError} 17000004 - if the window is invisible or destroyed. * @since 9 * @test */ @@ -1282,8 +1357,8 @@ declare class UiWindow { * Get the title of this {@link UiWindow}. * @syscap SystemCapability.Test.UiTest * @returns the title value. - * @throws {BusinessError} 17000002 if the async function was not called with await. - * @throws {BusinessError} 17000004 if the window is invisible or destroyed. + * @throws {BusinessError} 17000002 - if the async function was not called with await. + * @throws {BusinessError} 17000004 - if the window is invisible or destroyed. * @since 9 * @test */ @@ -1293,8 +1368,8 @@ declare class UiWindow { * Get the window mode of this {@link UiWindow}. * @syscap SystemCapability.Test.UiTest * @returns the {@link WindowMode} object - * @throws {BusinessError} 17000002 if the async function was not called with await. - * @throws {BusinessError} 17000004 if the window is invisible or destroyed. + * @throws {BusinessError} 17000002 - if the async function was not called with await. + * @throws {BusinessError} 17000004 - if the window is invisible or destroyed. * @since 9 * @test */ @@ -1304,8 +1379,8 @@ declare class UiWindow { * Get the focused status of this {@link UiWindow}. * @syscap SystemCapability.Test.UiTest * @returns the focused status - * @throws {BusinessError} 17000002 if the async function was not called with await. - * @throws {BusinessError} 17000004 if the window is invisible or destroyed. + * @throws {BusinessError} 17000002 - if the async function was not called with await. + * @throws {BusinessError} 17000004 - if the window is invisible or destroyed. * @since 9 * @test */ @@ -1315,8 +1390,8 @@ declare class UiWindow { * Get the active status of this {@link UiWindow}. * @syscap SystemCapability.Test.UiTest * @returns the actived status - * @throws {BusinessError} 17000002 if the async function was not called with await. - * @throws {BusinessError} 17000004 if the window is invisible or destroyed. + * @throws {BusinessError} 17000002 - if the async function was not called with await. + * @throws {BusinessError} 17000004 - if the window is invisible or destroyed. * @since 9 * @test */ @@ -1325,8 +1400,8 @@ declare class UiWindow { /** * Set the focused status of this {@link UiWindow}. * @syscap SystemCapability.Test.UiTest - * @throws {BusinessError} 17000002 if the async function was not called with await. - * @throws {BusinessError} 17000004 if the window is invisible or destroyed. + * @throws {BusinessError} 17000002 - if the async function was not called with await. + * @throws {BusinessError} 17000004 - if the window is invisible or destroyed. * @since 9 * @test */ @@ -1335,12 +1410,12 @@ declare class UiWindow { /** * Move this {@link UiWindow} to the specified points. * @syscap SystemCapability.Test.UiTest - * @param x the x coordinate of destination. - * @param y the y coordinate of destination. - * @throws {BusinessError} 401 if the input parameters are invalid. - * @throws {BusinessError} 17000002 if the async function was not called with await. - * @throws {BusinessError} 17000004 if the window is invisible or destroyed. - * @throws {BusinessError} 17000005 if the action is not supported on this window. + * @param x The x coordinate of destination. + * @param y The y coordinate of destination. + * @throws {BusinessError} 401 - if the input parameters are invalid. + * @throws {BusinessError} 17000002 - if the async function was not called with await. + * @throws {BusinessError} 17000004 - if the window is invisible or destroyed. + * @throws {BusinessError} 17000005 - if the action is not supported on this window. * @since 9 * @test */ @@ -1349,13 +1424,13 @@ declare class UiWindow { /** * Resize this {@link UiWindow} to the specified size for the specified direction. * @syscap SystemCapability.Test.UiTest - * @param wide the expected wide of the window after resizing. - * @param height the expected height of the window after resizing. - * @param direction the expected direction of the window after resizing. - * @throws {BusinessError} 401 if the input parameters are invalid. - * @throws {BusinessError} 17000002 if the async function was not called with await. - * @throws {BusinessError} 17000004 if the window is invisible or destroyed. - * @throws {BusinessError} 17000005 if the action is not supported on this window. + * @param wide The expected wide of the window after resizing. + * @param height The expected height of the window after resizing. + * @param direction The expected direction of the window after resizing. + * @throws {BusinessError} 401 - if the input parameters are invalid. + * @throws {BusinessError} 17000002 - if the async function was not called with await. + * @throws {BusinessError} 17000004 - if the window is invisible or destroyed. + * @throws {BusinessError} 17000005 - if the action is not supported on this window. * @since 9 * @test */ @@ -1364,9 +1439,9 @@ declare class UiWindow { /** * Change this {@link UiWindow} into split screen mode. * @syscap SystemCapability.Test.UiTest - * @throws {BusinessError} 17000002 if the async function was not called with await. - * @throws {BusinessError} 17000004 if the window is invisible or destroyed. - * @throws {BusinessError} 17000005 if the action is not supported on this window. + * @throws {BusinessError} 17000002 - if the async function was not called with await. + * @throws {BusinessError} 17000004 - if the window is invisible or destroyed. + * @throws {BusinessError} 17000005 - if the action is not supported on this window. * @since 9 * @test */ @@ -1375,9 +1450,9 @@ declare class UiWindow { /** * Maximize this {@link UiWindow}. * @syscap SystemCapability.Test.UiTest - * @throws {BusinessError} 17000002 if the async function was not called with await. - * @throws {BusinessError} 17000004 if the window is invisible or destroyed. - * @throws {BusinessError} 17000005 if the action is not supported on this window. + * @throws {BusinessError} 17000002 - if the async function was not called with await. + * @throws {BusinessError} 17000004 - if the window is invisible or destroyed. + * @throws {BusinessError} 17000005 - if the action is not supported on this window. * @since 9 * @test */ @@ -1386,9 +1461,9 @@ declare class UiWindow { /** * Minimize this {@link UiWindow}. * @syscap SystemCapability.Test.UiTest - * @throws {BusinessError} 17000002 if the async function was not called with await. - * @throws {BusinessError} 17000004 if the window is invisible or destroyed. - * @throws {BusinessError} 17000005 if the action is not supported on this window. + * @throws {BusinessError} 17000002 - if the async function was not called with await. + * @throws {BusinessError} 17000004 - if the window is invisible or destroyed. + * @throws {BusinessError} 17000005 - if the action is not supported on this window. * @since 9 * @test */ @@ -1397,9 +1472,9 @@ declare class UiWindow { /** * Resume this {@link UiWindow}. * @syscap SystemCapability.Test.UiTest - * @throws {BusinessError} 17000002 if the async function was not called with await. - * @throws {BusinessError} 17000004 if the window is invisible or destroyed. - * @throws {BusinessError} 17000005 if the action is not supported on this window. + * @throws {BusinessError} 17000002 - if the async function was not called with await. + * @throws {BusinessError} 17000004 - if the window is invisible or destroyed. + * @throws {BusinessError} 17000005 - if the action is not supported on this window. * @since 9 * @test */ @@ -1408,9 +1483,9 @@ declare class UiWindow { /** * Close this {@link UiWindow}. * @syscap SystemCapability.Test.UiTest - * @throws {BusinessError} 17000002 if the async function was not called with await. - * @throws {BusinessError} 17000004 if the window is invisible or destroyed. - * @throws {BusinessError} 17000005 if the action is not supported on this window. + * @throws {BusinessError} 17000002 - if the async function was not called with await. + * @throws {BusinessError} 17000004 - if the window is invisible or destroyed. + * @throws {BusinessError} 17000005 - if the action is not supported on this window. * @since 9 * @test */ @@ -1429,10 +1504,10 @@ declare class PointerMatrix { /** * Create an {@link PointerMatrix} object. * @syscap SystemCapability.Test.UiTest - * @param fingers the number of fingers. - * @param steps the number of steps of each finger trace. + * @param fingers The number of fingers. + * @param steps The number of steps of each finger trace. * @returns the {@link PointerMatrix} object. - * @throws {BusinessError} 401 if the input parameters are invalid. + * @throws {BusinessError} 401 - if the input parameters are invalid. * @since 9 * @test */ @@ -1441,10 +1516,10 @@ declare class PointerMatrix { /** * Set the point value of an element in the PointerMatrix. * @syscap SystemCapability.Test.UiTest - * @param finger the index of target finger to set. - * @param step the index of target step to set. - * @param point the coordinate of target step to set. - * @throws {BusinessError} 401 if the input parameters are invalid. + * @param finger The index of target finger to set. + * @param step The index of target step to set. + * @param point The coordinate of target step to set. + * @throws {BusinessError} 401 - if the input parameters are invalid. * @since 9 * @test @@ -1457,6 +1532,7 @@ declare class PointerMatrix { * @syscap SystemCapability.Test.UiTest * @since 8 * @deprecated since 9 + * @useinstead {@link ON} * @test */ declare const BY: By; -- Gitee From cf1af54f28eaa17d0485c72bbe3639a04c2c889a Mon Sep 17 00:00:00 2001 From: jianqirui Date: Tue, 11 Oct 2022 22:16:29 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E8=A7=84=E8=8C=83useinstead=E7=9A=84?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E5=90=8D=E7=A7=B0=E6=8F=8F=E8=BF=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: jianqirui --- api/@ohos.uitest.d.ts | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/api/@ohos.uitest.d.ts b/api/@ohos.uitest.d.ts index f5545b8ade..eeb34b69b9 100644 --- a/api/@ohos.uitest.d.ts +++ b/api/@ohos.uitest.d.ts @@ -54,7 +54,7 @@ declare enum MatchPattern { * * @since 8 * @deprecated since 9 - * @useinstead {@link On} + * @useinstead ohos.uitest.On * @syscap SystemCapability.Test.UiTest */ declare class By { @@ -66,7 +66,7 @@ declare class By { * @return Returns this {@link By} object. * @since 8 * @deprecated since 9 - * @useinstead {@link On.text} + * @useinstead ohos.uitest.On#text * @test */ text(txt: string, pattern?: MatchPattern): By; @@ -78,7 +78,7 @@ declare class By { * @return Returns this {@link By} object. * @since 8 * @deprecated since 9 - * @useinstead {@link On.id} + * @useinstead ohos.uitest.On#id * @test */ key(key: string): By; @@ -101,7 +101,7 @@ declare class By { * @return Returns this {@link By} object. * @since 8 * @deprecated since 9 - * @useinstead {@link On.type} + * @useinstead ohos.uitest.On#type * @test */ type(tp: string): By; @@ -113,7 +113,7 @@ declare class By { * @return Returns this {@link By} object. * @since 8 * @deprecated since 9 - * @useinstead {@link On.clickable} + * @useinstead ohos.uitest.On#clickable * @test */ clickable(b?: boolean): By; @@ -125,7 +125,7 @@ declare class By { * @return Returns this {@link By} object. * @since 8 * @deprecated since 9 - * @useinstead {@link On.scrollable} + * @useinstead ohos.uitest.On#scrollable * @test */ scrollable(b?: boolean): By; @@ -137,7 +137,7 @@ declare class By { * @return Returns this {@link By} object. * @since 8 * @deprecated since 9 - * @useinstead {@link On.enabled} + * @useinstead ohos.uitest.On#enabled * @test */ enabled(b?: boolean): By; @@ -149,7 +149,7 @@ declare class By { * @return Returns this {@link By} object. * @since 8 * @deprecated since 9 - * @useinstead {@link On.focused} + * @useinstead ohos.uitest.On#focused * @test */ focused(b?: boolean): By; @@ -161,7 +161,7 @@ declare class By { * @return Returns this {@link By} object. * @since 8 * @deprecated since 9 - * @useinstead {@link On.selected} + * @useinstead ohos.uitest.On#selected * @test */ selected(b?: boolean): By; @@ -198,7 +198,7 @@ declare class By { * * @since 8 * @deprecated since 9 - * @useinstead {@link Component} + * @useinstead ohos.uitest.Component * @test * @syscap SystemCapability.Test.UiTest */ @@ -208,7 +208,7 @@ declare class UiComponent { * @syscap SystemCapability.Test.UiTest * @since 8 * @deprecated since 9 - * @useinstead {@link Component.click} + * @useinstead ohos.uitest.Component#click * @test */ click(): Promise; @@ -360,7 +360,7 @@ declare class UiComponent { * * @since 8 * @deprecated since 9 - * @useinstead {@link Driver} + * @useinstead ohos.uitest.Driver * @test * @syscap SystemCapability.Test.UiTest */ @@ -371,7 +371,7 @@ declare class UiDriver { * @returns the {@link UiDriver} object. * @since 8 * @deprecated since 9 - * @useinstead {@link Driver.create} + * @useinstead ohos.uitest.Driver#create * @test */ static create(): UiDriver; @@ -451,7 +451,7 @@ declare class UiDriver { * @param y The y-coordinate. * @since 8 * @deprecated since 9 - * @useinstead {@link Driver.click} + * @useinstead ohos.uitest.Driver#click * @test */ click(x: number, y: number): Promise; @@ -489,7 +489,7 @@ declare class UiDriver { * @param endy The y-coordinate of the ending point. * @since 8 * @deprecated since 9 - * @useinstead {@link Driver.swipe} + * @useinstead ohos.uitest.Driver#swipe * @test */ swipe(startx: number, starty: number, endx: number, endy: number): Promise; @@ -1532,7 +1532,7 @@ declare class PointerMatrix { * @syscap SystemCapability.Test.UiTest * @since 8 * @deprecated since 9 - * @useinstead {@link ON} + * @useinstead ohos.uitest.ON * @test */ declare const BY: By; -- Gitee