2022-03-08 10:42:53 +00:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2022 Huawei Device Co., Ltd.
|
|
|
|
* Licensed under the Apache License,Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing,software
|
|
|
|
* distributed under the License is distributed on an "ASIS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*/
|
|
|
|
|
2023-12-11 09:08:03 +00:00
|
|
|
/**
|
|
|
|
* @file
|
2024-01-08 07:25:39 +00:00
|
|
|
* @kit TestKit
|
2023-12-11 09:08:03 +00:00
|
|
|
*/
|
|
|
|
|
2023-12-19 09:52:15 +00:00
|
|
|
import { Callback } from './@ohos.base';
|
2023-05-09 12:04:09 +00:00
|
|
|
|
2022-09-14 13:07:20 +00:00
|
|
|
/**
|
|
|
|
* Enumerates the string value match pattern.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
2023-05-06 08:19:22 +00:00
|
|
|
* @enum {number}
|
2022-09-14 13:07:20 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 8
|
|
|
|
*/
|
2023-06-13 08:18:22 +00:00
|
|
|
/**
|
|
|
|
* Enumerates the string value match pattern.
|
|
|
|
*
|
|
|
|
* @enum {number}
|
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @crossplatform
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* Enumerates the string value match pattern.
|
|
|
|
*
|
|
|
|
* @enum {number}
|
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @crossplatform
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
*/
|
2022-09-14 13:07:20 +00:00
|
|
|
declare enum MatchPattern {
|
|
|
|
/**
|
|
|
|
* Equals to a string.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
2022-09-14 13:07:20 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 8
|
|
|
|
* @test
|
|
|
|
*/
|
2023-06-13 08:18:22 +00:00
|
|
|
/**
|
|
|
|
* Equals to a string.
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @crossplatform
|
|
|
|
* @since 10
|
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* Equals to a string.
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @crossplatform
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2022-09-14 13:07:20 +00:00
|
|
|
EQUALS = 0,
|
|
|
|
/**
|
|
|
|
* Contains a substring.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
2022-09-14 13:07:20 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 8
|
|
|
|
* @test
|
|
|
|
*/
|
2023-06-13 08:18:22 +00:00
|
|
|
/**
|
2023-11-02 09:28:53 +00:00
|
|
|
* Contains a substring.
|
2023-06-13 08:18:22 +00:00
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @crossplatform
|
|
|
|
* @since 10
|
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* Contains a substring.
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @crossplatform
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2022-09-14 13:07:20 +00:00
|
|
|
CONTAINS = 1,
|
|
|
|
/**
|
|
|
|
* StartsWith a substring.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
2022-09-14 13:07:20 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 8
|
|
|
|
* @test
|
|
|
|
*/
|
2023-06-13 08:18:22 +00:00
|
|
|
/**
|
|
|
|
* StartsWith a substring.
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @crossplatform
|
|
|
|
* @since 10
|
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* StartsWith a substring.
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @crossplatform
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2022-09-14 13:07:20 +00:00
|
|
|
STARTS_WITH = 2,
|
|
|
|
/**
|
|
|
|
* EndsWith a substring.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
2022-09-14 13:07:20 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 8
|
|
|
|
* @test
|
|
|
|
*/
|
2023-06-13 08:18:22 +00:00
|
|
|
/**
|
|
|
|
* EndsWith a substring.
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @crossplatform
|
|
|
|
* @since 10
|
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* EndsWith a substring.
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @crossplatform
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2022-09-14 13:07:20 +00:00
|
|
|
ENDS_WITH = 3
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Describes the attribute requirements for the target UiComponents.
|
|
|
|
*
|
2023-05-06 06:29:02 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
2022-09-14 13:07:20 +00:00
|
|
|
* @since 8
|
|
|
|
* @deprecated since 9
|
2023-06-13 09:36:02 +00:00
|
|
|
* @useinstead ohos.UiTest.On
|
2022-09-14 13:07:20 +00:00
|
|
|
*/
|
|
|
|
declare class By {
|
|
|
|
/**
|
|
|
|
* Specifies the text for the target UiComponent.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @param { string } txt The text value.
|
|
|
|
* @param { MatchPattern } pattern The {@link MatchPattern} of the text value,default to {@link MatchPattern.EQUALS}
|
|
|
|
* @returns { By } this {@link By} object.
|
2022-09-14 13:07:20 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 8
|
2022-10-11 13:22:18 +00:00
|
|
|
* @deprecated since 9
|
2023-06-13 09:36:02 +00:00
|
|
|
* @useinstead ohos.UiTest.On#text
|
2022-09-14 13:07:20 +00:00
|
|
|
* @test
|
|
|
|
*/
|
|
|
|
text(txt: string, pattern?: MatchPattern): By;
|
|
|
|
|
|
|
|
/**
|
2022-10-11 13:22:18 +00:00
|
|
|
* Specifies the inspector key of the target UiComponent.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @param { string } key The inspectorKey value.
|
|
|
|
* @returns { By } this {@link By} object.
|
2022-09-14 13:07:20 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 8
|
2022-10-11 13:22:18 +00:00
|
|
|
* @deprecated since 9
|
2023-06-13 09:36:02 +00:00
|
|
|
* @useinstead ohos.UiTest.On#id
|
2022-09-14 13:07:20 +00:00
|
|
|
* @test
|
|
|
|
*/
|
|
|
|
key(key: string): By;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Specifies the id of the target UiComponent.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @param { number } id The id value.
|
|
|
|
* @returns { By } this {@link By} object.
|
2022-09-14 13:07:20 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 8
|
2022-10-11 13:22:18 +00:00
|
|
|
* @deprecated since 9
|
2022-09-14 13:07:20 +00:00
|
|
|
* @test
|
|
|
|
*/
|
|
|
|
id(id: number): By;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Specifies the type of the target UiComponent.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @param { string } tp The type value.
|
|
|
|
* @returns { By } this {@link By} object.
|
2022-09-14 13:07:20 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 8
|
2022-10-11 13:22:18 +00:00
|
|
|
* @deprecated since 9
|
2023-06-13 09:36:02 +00:00
|
|
|
* @useinstead ohos.UiTest.On#type
|
2022-09-14 13:07:20 +00:00
|
|
|
* @test
|
|
|
|
*/
|
|
|
|
type(tp: string): By;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Specifies the clickable status of the target UiComponent.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @param { boolean } b The clickable status,default to true.
|
|
|
|
* @returns { By } this {@link By} object.
|
2022-09-14 13:07:20 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 8
|
2022-10-11 13:22:18 +00:00
|
|
|
* @deprecated since 9
|
2023-06-13 09:36:02 +00:00
|
|
|
* @useinstead ohos.UiTest.On#clickable
|
2022-09-14 13:07:20 +00:00
|
|
|
* @test
|
|
|
|
*/
|
|
|
|
clickable(b?: boolean): By;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Specifies the scrollable status of the target UiComponent.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @param { boolean } b The scrollable status,default to true.
|
|
|
|
* @returns { By } this {@link By} object.
|
2022-09-14 13:07:20 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 8
|
2022-10-11 13:22:18 +00:00
|
|
|
* @deprecated since 9
|
2023-06-13 09:36:02 +00:00
|
|
|
* @useinstead ohos.UiTest.On#scrollable
|
2022-09-14 13:07:20 +00:00
|
|
|
* @test
|
|
|
|
*/
|
|
|
|
scrollable(b?: boolean): By;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Specifies the enabled status of the target UiComponent.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @param { boolean } b The enabled status,default to true.
|
|
|
|
* @returns { By } this {@link By} object.
|
2022-09-14 13:07:20 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 8
|
2022-10-11 13:22:18 +00:00
|
|
|
* @deprecated since 9
|
2023-06-13 09:36:02 +00:00
|
|
|
* @useinstead ohos.UiTest.On#enabled
|
2022-09-14 13:07:20 +00:00
|
|
|
* @test
|
|
|
|
*/
|
|
|
|
enabled(b?: boolean): By;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Specifies the focused status of the target UiComponent.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @param { boolean } b The focused status,default to true.
|
|
|
|
* @returns { By } this {@link By} object.
|
2022-09-14 13:07:20 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 8
|
2022-10-11 13:22:18 +00:00
|
|
|
* @deprecated since 9
|
2023-06-13 09:36:02 +00:00
|
|
|
* @useinstead ohos.UiTest.On#focused
|
2022-09-14 13:07:20 +00:00
|
|
|
* @test
|
|
|
|
*/
|
|
|
|
focused(b?: boolean): By;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Specifies the selected status of the target UiComponent.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @param { boolean } b The selected status,default to true.
|
|
|
|
* @returns { By } this {@link By} object.
|
2022-09-14 13:07:20 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 8
|
2022-10-11 13:22:18 +00:00
|
|
|
* @deprecated since 9
|
2023-06-13 09:36:02 +00:00
|
|
|
* @useinstead ohos.UiTest.On#selected
|
2022-09-14 13:07:20 +00:00
|
|
|
* @test
|
|
|
|
*/
|
|
|
|
selected(b?: boolean): By;
|
|
|
|
|
|
|
|
/**
|
2022-10-11 13:22:18 +00:00
|
|
|
* Requires the target UiComponent which is before another UiComponent that specified by the given {@link By}
|
2022-09-14 13:07:20 +00:00
|
|
|
* object,used to locate UiComponent relatively.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @param { By } by Describes the attribute requirements of UiComponent which the target one is in front of.
|
|
|
|
* @returns { By } this {@link By} object.
|
2022-09-14 13:07:20 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 8
|
2022-10-11 13:22:18 +00:00
|
|
|
* @deprecated since 9
|
2023-06-13 09:36:02 +00:00
|
|
|
* @useinstead ohos.UiTest.On#isBefore
|
2022-09-14 13:07:20 +00:00
|
|
|
* @test
|
|
|
|
*/
|
|
|
|
isBefore(by: By): By;
|
|
|
|
|
|
|
|
/**
|
2022-10-11 13:22:18 +00:00
|
|
|
* Requires the target UiComponent which is after another UiComponent that specified by the given {@link By}
|
2022-09-14 13:07:20 +00:00
|
|
|
* object,used to locate UiComponent relatively.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @param { By } by Describes the attribute requirements of UiComponent which the target one is in back of.
|
|
|
|
* @returns { By } this {@link By} object.
|
2022-09-14 13:07:20 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 8
|
2022-10-11 13:22:18 +00:00
|
|
|
* @deprecated since 9
|
2023-06-13 09:36:02 +00:00
|
|
|
* @useinstead ohos.UiTest.On#isAfter
|
2022-09-14 13:07:20 +00:00
|
|
|
* @test
|
|
|
|
*/
|
|
|
|
isAfter(by: By): By;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Represents a UiComponent of the ohos application,user can perform operations or query attributes on it.
|
|
|
|
*
|
2023-05-06 06:29:02 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
2022-09-14 13:07:20 +00:00
|
|
|
* @since 8
|
|
|
|
* @deprecated since 9
|
2022-10-11 14:16:29 +00:00
|
|
|
* @useinstead ohos.uitest.Component
|
2022-09-14 13:07:20 +00:00
|
|
|
* @test
|
|
|
|
*/
|
|
|
|
declare class UiComponent {
|
|
|
|
/**
|
|
|
|
* Click this {@link UiComponent}.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @returns { Promise<void> }
|
2022-09-14 13:07:20 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 8
|
2022-10-11 13:22:18 +00:00
|
|
|
* @deprecated since 9
|
2023-06-13 09:36:02 +00:00
|
|
|
* @useinstead ohos.UiTest.Component#click
|
2022-09-14 13:07:20 +00:00
|
|
|
* @test
|
|
|
|
*/
|
|
|
|
click(): Promise<void>;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Double click this {@link UiComponent}.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @returns { Promise<void> }
|
2022-09-14 13:07:20 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 8
|
2022-10-11 13:22:18 +00:00
|
|
|
* @deprecated since 9
|
2023-06-13 09:36:02 +00:00
|
|
|
* @useinstead ohos.UiTest.Component#doubleClick
|
2022-09-14 13:07:20 +00:00
|
|
|
* @test
|
|
|
|
*/
|
|
|
|
doubleClick(): Promise<void>;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Long click this {@link UiComponent}.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @returns { Promise<void> }
|
2022-09-14 13:07:20 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 8
|
2022-10-11 13:22:18 +00:00
|
|
|
* @deprecated since 9
|
2023-06-13 09:36:02 +00:00
|
|
|
* @useinstead ohos.UiTest.Component#longClick
|
2022-09-14 13:07:20 +00:00
|
|
|
* @test
|
|
|
|
*/
|
|
|
|
longClick(): Promise<void>;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the id attribute value.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @returns { Promise<number> } the id value.
|
2022-09-14 13:07:20 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 8
|
2022-10-11 13:22:18 +00:00
|
|
|
* @deprecated since 9
|
2022-09-14 13:07:20 +00:00
|
|
|
* @test
|
|
|
|
*/
|
|
|
|
getId(): Promise<number>;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the inspectorKey attribute value.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @returns { Promise<string> } the inspectorKey value.
|
2022-09-14 13:07:20 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 8
|
2022-10-11 13:22:18 +00:00
|
|
|
* @deprecated since 9
|
2023-06-13 09:36:02 +00:00
|
|
|
* @useinstead ohos.UiTest.Component#getId
|
2022-09-14 13:07:20 +00:00
|
|
|
* @test
|
|
|
|
*/
|
|
|
|
getKey(): Promise<string>;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the text attribute value.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @returns { Promise<string> } the text value.
|
2022-09-14 13:07:20 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 8
|
2022-10-11 13:22:18 +00:00
|
|
|
* @deprecated since 9
|
2023-06-13 09:36:02 +00:00
|
|
|
* @useinstead ohos.UiTest.Component#getText
|
2022-09-14 13:07:20 +00:00
|
|
|
* @test
|
|
|
|
*/
|
|
|
|
getText(): Promise<string>;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the type name.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @returns { Promise<string> } the type name.
|
2022-09-14 13:07:20 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 8
|
2022-10-11 13:22:18 +00:00
|
|
|
* @deprecated since 9
|
2023-06-13 09:36:02 +00:00
|
|
|
* @useinstead ohos.UiTest.Component#getType
|
2022-09-14 13:07:20 +00:00
|
|
|
* @test
|
|
|
|
*/
|
|
|
|
getType(): Promise<string>;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the clickable status of this {@link UiComponent}.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @returns { Promise<boolean> } the clickable status.
|
2022-09-14 13:07:20 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 8
|
2022-10-11 13:22:18 +00:00
|
|
|
* @deprecated since 9
|
2023-06-13 09:36:02 +00:00
|
|
|
* @useinstead ohos.UiTest.Component#isClickable
|
2022-09-14 13:07:20 +00:00
|
|
|
* @test
|
|
|
|
*/
|
|
|
|
isClickable(): Promise<boolean>;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the scrollable status of this {@link UiComponent}.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @returns { Promise<boolean> } the scrollable status.
|
2022-09-14 13:07:20 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 8
|
2022-10-11 13:22:18 +00:00
|
|
|
* @deprecated since 9
|
2023-06-13 09:36:02 +00:00
|
|
|
* @useinstead ohos.UiTest.Component#isScrollable
|
2022-09-14 13:07:20 +00:00
|
|
|
* @test
|
|
|
|
*/
|
|
|
|
isScrollable(): Promise<boolean>;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the enabled status of this {@link UiComponent}.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @returns { Promise<boolean> } the enabled status.
|
2022-09-14 13:07:20 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 8
|
2022-10-11 13:22:18 +00:00
|
|
|
* @deprecated since 9
|
2023-06-13 09:36:02 +00:00
|
|
|
* @useinstead ohos.UiTest.Component#isEnabled
|
2022-09-14 13:07:20 +00:00
|
|
|
* @test
|
|
|
|
*/
|
|
|
|
isEnabled(): Promise<boolean>;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the focused status of this {@link UiComponent}.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @returns { Promise<boolean> } the focused status.
|
2022-09-14 13:07:20 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 8
|
2022-10-11 13:22:18 +00:00
|
|
|
* @deprecated since 9
|
2023-06-13 09:36:02 +00:00
|
|
|
* @useinstead ohos.UiTest.Component#isFocused
|
2022-09-14 13:07:20 +00:00
|
|
|
* @test
|
|
|
|
*/
|
|
|
|
isFocused(): Promise<boolean>;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the selected status of this {@link UiComponent}.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @returns { Promise<boolean> } the selected status.
|
2022-09-14 13:07:20 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 8
|
2022-10-11 13:22:18 +00:00
|
|
|
* @deprecated since 9
|
2023-06-13 09:36:02 +00:00
|
|
|
* @useinstead ohos.UiTest.Component#isSelected
|
2022-09-14 13:07:20 +00:00
|
|
|
* @test
|
|
|
|
*/
|
|
|
|
isSelected(): Promise<boolean>;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Inject text to this {@link UiComponent},applicable to TextInput.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @param { string } text The text to inject.
|
|
|
|
* @returns { Promise<void> }
|
2022-09-14 13:07:20 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 8
|
2022-10-11 13:22:18 +00:00
|
|
|
* @deprecated since 9
|
2023-06-13 09:36:02 +00:00
|
|
|
* @useinstead ohos.UiTest.Component#inputText
|
2022-09-14 13:07:20 +00:00
|
|
|
* @test
|
|
|
|
*/
|
|
|
|
inputText(text: string): Promise<void>;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Scroll on this {@link UiComponent}to find matched {@link UiComponent},applicable to scrollable one.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @param { By } by The attribute requirements of the target {@link UiComponent}.
|
|
|
|
* @returns { Promise<UiComponent> } the found result,or undefined if not found.
|
2022-09-14 13:07:20 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 8
|
2022-10-11 13:22:18 +00:00
|
|
|
* @deprecated since 9
|
2023-06-13 09:36:02 +00:00
|
|
|
* @useinstead ohos.UiTest.Component#scrollSearch
|
2022-09-14 13:07:20 +00:00
|
|
|
* @test
|
|
|
|
*/
|
|
|
|
scrollSearch(by: By): Promise<UiComponent>;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 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.
|
|
|
|
*
|
2023-05-06 06:29:02 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
2022-09-14 13:07:20 +00:00
|
|
|
* @since 8
|
|
|
|
* @deprecated since 9
|
2022-10-11 14:16:29 +00:00
|
|
|
* @useinstead ohos.uitest.Driver
|
2022-09-14 13:07:20 +00:00
|
|
|
* @test
|
|
|
|
*/
|
|
|
|
declare class UiDriver {
|
|
|
|
/**
|
|
|
|
* Create an {@link UiDriver} object.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @returns { UiDriver } the {@link UiDriver} object.
|
2022-09-14 13:07:20 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 8
|
2022-10-11 13:22:18 +00:00
|
|
|
* @deprecated since 9
|
2023-06-13 09:36:02 +00:00
|
|
|
* @useinstead ohos.UiTest.Driver#create
|
2022-09-14 13:07:20 +00:00
|
|
|
* @test
|
|
|
|
*/
|
|
|
|
static create(): UiDriver;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Delay with specified duration.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @param { number } duration The delay duration in milliseconds.
|
|
|
|
* @returns { Promise<void> }
|
2022-09-14 13:07:20 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 8
|
2022-10-11 13:22:18 +00:00
|
|
|
* @deprecated since 9
|
2023-06-13 09:36:02 +00:00
|
|
|
* @useinstead ohos.UiTest.Driver#delayMs
|
2022-09-14 13:07:20 +00:00
|
|
|
* @test
|
|
|
|
*/
|
|
|
|
delayMs(duration: number): Promise<void>;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Find the first matched {@link UiComponent} on current UI.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @param { By } by The attribute requirements of the target {@link UiComponent}.
|
|
|
|
* @returns { Promise<UiComponent> } the first matched {@link UiComponent} or undefined.
|
2022-09-14 13:07:20 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 8
|
2022-10-11 13:22:18 +00:00
|
|
|
* @deprecated since 9
|
2023-06-13 09:36:02 +00:00
|
|
|
* @useinstead ohos.UiTest.Driver#findComponent
|
2022-09-14 13:07:20 +00:00
|
|
|
* @test
|
|
|
|
*/
|
|
|
|
findComponent(by: By): Promise<UiComponent>;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Find all the matched {@link UiComponent}s on current UI.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @param { By } by The attribute requirements of the target {@link UiComponent}.
|
|
|
|
* @returns { Promise<Array<UiComponent>> } the matched {@link UiComponent}s list.
|
2022-09-14 13:07:20 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 8
|
2022-10-11 13:22:18 +00:00
|
|
|
* @deprecated since 9
|
2023-06-13 09:36:02 +00:00
|
|
|
* @useinstead ohos.UiTest.Driver#findComponents
|
2022-09-14 13:07:20 +00:00
|
|
|
* @test
|
|
|
|
*/
|
|
|
|
findComponents(by: By): Promise<Array<UiComponent>>;
|
|
|
|
|
|
|
|
/**
|
2023-01-17 08:17:09 +00:00
|
|
|
* Assert the matched {@link UiComponent}s exists on current UI;if not,assertError will be raised.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @param { By } by The attribute requirements of the target {@link UiComponent}.
|
|
|
|
* @returns { Promise<void> }
|
|
|
|
* @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.
|
2022-09-14 13:07:20 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 8
|
2022-10-11 13:22:18 +00:00
|
|
|
* @deprecated since 9
|
2023-06-13 09:36:02 +00:00
|
|
|
* @useinstead ohos.UiTest.Driver#assertComponentExist
|
2022-09-14 13:07:20 +00:00
|
|
|
* @test
|
|
|
|
*/
|
|
|
|
assertComponentExist(by: By): Promise<void>;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Press the BACK key.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @returns { Promise<void> }
|
2022-09-14 13:07:20 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 8
|
2022-10-11 13:22:18 +00:00
|
|
|
* @deprecated since 9
|
2023-06-13 09:36:02 +00:00
|
|
|
* @useinstead ohos.UiTest.Driver#pressBack
|
2022-09-14 13:07:20 +00:00
|
|
|
* @test
|
|
|
|
*/
|
|
|
|
pressBack(): Promise<void>;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Press the specified key.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @param { number } keyCode the target keyCode.
|
|
|
|
* @returns { Promise<void> }
|
2022-09-14 13:07:20 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 8
|
2022-10-11 13:22:18 +00:00
|
|
|
* @deprecated since 9
|
2023-06-14 01:46:13 +00:00
|
|
|
* @useinstead ohos.UiTest.Driver#triggerKey
|
2022-09-14 13:07:20 +00:00
|
|
|
* @test
|
|
|
|
*/
|
|
|
|
triggerKey(keyCode: number): Promise<void>;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Click on the specified location on the screen.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @param { number } x The x-coordinate.
|
|
|
|
* @param { number } y The y-coordinate.
|
|
|
|
* @returns { Promise<void> }
|
2022-09-14 13:07:20 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 8
|
2022-10-11 13:22:18 +00:00
|
|
|
* @deprecated since 9
|
2023-06-13 09:36:02 +00:00
|
|
|
* @useinstead ohos.UiTest.Driver#click
|
2022-09-14 13:07:20 +00:00
|
|
|
* @test
|
|
|
|
*/
|
|
|
|
click(x: number, y: number): Promise<void>;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* DoubleClick on the specified location on the screen.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @param { number } x The x-coordinate.
|
|
|
|
* @param { number } y The y-coordinate.
|
|
|
|
* @returns { Promise<void> }
|
2022-09-14 13:07:20 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 8
|
2022-10-11 13:22:18 +00:00
|
|
|
* @deprecated since 9
|
2023-06-13 09:36:02 +00:00
|
|
|
* @useinstead ohos.UiTest.Driver#doubleClick
|
2022-09-14 13:07:20 +00:00
|
|
|
* @test
|
|
|
|
*/
|
|
|
|
doubleClick(x: number, y: number): Promise<void>;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* LongClick on the specified location on the screen.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @param { number } x The x-coordinate.
|
|
|
|
* @param { number } y The y-coordinate.
|
|
|
|
* @returns { Promise<void> }
|
2022-09-14 13:07:20 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 8
|
2022-10-11 13:22:18 +00:00
|
|
|
* @deprecated since 9
|
2023-06-13 09:36:02 +00:00
|
|
|
* @useinstead ohos.UiTest.Driver#longClick
|
2022-09-14 13:07:20 +00:00
|
|
|
* @test
|
|
|
|
*/
|
|
|
|
longClick(x: number, y: number): Promise<void>;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Swipe on the screen between the specified points.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @param { number } startx The x-coordinate of the starting point.
|
|
|
|
* @param { number } starty The y-coordinate of the starting point.
|
|
|
|
* @param { number } endx The x-coordinate of the ending point.
|
|
|
|
* @param { number } endy The y-coordinate of the ending point.
|
|
|
|
* @returns { Promise<void> }
|
2022-09-14 13:07:20 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 8
|
2022-10-11 13:22:18 +00:00
|
|
|
* @deprecated since 9
|
2023-06-13 09:36:02 +00:00
|
|
|
* @useinstead ohos.UiTest.Driver#swipe
|
2022-09-14 13:07:20 +00:00
|
|
|
* @test
|
|
|
|
*/
|
|
|
|
swipe(startx: number, starty: number, endx: number, endy: number): Promise<void>;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Capture current screen and save as picture which PNG format.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @param { string } savePath the path where to store the picture.
|
|
|
|
* @returns { Promise<boolean> } true if screen-capturing and file-storing are completed successfully,false otherwise.
|
2022-09-14 13:07:20 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 8
|
2022-10-11 13:22:18 +00:00
|
|
|
* @deprecated since 9
|
2023-06-13 09:36:02 +00:00
|
|
|
* @useinstead ohos.uitest.Driver#screenCap
|
2022-09-14 13:07:20 +00:00
|
|
|
* @test
|
|
|
|
*/
|
|
|
|
screenCap(savePath: string): Promise<boolean>;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2023-01-17 08:17:09 +00:00
|
|
|
* Enumerates the window mode of the tested window.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @enum { number }
|
2022-09-14 13:07:20 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 9
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* Enumerates the window mode of the tested window.
|
|
|
|
*
|
|
|
|
* @enum { number }
|
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-01-17 08:17:09 +00:00
|
|
|
declare enum WindowMode {
|
|
|
|
/**
|
|
|
|
* The test window is a full screen window.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
2023-01-17 08:17:09 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 9
|
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* The test window is a full screen window.
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2023-01-17 08:17:09 +00:00
|
|
|
FULLSCREEN = 0,
|
|
|
|
/**
|
|
|
|
* The test window is the first window in the split screen state.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
2023-01-17 08:17:09 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 9
|
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* The test window is the first window in the split screen state.
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2023-01-17 08:17:09 +00:00
|
|
|
PRIMARY = 1,
|
|
|
|
/**
|
|
|
|
* The test window is the second window in the split screen state.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
2023-01-17 08:17:09 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 9
|
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* The test window is the second window in the split screen state.
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2023-01-17 08:17:09 +00:00
|
|
|
SECONDARY = 2,
|
|
|
|
/**
|
|
|
|
* The test window is a floating window.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
2023-01-17 08:17:09 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 9
|
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* The test window is a floating window.
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2023-01-17 08:17:09 +00:00
|
|
|
FLOATING = 3
|
2022-09-14 13:07:20 +00:00
|
|
|
}
|
|
|
|
|
2022-06-01 02:58:47 +00:00
|
|
|
/**
|
2023-01-17 08:17:09 +00:00
|
|
|
* Enumerates the resize direction for the window.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @enum { number }
|
2022-07-14 02:47:32 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
2022-06-01 02:58:47 +00:00
|
|
|
* @since 9
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* Enumerates the resize direction for the window.
|
|
|
|
*
|
|
|
|
* @enum { number }
|
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-01-17 08:17:09 +00:00
|
|
|
declare enum ResizeDirection {
|
|
|
|
/**
|
|
|
|
* Left.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
2023-01-17 08:17:09 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 9
|
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* Left.
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2023-01-17 08:17:09 +00:00
|
|
|
LEFT = 0,
|
|
|
|
/**
|
|
|
|
* Right.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
2023-01-17 08:17:09 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 9
|
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* Right.
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2023-01-17 08:17:09 +00:00
|
|
|
RIGHT = 1,
|
|
|
|
/**
|
|
|
|
* Up.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
2023-01-17 08:17:09 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 9
|
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* Up.
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2023-01-17 08:17:09 +00:00
|
|
|
UP = 2,
|
|
|
|
/**
|
|
|
|
* Down.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
2023-01-17 08:17:09 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 9
|
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* Down.
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2023-01-17 08:17:09 +00:00
|
|
|
DOWN = 3,
|
|
|
|
/**
|
|
|
|
* Upper left.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
2023-01-17 08:17:09 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 9
|
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* Upper left.
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2023-01-17 08:17:09 +00:00
|
|
|
LEFT_UP = 4,
|
|
|
|
/**
|
|
|
|
* Lower left.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
2023-01-17 08:17:09 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 9
|
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* Lower left.
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2023-01-17 08:17:09 +00:00
|
|
|
LEFT_DOWN = 5,
|
|
|
|
/**
|
|
|
|
* Upper right.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
2023-01-17 08:17:09 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 9
|
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* Upper right.
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2023-01-17 08:17:09 +00:00
|
|
|
RIGHT_UP = 6,
|
|
|
|
/**
|
|
|
|
* Lower right.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
2023-01-17 08:17:09 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 9
|
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* Lower right.
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2023-04-21 09:47:24 +00:00
|
|
|
RIGHT_DOWN = 7
|
2022-09-14 13:07:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2023-01-17 08:17:09 +00:00
|
|
|
* Enumerates the rotation of the device display.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @enum { number }
|
2022-09-14 13:07:20 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 9
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* Enumerates the rotation of the device display.
|
|
|
|
*
|
|
|
|
* @enum { number }
|
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-04-21 09:47:24 +00:00
|
|
|
declare enum DisplayRotation {
|
2023-01-17 08:17:09 +00:00
|
|
|
/**
|
2023-01-17 08:24:11 +00:00
|
|
|
* Device display does not rotate to display vertically.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
2023-01-17 08:17:09 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 9
|
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* Device display does not rotate to display vertically.
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2023-01-17 08:17:09 +00:00
|
|
|
ROTATION_0 = 0,
|
|
|
|
/**
|
|
|
|
* Device display rotates 90 degrees clockwise to display horizontally.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
2023-01-17 08:17:09 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 9
|
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* Device display rotates 90 degrees clockwise to display horizontally.
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2023-01-17 08:17:09 +00:00
|
|
|
ROTATION_90 = 1,
|
|
|
|
/**
|
|
|
|
* Device display rotates clockwise 180 degrees to display vertically in reverse.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
2023-01-17 08:17:09 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 9
|
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* Device display rotates clockwise 180 degrees to display vertically in reverse.
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2023-01-17 08:17:09 +00:00
|
|
|
ROTATION_180 = 2,
|
|
|
|
/**
|
|
|
|
* Device display rotates 270 degrees clockwise to display horizontally in reverse.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
2023-01-17 08:17:09 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 9
|
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* Device display rotates 270 degrees clockwise to display horizontally in reverse.
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2023-01-17 08:17:09 +00:00
|
|
|
ROTATION_270 = 3
|
2022-09-14 13:07:20 +00:00
|
|
|
}
|
|
|
|
|
2022-03-08 10:42:53 +00:00
|
|
|
/**
|
2022-09-14 13:07:20 +00:00
|
|
|
* Represents the point on the device screen.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
2023-01-17 08:17:09 +00:00
|
|
|
* @typedef Point
|
2022-07-14 02:47:32 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
2022-09-14 13:07:20 +00:00
|
|
|
* @since 9
|
2022-03-08 10:42:53 +00:00
|
|
|
*/
|
2023-06-13 08:18:22 +00:00
|
|
|
/**
|
|
|
|
* Represents the point on the device screen.
|
|
|
|
*
|
|
|
|
* @typedef Point
|
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @crossplatform
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* Represents the point on the device screen.
|
|
|
|
*
|
|
|
|
* @typedef Point
|
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @crossplatform
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
*/
|
2022-09-14 13:07:20 +00:00
|
|
|
declare interface Point {
|
2023-01-17 08:17:09 +00:00
|
|
|
/**
|
|
|
|
* The x-coordinate of the coordinate point.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @type { number }
|
2024-11-12 06:34:31 +00:00
|
|
|
* @readonly
|
2023-05-06 06:29:02 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
2023-01-17 08:17:09 +00:00
|
|
|
* @since 9
|
|
|
|
*/
|
2023-06-13 08:18:22 +00:00
|
|
|
/**
|
|
|
|
* The x-coordinate of the coordinate point.
|
|
|
|
*
|
2023-06-13 09:36:02 +00:00
|
|
|
* @type { number }
|
2024-11-12 06:34:31 +00:00
|
|
|
* @readonly
|
2023-06-13 08:18:22 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @crossplatform
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* The x-coordinate of the coordinate point.
|
|
|
|
*
|
|
|
|
* @type { number }
|
2024-11-12 06:23:37 +00:00
|
|
|
* @readonly
|
2023-11-09 09:12:06 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @crossplatform
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-02-14 02:28:01 +00:00
|
|
|
readonly x: number;
|
2023-01-17 08:17:09 +00:00
|
|
|
/**
|
|
|
|
* The y-coordinate of the coordinate point.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @type { number }
|
2024-11-12 06:34:31 +00:00
|
|
|
* @readonly
|
2023-05-06 06:29:02 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
2023-01-17 08:17:09 +00:00
|
|
|
* @since 9
|
|
|
|
*/
|
2023-06-13 08:18:22 +00:00
|
|
|
/**
|
|
|
|
* The y-coordinate of the coordinate point.
|
|
|
|
*
|
2023-06-13 09:36:02 +00:00
|
|
|
* @type { number }
|
2024-11-12 06:34:31 +00:00
|
|
|
* @readonly
|
2023-06-13 08:18:22 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @crossplatform
|
|
|
|
* @since 10
|
2023-11-09 09:12:06 +00:00
|
|
|
*/
|
2023-11-09 12:08:41 +00:00
|
|
|
/**
|
2023-11-09 09:12:06 +00:00
|
|
|
* The y-coordinate of the coordinate point.
|
|
|
|
*
|
|
|
|
* @type { number }
|
2024-11-12 06:23:37 +00:00
|
|
|
* @readonly
|
2023-11-09 09:12:06 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @crossplatform
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
2023-06-13 08:18:22 +00:00
|
|
|
*/
|
2023-02-14 02:28:01 +00:00
|
|
|
readonly y: number;
|
2022-03-08 10:42:53 +00:00
|
|
|
}
|
|
|
|
|
2022-09-14 13:07:20 +00:00
|
|
|
/**
|
|
|
|
* Represents the rectangle area on the device screen.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @typedef Rect
|
2022-09-14 13:07:20 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 9
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* Represents the rectangle area on the device screen.
|
|
|
|
*
|
|
|
|
* @typedef Rect
|
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
*/
|
2024-05-07 08:43:00 +00:00
|
|
|
/**
|
|
|
|
* Represents the rectangle area on the device screen.
|
|
|
|
*
|
|
|
|
* @typedef Rect
|
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @crossplatform
|
|
|
|
* @atomicservice
|
|
|
|
* @since 12
|
|
|
|
*/
|
2022-09-14 13:07:20 +00:00
|
|
|
declare interface Rect {
|
2023-01-17 08:17:09 +00:00
|
|
|
/**
|
|
|
|
* The x-coordinate of the top left corner of the rectangle.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @type { number }
|
2024-11-12 06:34:31 +00:00
|
|
|
* @readonly
|
2023-05-06 06:29:02 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
2023-01-17 08:17:09 +00:00
|
|
|
* @since 9
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* The x-coordinate of the top left corner of the rectangle.
|
|
|
|
*
|
|
|
|
* @type { number }
|
2024-11-12 06:34:31 +00:00
|
|
|
* @readonly
|
2023-11-09 09:12:06 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
*/
|
2024-05-07 08:43:00 +00:00
|
|
|
/**
|
|
|
|
* The x-coordinate of the top left corner of the rectangle.
|
|
|
|
*
|
|
|
|
* @type { number }
|
2024-11-12 06:23:37 +00:00
|
|
|
* @readonly
|
2024-05-07 08:43:00 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @crossplatform
|
|
|
|
* @atomicservice
|
|
|
|
* @since 12
|
|
|
|
*/
|
2023-01-11 02:34:14 +00:00
|
|
|
readonly left: number;
|
2023-01-17 08:17:09 +00:00
|
|
|
/**
|
|
|
|
* The y-coordinate of the top left corner of the rectangle.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @type { number }
|
2024-11-12 06:34:31 +00:00
|
|
|
* @readonly
|
2023-05-06 06:29:02 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
2023-01-17 08:17:09 +00:00
|
|
|
* @since 9
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* The y-coordinate of the top left corner of the rectangle.
|
|
|
|
*
|
|
|
|
* @type { number }
|
2024-11-12 06:34:31 +00:00
|
|
|
* @readonly
|
2023-11-09 09:12:06 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
*/
|
2024-05-07 08:43:00 +00:00
|
|
|
/**
|
|
|
|
* The y-coordinate of the top left corner of the rectangle.
|
|
|
|
*
|
|
|
|
* @type { number }
|
2024-11-12 06:23:37 +00:00
|
|
|
* @readonly
|
2024-05-07 08:43:00 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @crossplatform
|
|
|
|
* @atomicservice
|
|
|
|
* @since 12
|
|
|
|
*/
|
2023-01-11 02:34:14 +00:00
|
|
|
readonly top: number;
|
2023-01-17 08:17:09 +00:00
|
|
|
/**
|
|
|
|
* The x-coordinate at the bottom right corner of the rectangle.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @type { number }
|
2024-11-12 06:34:31 +00:00
|
|
|
* @readonly
|
2023-05-06 06:29:02 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
2023-01-17 08:17:09 +00:00
|
|
|
* @since 9
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* The x-coordinate at the bottom right corner of the rectangle.
|
|
|
|
*
|
|
|
|
* @type { number }
|
2024-11-12 06:34:31 +00:00
|
|
|
* @readonly
|
2023-11-09 09:12:06 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
*/
|
2024-05-07 08:43:00 +00:00
|
|
|
/**
|
|
|
|
* The x-coordinate at the bottom right corner of the rectangle.
|
|
|
|
*
|
|
|
|
* @type { number }
|
2024-11-12 06:23:37 +00:00
|
|
|
* @readonly
|
2024-05-07 08:43:00 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @crossplatform
|
|
|
|
* @atomicservice
|
|
|
|
* @since 12
|
|
|
|
*/
|
2023-01-11 02:34:14 +00:00
|
|
|
readonly right: number;
|
2023-01-17 08:17:09 +00:00
|
|
|
/**
|
|
|
|
* The y-coordinate at the bottom right corner of the rectangle.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @type { number }
|
2024-11-12 06:34:31 +00:00
|
|
|
* @readonly
|
2023-05-06 06:29:02 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
2023-01-17 08:17:09 +00:00
|
|
|
* @since 9
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* The y-coordinate at the bottom right corner of the rectangle.
|
|
|
|
*
|
|
|
|
* @type { number }
|
2024-11-12 06:34:31 +00:00
|
|
|
* @readonly
|
2023-11-09 09:12:06 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
*/
|
2024-05-07 08:43:00 +00:00
|
|
|
/**
|
|
|
|
* The y-coordinate at the bottom right corner of the rectangle.
|
|
|
|
*
|
|
|
|
* @type { number }
|
2024-11-12 06:23:37 +00:00
|
|
|
* @readonly
|
2024-05-07 08:43:00 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @crossplatform
|
|
|
|
* @atomicservice
|
|
|
|
* @since 12
|
|
|
|
*/
|
2023-01-11 02:34:14 +00:00
|
|
|
readonly bottom: number;
|
2022-09-14 13:07:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Represents filer condition to get the window .
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
2023-01-17 08:17:09 +00:00
|
|
|
* @typedef WindowFilter
|
2022-09-14 13:07:20 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 9
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* Represents filer condition to get the window .
|
|
|
|
*
|
|
|
|
* @typedef WindowFilter
|
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
*/
|
2022-09-14 13:07:20 +00:00
|
|
|
declare interface WindowFilter {
|
2023-01-17 08:17:09 +00:00
|
|
|
/**
|
|
|
|
* The package name of the application which the window belongs to.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
2023-06-13 09:36:02 +00:00
|
|
|
* @type { ?string }
|
2023-05-06 06:29:02 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
2023-01-17 08:17:09 +00:00
|
|
|
* @since 9
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* The package name of the application which the window belongs to.
|
|
|
|
*
|
|
|
|
* @type { ?string }
|
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
*/
|
2022-11-24 03:58:12 +00:00
|
|
|
bundleName?: string;
|
2023-11-16 09:13:21 +00:00
|
|
|
|
2023-01-17 08:17:09 +00:00
|
|
|
/**
|
|
|
|
* The title of the window.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
2023-06-13 09:36:02 +00:00
|
|
|
* @type { ?string }
|
2023-05-06 06:29:02 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
2023-01-17 08:17:09 +00:00
|
|
|
* @since 9
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* The title of the window.
|
|
|
|
*
|
|
|
|
* @type { ?string }
|
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
*/
|
2022-11-24 03:58:12 +00:00
|
|
|
title?: string;
|
2023-11-16 09:13:21 +00:00
|
|
|
|
2023-01-17 08:17:09 +00:00
|
|
|
/**
|
|
|
|
* The focal state of the window.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
2023-06-13 09:36:02 +00:00
|
|
|
* @type { ?boolean }
|
2023-05-06 06:29:02 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
2023-01-17 08:17:09 +00:00
|
|
|
* @since 9
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* The focal state of the window.
|
|
|
|
*
|
|
|
|
* @type { ?boolean }
|
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
*/
|
2022-11-24 03:58:12 +00:00
|
|
|
focused?: boolean;
|
2023-11-16 09:13:21 +00:00
|
|
|
|
2023-04-21 09:47:24 +00:00
|
|
|
/**
|
2023-01-17 08:17:09 +00:00
|
|
|
* The active state of the window.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
2023-06-13 09:36:02 +00:00
|
|
|
* @type { ?boolean }
|
2023-05-06 06:29:02 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
2023-01-17 08:17:09 +00:00
|
|
|
* @since 9
|
2023-04-21 09:47:24 +00:00
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* The active state of the window.
|
|
|
|
*
|
|
|
|
* @type { ?boolean }
|
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 11
|
2023-11-16 09:13:21 +00:00
|
|
|
* @deprecated since 11
|
2023-11-16 09:26:54 +00:00
|
|
|
* @useinstead ohos.UiTest.WindowFilter#active
|
2023-11-09 09:12:06 +00:00
|
|
|
*/
|
|
|
|
actived?: boolean;
|
2023-11-16 09:13:21 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The active state of the window.
|
|
|
|
*
|
|
|
|
* @type { ?boolean }
|
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
*/
|
|
|
|
active?: boolean;
|
2023-11-09 09:12:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2023-05-09 12:04:09 +00:00
|
|
|
* Represents the information of an UI element, can be a component or window.
|
|
|
|
*
|
2023-05-15 03:40:19 +00:00
|
|
|
* @typedef UIElementInfo
|
2023-05-09 12:04:09 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 10
|
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* Represents the information of an UI element, can be a component or window.
|
|
|
|
*
|
|
|
|
* @typedef UIElementInfo
|
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2023-05-15 03:40:19 +00:00
|
|
|
declare interface UIElementInfo {
|
2023-05-09 12:04:09 +00:00
|
|
|
/**
|
|
|
|
* The bundle name of the host application.
|
|
|
|
* @type { string }
|
2024-11-12 06:34:31 +00:00
|
|
|
* @readonly
|
2023-05-09 12:04:09 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 10
|
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* The bundle name of the host application.
|
|
|
|
* @type { string }
|
2024-11-12 06:23:37 +00:00
|
|
|
* @readonly
|
2023-11-09 09:12:06 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2023-05-09 12:04:09 +00:00
|
|
|
readonly bundleName: string;
|
|
|
|
/**
|
2023-05-10 06:32:50 +00:00
|
|
|
* The component type, set it as 'window' if it's a window.
|
2023-05-09 12:04:09 +00:00
|
|
|
* @type { string }
|
2024-11-12 06:34:31 +00:00
|
|
|
* @readonly
|
2023-05-09 12:04:09 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 10
|
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* The component type, set it as 'window' if it's a window.
|
|
|
|
* @type { string }
|
2024-11-12 06:23:37 +00:00
|
|
|
* @readonly
|
2023-11-09 09:12:06 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2023-05-10 06:32:50 +00:00
|
|
|
readonly type: string;
|
2023-05-09 12:04:09 +00:00
|
|
|
/**
|
2023-05-10 06:32:50 +00:00
|
|
|
* The text of component, set it as window's title if it's a window.
|
2023-05-09 12:04:09 +00:00
|
|
|
* @type { string }
|
2024-11-12 06:34:31 +00:00
|
|
|
* @readonly
|
2023-05-09 12:04:09 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 10
|
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* The text of component, set it as window's title if it's a window.
|
|
|
|
* @type { string }
|
2024-11-12 06:23:37 +00:00
|
|
|
* @readonly
|
2023-11-09 09:12:06 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2023-05-10 06:32:50 +00:00
|
|
|
readonly text: string;
|
2023-05-09 12:04:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Observer to monitor UI events.
|
|
|
|
*
|
2023-05-15 03:40:19 +00:00
|
|
|
* @typedef UIEventObserver
|
2023-05-09 12:04:09 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 10
|
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* Observer to monitor UI events.
|
|
|
|
*
|
|
|
|
* @typedef UIEventObserver
|
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2023-05-15 03:40:19 +00:00
|
|
|
declare interface UIEventObserver {
|
2023-05-09 12:04:09 +00:00
|
|
|
/**
|
|
|
|
* Listen for toast show once
|
|
|
|
*
|
2023-06-13 10:12:44 +00:00
|
|
|
* @param { 'toastShow' } type 'toastShow'.
|
2023-05-15 03:40:19 +00:00
|
|
|
* @param { Callback<UIElementInfo> } callback function, returns the monitored UIElementInfo.
|
2023-05-09 12:04:09 +00:00
|
|
|
* @throws { BusinessError } 401 - if the input parameters are invalid.
|
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 10
|
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* Listen for toast show once
|
|
|
|
*
|
2023-12-20 02:30:28 +00:00
|
|
|
* @param { 'toastShow' } type -'toastShow'.
|
|
|
|
* @param { Callback<UIElementInfo> } callback - function, returns the monitored UIElementInfo.
|
2024-04-12 08:13:39 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2023-05-15 03:40:19 +00:00
|
|
|
once(type: 'toastShow', callback: Callback<UIElementInfo>): void;
|
2023-05-09 12:04:09 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Listen for dialog show once
|
|
|
|
*
|
2023-06-13 10:12:44 +00:00
|
|
|
* @param { 'dialogShow' } type 'dialogShow'.
|
2023-05-15 03:40:19 +00:00
|
|
|
* @param { Callback<UIElementInfo> } callback function, returns the monitored UIElementInfo.
|
2023-05-09 12:04:09 +00:00
|
|
|
* @throws { BusinessError } 401 - if the input parameters are invalid.
|
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 10
|
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* Listen for dialog show once
|
|
|
|
*
|
2023-12-20 02:30:28 +00:00
|
|
|
* @param { 'dialogShow' } type - 'dialogShow'.
|
|
|
|
* @param { Callback<UIElementInfo> } callback - function, returns the monitored UIElementInfo.
|
2024-04-12 08:13:39 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2023-05-15 03:40:19 +00:00
|
|
|
once(type: 'dialogShow', callback: Callback<UIElementInfo>): void;
|
2023-05-09 12:04:09 +00:00
|
|
|
}
|
|
|
|
|
2023-02-22 08:58:29 +00:00
|
|
|
/**
|
|
|
|
* Enumerates the direction for the UI operation .
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @enum { number }
|
2023-02-22 08:58:29 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* Enumerates the direction for the UI operation .
|
|
|
|
*
|
|
|
|
* @enum { number }
|
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
*/
|
2024-05-13 01:50:49 +00:00
|
|
|
/**
|
|
|
|
* Enumerates the direction for the UI operation .
|
|
|
|
*
|
|
|
|
* @enum { number }
|
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @crossplatform
|
|
|
|
* @atomicservice
|
|
|
|
* @since 12
|
|
|
|
*/
|
2023-03-01 01:42:16 +00:00
|
|
|
declare enum UiDirection {
|
2023-02-22 08:58:29 +00:00
|
|
|
/**
|
|
|
|
* Left.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
2023-02-22 08:58:29 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 10
|
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* Left.
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2024-05-13 01:50:49 +00:00
|
|
|
/**
|
|
|
|
* Left.
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @crossplatform
|
|
|
|
* @atomicservice
|
|
|
|
* @since 12
|
|
|
|
* @test
|
|
|
|
*/
|
2023-02-22 08:58:29 +00:00
|
|
|
LEFT = 0,
|
|
|
|
/**
|
|
|
|
* Right.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
2023-02-22 08:58:29 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 10
|
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* Right.
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2024-05-13 01:50:49 +00:00
|
|
|
/**
|
|
|
|
* Right.
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @crossplatform
|
|
|
|
* @atomicservice
|
|
|
|
* @since 12
|
|
|
|
* @test
|
|
|
|
*/
|
2023-02-22 08:58:29 +00:00
|
|
|
RIGHT = 1,
|
|
|
|
/**
|
|
|
|
* Up.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
2023-02-22 08:58:29 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 10
|
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* Up.
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2024-05-13 01:50:49 +00:00
|
|
|
/**
|
|
|
|
* Up.
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @crossplatform
|
|
|
|
* @atomicservice
|
|
|
|
* @since 12
|
|
|
|
* @test
|
|
|
|
*/
|
2023-02-22 08:58:29 +00:00
|
|
|
UP = 2,
|
|
|
|
/**
|
|
|
|
* Down.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
2023-02-22 08:58:29 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 10
|
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* Down.
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2024-05-13 01:50:49 +00:00
|
|
|
/**
|
|
|
|
* Down.
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @crossplatform
|
|
|
|
* @atomicservice
|
|
|
|
* @since 12
|
|
|
|
* @test
|
|
|
|
*/
|
2023-05-06 06:29:02 +00:00
|
|
|
DOWN = 3
|
2023-02-22 08:58:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Enumerates the id of the button on the mouse.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @enum { number }
|
2023-02-22 08:58:29 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* Enumerates the id of the button on the mouse.
|
|
|
|
*
|
|
|
|
* @enum { number }
|
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-02-22 09:55:03 +00:00
|
|
|
declare enum MouseButton {
|
2023-02-22 08:58:29 +00:00
|
|
|
/**
|
|
|
|
* Left button of the mouse.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
2023-02-22 08:58:29 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 10
|
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* Left button of the mouse.
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2023-02-22 08:58:29 +00:00
|
|
|
MOUSE_BUTTON_LEFT = 0,
|
|
|
|
/**
|
|
|
|
* Right button of the mouse..
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
2023-02-22 08:58:29 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 10
|
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* Right button of the mouse..
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2023-02-22 08:58:29 +00:00
|
|
|
MOUSE_BUTTON_RIGHT = 1,
|
|
|
|
/**
|
|
|
|
* MIDDLE button of the mouse.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
2023-02-22 08:58:29 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 10
|
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* MIDDLE button of the mouse.
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2023-05-06 06:29:02 +00:00
|
|
|
MOUSE_BUTTON_MIDDLE = 2
|
2023-02-22 08:58:29 +00:00
|
|
|
}
|
|
|
|
|
2022-09-14 13:07:20 +00:00
|
|
|
/**
|
|
|
|
* Describes the attribute requirements for the target Components.
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Test.UiTest
|
2023-05-06 06:29:02 +00:00
|
|
|
* @since 9
|
2022-09-14 13:07:20 +00:00
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* Describes the attribute requirements for the target Components.
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
*/
|
2024-05-07 08:43:00 +00:00
|
|
|
/**
|
|
|
|
* Describes the attribute requirements for the target Components.
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @crossplatform
|
|
|
|
* @atomicservice
|
|
|
|
* @since 12
|
|
|
|
*/
|
2022-09-14 13:07:20 +00:00
|
|
|
declare class On {
|
|
|
|
/**
|
|
|
|
* Specifies the text for the target Component.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @param { string } txt The text value.
|
|
|
|
* @param { MatchPattern } pattern The {@link MatchPattern} of the text value, default to {@link MatchPattern.EQUALS}
|
|
|
|
* @returns { On } this {@link On} object.
|
|
|
|
* @throws { BusinessError } 401 - if the input parameters are invalid.
|
2022-09-14 13:07:20 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 9
|
|
|
|
* @test
|
|
|
|
*/
|
2023-06-13 08:18:22 +00:00
|
|
|
/**
|
|
|
|
* Specifies the text for the target Component.
|
|
|
|
*
|
|
|
|
* @param { string } txt The text value.
|
|
|
|
* @param { MatchPattern } pattern The {@link MatchPattern} of the text value, default to {@link MatchPattern.EQUALS}
|
|
|
|
* @returns { On } this {@link On} object.
|
|
|
|
* @throws { BusinessError } 401 - if the input parameters are invalid.
|
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @crossplatform
|
|
|
|
* @since 10
|
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* Specifies the text for the target Component.
|
|
|
|
*
|
2023-12-20 02:30:28 +00:00
|
|
|
* @param { string } txt - the text value.
|
|
|
|
* @param { MatchPattern } [pattern] - the {@link MatchPattern} of the text value,Set it default {@link MatchPattern.EQUALS} if null or undefined.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @returns { On } this {@link On} object.
|
2024-04-12 08:13:39 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @crossplatform
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2022-09-14 13:07:20 +00:00
|
|
|
text(txt: string, pattern?: MatchPattern): On;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Specifies the id of the target Component.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @param { string } id The id value.
|
|
|
|
* @returns { On } this {@link On} object.
|
|
|
|
* @throws { BusinessError } 401 - if the input parameters are invalid.
|
2022-09-14 13:07:20 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 9
|
|
|
|
* @test
|
|
|
|
*/
|
2023-07-25 03:00:20 +00:00
|
|
|
/**
|
2023-06-13 08:18:22 +00:00
|
|
|
* Specifies the id of the target Component.
|
|
|
|
*
|
|
|
|
* @param { string } id The id value.
|
|
|
|
* @returns { On } this {@link On} object.
|
|
|
|
* @throws { BusinessError } 401 - if the input parameters are invalid.
|
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @crossplatform
|
|
|
|
* @since 10
|
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* Specifies the id of the target Component.
|
|
|
|
*
|
2023-12-20 02:30:28 +00:00
|
|
|
* @param { string } id - the id value.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @returns { On } this {@link On} object.
|
2024-04-12 08:13:39 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @crossplatform
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2022-09-14 13:07:20 +00:00
|
|
|
id(id: string): On;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Specifies the type of the target Component.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @param { string } tp The type value.
|
|
|
|
* @returns { On } this {@link On} object.
|
|
|
|
* @throws { BusinessError } 401 - if the input parameters are invalid.
|
2022-09-14 13:07:20 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 9
|
|
|
|
* @test
|
|
|
|
*/
|
2023-06-13 08:18:22 +00:00
|
|
|
/**
|
|
|
|
* Specifies the type of the target Component.
|
|
|
|
*
|
|
|
|
* @param { string } tp The type value.
|
|
|
|
* @returns { On } this {@link On} object.
|
|
|
|
* @throws { BusinessError } 401 - if the input parameters are invalid.
|
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @crossplatform
|
|
|
|
* @since 10
|
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* Specifies the type of the target Component.
|
|
|
|
*
|
2023-12-20 02:30:28 +00:00
|
|
|
* @param { string } tp - The type value.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @returns { On } this {@link On} object.
|
2024-04-12 08:13:39 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @crossplatform
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2022-09-14 13:07:20 +00:00
|
|
|
type(tp: string): On;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Specifies the clickable status of the target Component.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @param { boolean } b The clickable status,default to true.
|
|
|
|
* @returns { On } this {@link On} object.
|
|
|
|
* @throws { BusinessError } 401 - if the input parameters are invalid.
|
2022-09-14 13:07:20 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 9
|
|
|
|
* @test
|
|
|
|
*/
|
2023-06-13 08:18:22 +00:00
|
|
|
/**
|
|
|
|
* Specifies the clickable status of the target Component.
|
|
|
|
*
|
|
|
|
* @param { boolean } b The clickable status,default to true.
|
|
|
|
* @returns { On } this {@link On} object.
|
|
|
|
* @throws { BusinessError } 401 - if the input parameters are invalid.
|
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @crossplatform
|
|
|
|
* @since 10
|
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* Specifies the clickable status of the target Component.
|
|
|
|
*
|
2024-04-12 08:13:39 +00:00
|
|
|
* @param { boolean } [b] - the clickable status.Set it default true if null or undefined.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @returns { On } this {@link On} object.
|
2024-04-17 09:08:08 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Incorrect parameter types; 2. Parameter verification failed.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @crossplatform
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2022-09-14 13:07:20 +00:00
|
|
|
clickable(b?: boolean): On;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Specifies the longClickable status of the target Component.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @param { boolean } b The clickable status,default to true.
|
|
|
|
* @returns { On } this {@link On} object.
|
|
|
|
* @throws { BusinessError } 401 - if the input parameters are invalid.
|
2022-09-14 13:07:20 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 9
|
|
|
|
* @test
|
|
|
|
*/
|
2023-06-13 08:18:22 +00:00
|
|
|
/**
|
|
|
|
* Specifies the longClickable status of the target Component.
|
|
|
|
*
|
|
|
|
* @param { boolean } b The clickable status,default to true.
|
|
|
|
* @returns { On } this {@link On} object.
|
|
|
|
* @throws { BusinessError } 401 - if the input parameters are invalid.
|
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @crossplatform
|
|
|
|
* @since 10
|
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* Specifies the longClickable status of the target Component.
|
|
|
|
*
|
2024-04-12 08:13:39 +00:00
|
|
|
* @param { boolean } [b] - the longClickable status.Set it default true if null or undefined.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @returns { On } this {@link On} object.
|
2024-04-17 09:08:08 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Incorrect parameter types; 2. Parameter verification failed.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @crossplatform
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2022-09-14 13:07:20 +00:00
|
|
|
longClickable(b?: boolean): On;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Specifies the scrollable status of the target Component.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @param { boolean } b The scrollable status,default to true.
|
|
|
|
* @returns { On } this {@link On} object.
|
|
|
|
* @throws { BusinessError } 401 - if the input parameters are invalid.
|
2022-09-14 13:07:20 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 9
|
|
|
|
* @test
|
|
|
|
*/
|
2023-07-31 07:17:39 +00:00
|
|
|
/**
|
2023-06-13 08:18:22 +00:00
|
|
|
* Specifies the scrollable status of the target Component.
|
|
|
|
*
|
|
|
|
* @param { boolean } b The scrollable status,default to true.
|
|
|
|
* @returns { On } this {@link On} object.
|
|
|
|
* @throws { BusinessError } 401 - if the input parameters are invalid.
|
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @crossplatform
|
|
|
|
* @since 10
|
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* Specifies the scrollable status of the target Component.
|
|
|
|
*
|
2024-04-12 08:13:39 +00:00
|
|
|
* @param { boolean } [b] - the scrollable status.Set it default true if null or undefined.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @returns { On } this {@link On} object.
|
2024-04-17 09:08:08 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Incorrect parameter types; 2. Parameter verification failed.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @crossplatform
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2022-09-14 13:07:20 +00:00
|
|
|
scrollable(b?: boolean): On;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Specifies the enabled status of the target Component.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @param { boolean } b The enabled status,default to true.
|
|
|
|
* @returns { On } this {@link On} object.
|
|
|
|
* @throws { BusinessError } 401 - if the input parameters are invalid.
|
2022-09-14 13:07:20 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 9
|
|
|
|
* @test
|
|
|
|
*/
|
2023-07-31 07:17:39 +00:00
|
|
|
/**
|
2023-06-13 08:18:22 +00:00
|
|
|
* Specifies the enabled status of the target Component.
|
|
|
|
*
|
|
|
|
* @param { boolean } b The enabled status,default to true.
|
|
|
|
* @returns { On } this {@link On} object.
|
|
|
|
* @throws { BusinessError } 401 - if the input parameters are invalid.
|
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @crossplatform
|
|
|
|
* @since 10
|
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* Specifies the enabled status of the target Component.
|
|
|
|
*
|
2024-04-12 08:13:39 +00:00
|
|
|
* @param { boolean } [b] - the enabled status.Set it default true if null or undefined.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @returns { On } this {@link On} object.
|
2024-04-17 09:08:08 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Incorrect parameter types; 2. Parameter verification failed.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @crossplatform
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2022-09-14 13:07:20 +00:00
|
|
|
enabled(b?: boolean): On;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Specifies the focused status of the target Component.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @param { boolean } b The focused status,default to true.
|
|
|
|
* @returns { On } this {@link On} object.
|
|
|
|
* @throws { BusinessError } 401 - if the input parameters are invalid.
|
2022-09-14 13:07:20 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 9
|
|
|
|
* @test
|
|
|
|
*/
|
2023-06-13 08:18:22 +00:00
|
|
|
/**
|
|
|
|
* Specifies the focused status of the target Component.
|
|
|
|
*
|
|
|
|
* @param { boolean } b The focused status,default to true.
|
|
|
|
* @returns { On } this {@link On} object.
|
|
|
|
* @throws { BusinessError } 401 - if the input parameters are invalid.
|
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @crossplatform
|
|
|
|
* @since 10
|
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* Specifies the focused status of the target Component.
|
|
|
|
*
|
2024-04-12 08:13:39 +00:00
|
|
|
* @param { boolean } [b] - the focused status.Set it default true if null or undefined.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @returns { On } this {@link On} object.
|
2024-04-17 09:08:08 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Incorrect parameter types; 2. Parameter verification failed.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @crossplatform
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2022-09-14 13:07:20 +00:00
|
|
|
focused(b?: boolean): On;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Specifies the selected status of the target Component.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @param { boolean } b The selected status,default to true.
|
|
|
|
* @returns { On } this {@link On} object.
|
|
|
|
* @throws { BusinessError } 401 - if the input parameters are invalid.
|
2022-09-14 13:07:20 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 9
|
|
|
|
* @test
|
|
|
|
*/
|
2023-06-13 08:18:22 +00:00
|
|
|
/**
|
|
|
|
* Specifies the selected status of the target Component.
|
|
|
|
*
|
|
|
|
* @param { boolean } b The selected status,default to true.
|
|
|
|
* @returns { On } this {@link On} object.
|
|
|
|
* @throws { BusinessError } 401 - if the input parameters are invalid.
|
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @crossplatform
|
|
|
|
* @since 10
|
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* Specifies the selected status of the target Component.
|
|
|
|
*
|
2024-04-12 08:13:39 +00:00
|
|
|
* @param { boolean } [b] the - selected status.Set it default true if null or undefined.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @returns { On } this {@link On} object.
|
2024-04-17 09:08:08 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Incorrect parameter types; 2. Parameter verification failed.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @crossplatform
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2022-09-14 13:07:20 +00:00
|
|
|
selected(b?: boolean): On;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Specifies the checked status of the target Component.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @param { boolean } b The checked status,default to false.
|
|
|
|
* @returns { On } this {@link On} object.
|
|
|
|
* @throws { BusinessError } 401 - if the input parameters are invalid.
|
2022-09-14 13:07:20 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 9
|
|
|
|
* @test
|
|
|
|
*/
|
2023-06-13 08:18:22 +00:00
|
|
|
/**
|
|
|
|
* Specifies the checked status of the target Component.
|
|
|
|
*
|
|
|
|
* @param { boolean } b The checked status,default to false.
|
|
|
|
* @returns { On } this {@link On} object.
|
|
|
|
* @throws { BusinessError } 401 - if the input parameters are invalid.
|
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @crossplatform
|
|
|
|
* @since 10
|
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* Specifies the checked status of the target Component.
|
|
|
|
*
|
2024-04-12 08:13:39 +00:00
|
|
|
* @param { boolean } [b] - the checked status.Set it default false if null or undefined.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @returns { On } this {@link On} object.
|
2024-04-17 09:08:08 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Incorrect parameter types; 2. Parameter verification failed.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @crossplatform
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2022-09-14 13:07:20 +00:00
|
|
|
checked(b?: boolean): On;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Specifies the checkable status of the target Component.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @param { boolean } b The checkable status,default to false.
|
|
|
|
* @returns { On } this {@link On} object.
|
|
|
|
* @throws { BusinessError } 401 - if the input parameters are invalid.
|
2022-09-14 13:07:20 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 9
|
|
|
|
* @test
|
|
|
|
*/
|
2023-06-13 08:18:22 +00:00
|
|
|
/**
|
|
|
|
* Specifies the checkable status of the target Component.
|
|
|
|
*
|
|
|
|
* @param { boolean } b The checkable status,default to false.
|
|
|
|
* @returns { On } this {@link On} object.
|
|
|
|
* @throws { BusinessError } 401 - if the input parameters are invalid.
|
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @crossplatform
|
|
|
|
* @since 10
|
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* Specifies the checkable status of the target Component.
|
|
|
|
*
|
2024-04-12 08:13:39 +00:00
|
|
|
* @param { boolean } [b] - the checkable status.Set it default false if null or undefined.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @returns { On } this {@link On} object.
|
2024-04-17 09:08:08 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. 1. Incorrect parameter types; 2. Parameter verification failed.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @crossplatform
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2022-09-14 13:07:20 +00:00
|
|
|
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.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @param { On } on Describes the attribute requirements of Component which the target one is in front of.
|
|
|
|
* @returns { On } this {@link On} object.
|
|
|
|
* @throws { BusinessError } 401 - if the input parameters are invalid.
|
2022-09-14 13:07:20 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 9
|
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* Requires that the target Component which is before another Component that specified by the given {@link On}
|
|
|
|
* object,used to locate Component relatively.
|
|
|
|
*
|
2023-12-20 02:30:28 +00:00
|
|
|
* @param { On } on - describes the attribute requirements of Component which the target one is in front of.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @returns { On } this {@link On} object.
|
2024-04-12 08:13:39 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
2023-11-16 09:13:21 +00:00
|
|
|
* @crossplatform
|
2023-11-09 09:12:06 +00:00
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
|
|
|
isBefore(on: On): On;
|
|
|
|
|
2022-09-14 13:07:20 +00:00
|
|
|
/**
|
|
|
|
* Requires that the target Component which is after another Component that specified by the given {@link On}
|
|
|
|
* object,used to locate Component relatively.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @param { On } on Describes the attribute requirements of Component which the target one is in back of.
|
|
|
|
* @returns { On } this {@link On} object.
|
|
|
|
* @throws { BusinessError } 401 - if the input parameters are invalid.
|
2022-09-14 13:07:20 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 9
|
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* Requires that the target Component which is after another Component that specified by the given {@link On}
|
|
|
|
* object,used to locate Component relatively.
|
|
|
|
*
|
2023-12-20 02:30:28 +00:00
|
|
|
* @param { On } on - describes the attribute requirements of Component which the target one is in back of.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @returns { On } this {@link On} object.
|
2024-04-12 08:13:39 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
2023-11-16 09:13:21 +00:00
|
|
|
* @crossplatform
|
2023-11-09 09:12:06 +00:00
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2022-09-14 13:07:20 +00:00
|
|
|
isAfter(on: On): On;
|
2023-04-21 09:47:24 +00:00
|
|
|
|
2023-02-22 08:58:29 +00:00
|
|
|
/**
|
|
|
|
* Requires that the target Component which is inside of another Component that specified by the given {@link On}
|
|
|
|
* object,used to locate Component relatively.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @param { On } on Describes the attribute requirements of Component which the target one is inside of.
|
|
|
|
* @returns { On } this {@link On} object.
|
|
|
|
* @throws { BusinessError } 401 - if the input parameters are invalid.
|
2023-02-22 08:58:29 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 10
|
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* Requires that the target Component which is inside of another Component that specified by the given {@link On}
|
|
|
|
* object,used to locate Component relatively.
|
|
|
|
*
|
2023-12-20 02:30:28 +00:00
|
|
|
* @param { On } on - describes the attribute requirements of Component which the target one is inside of.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @returns { On } this {@link On} object.
|
2024-04-12 08:13:39 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
2023-11-16 09:13:21 +00:00
|
|
|
* @crossplatform
|
2023-11-09 09:12:06 +00:00
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2023-03-01 01:42:16 +00:00
|
|
|
within(on: On): On;
|
2023-04-21 09:47:24 +00:00
|
|
|
|
2023-02-22 08:58:29 +00:00
|
|
|
/**
|
2023-02-22 09:55:03 +00:00
|
|
|
* Specifies the bundleName of the application which the window that the target Component is located belongs.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @param { string } bundleName The bundleName of the specified window.
|
|
|
|
* @returns { On } this {@link On} object.
|
|
|
|
* @throws { BusinessError } 401 - if the input parameters are invalid.
|
2023-02-22 08:58:29 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
2023-02-22 09:03:13 +00:00
|
|
|
* @since 10
|
2023-02-22 08:58:29 +00:00
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* Specifies the bundleName of the application which the window that the target Component is located belongs.
|
|
|
|
*
|
2023-12-20 02:30:28 +00:00
|
|
|
* @param { string } bundleName - the bundleName of the specified window.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @returns { On } this {@link On} object.
|
2024-04-12 08:13:39 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2023-03-01 01:42:16 +00:00
|
|
|
inWindow(bundleName: string): On;
|
2023-11-16 09:13:21 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Specifies the description for the target Component.
|
|
|
|
*
|
2023-12-20 02:30:28 +00:00
|
|
|
* @param { string } val - the description value.
|
|
|
|
* @param { MatchPattern } [pattern] - the {@link MatchPattern} of description value,set it default {@link MatchPattern.EQUALS} if null or undefined.
|
2023-11-16 09:13:21 +00:00
|
|
|
* @returns { On } this {@link On} object.
|
2024-04-12 08:13:39 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed.
|
2023-11-16 09:13:21 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
2023-11-30 13:41:42 +00:00
|
|
|
* @atomicservice
|
2023-11-16 09:13:21 +00:00
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
|
|
|
description(val: string, pattern?: MatchPattern): On;
|
2022-09-14 13:07:20 +00:00
|
|
|
}
|
2022-07-18 08:25:31 +00:00
|
|
|
|
|
|
|
/**
|
2022-09-14 13:07:20 +00:00
|
|
|
* Represents an Component of the ohos application,user can perform operations or query attributes on it.
|
|
|
|
*
|
2023-05-06 06:29:02 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
2022-07-18 08:25:31 +00:00
|
|
|
* @since 9
|
2022-09-14 13:07:20 +00:00
|
|
|
* @test
|
2022-06-01 02:58:47 +00:00
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* Represents an Component of the ohos application,user can perform operations or query attributes on it.
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2024-05-07 08:43:00 +00:00
|
|
|
/**
|
|
|
|
* Represents an Component of the ohos application,user can perform operations or query attributes on it.
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @crossplatform
|
|
|
|
* @atomicservice
|
|
|
|
* @since 12
|
|
|
|
* @test
|
|
|
|
*/
|
2022-09-14 13:07:20 +00:00
|
|
|
declare class Component {
|
|
|
|
/**
|
|
|
|
* Click this {@link Component}.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @returns { Promise<void> }
|
|
|
|
* @throws { BusinessError } 17000002 - if the async function was not called with await.
|
|
|
|
* @throws { BusinessError } 17000004 - if the component is invisible or destroyed.
|
2022-09-14 13:07:20 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 9
|
|
|
|
* @test
|
|
|
|
*/
|
2023-06-13 08:18:22 +00:00
|
|
|
/**
|
|
|
|
* Click this {@link Component}.
|
|
|
|
*
|
|
|
|
* @returns { Promise<void> }
|
|
|
|
* @throws { BusinessError } 17000002 - if the async function was not called with await.
|
|
|
|
* @throws { BusinessError } 17000004 - if the component is invisible or destroyed.
|
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @crossplatform
|
|
|
|
* @since 10
|
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* Click this {@link Component}.
|
|
|
|
*
|
|
|
|
* @returns { Promise<void> }
|
2024-06-13 02:30:51 +00:00
|
|
|
* @throws { BusinessError } 17000002 - The async function is not called with await.
|
|
|
|
* @throws { BusinessError } 17000004 - The window or component is invisible or destroyed.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @crossplatform
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2022-09-14 13:07:20 +00:00
|
|
|
click(): Promise<void>;
|
2022-06-01 02:58:47 +00:00
|
|
|
|
2022-09-14 13:07:20 +00:00
|
|
|
/**
|
|
|
|
* Double click this {@link Component}.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @returns { Promise<void> }
|
|
|
|
* @throws { BusinessError } 17000002 - if the async function was not called with await.
|
|
|
|
* @throws { BusinessError } 17000004 - if the component is invisible or destroyed.
|
2022-09-14 13:07:20 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 9
|
|
|
|
* @test
|
|
|
|
*/
|
2023-06-13 08:18:22 +00:00
|
|
|
/**
|
|
|
|
* Double click this {@link Component}.
|
|
|
|
*
|
|
|
|
* @returns { Promise<void> }
|
|
|
|
* @throws { BusinessError } 17000002 - if the async function was not called with await.
|
|
|
|
* @throws { BusinessError } 17000004 - if the component is invisible or destroyed.
|
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @crossplatform
|
|
|
|
* @since 10
|
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* Double click this {@link Component}.
|
|
|
|
*
|
|
|
|
* @returns { Promise<void> }
|
2024-06-13 02:30:51 +00:00
|
|
|
* @throws { BusinessError } 17000002 - The async function is not called with await.
|
|
|
|
* @throws { BusinessError } 17000004 - The window or component is invisible or destroyed.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @crossplatform
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2022-09-14 13:07:20 +00:00
|
|
|
doubleClick(): Promise<void>;
|
2022-05-16 07:30:16 +00:00
|
|
|
|
2022-09-14 13:07:20 +00:00
|
|
|
/**
|
|
|
|
* Long click this {@link Component}.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @returns { Promise<void> }
|
|
|
|
* @throws { BusinessError } 17000002 - if the async function was not called with await.
|
|
|
|
* @throws { BusinessError } 17000004 - if the component is invisible or destroyed.
|
2022-09-14 13:07:20 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 9
|
|
|
|
* @test
|
|
|
|
*/
|
2023-06-13 08:18:22 +00:00
|
|
|
/**
|
|
|
|
* Long click this {@link Component}.
|
|
|
|
*
|
|
|
|
* @returns { Promise<void> }
|
|
|
|
* @throws { BusinessError } 17000002 - if the async function was not called with await.
|
|
|
|
* @throws { BusinessError } 17000004 - if the component is invisible or destroyed.
|
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @crossplatform
|
|
|
|
* @since 10
|
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* Long click this {@link Component}.
|
|
|
|
*
|
|
|
|
* @returns { Promise<void> }
|
2024-06-13 02:30:51 +00:00
|
|
|
* @throws { BusinessError } 17000002 - The async function is not called with await.
|
|
|
|
* @throws { BusinessError } 17000004 - The window or component is invisible or destroyed.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @crossplatform
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2022-09-14 13:07:20 +00:00
|
|
|
longClick(): Promise<void>;
|
2022-06-01 02:58:47 +00:00
|
|
|
|
2022-09-14 13:07:20 +00:00
|
|
|
/**
|
|
|
|
* Get the id attribute value.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @returns { Promise<string> } 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.
|
2022-09-14 13:07:20 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 9
|
|
|
|
* @test
|
|
|
|
*/
|
2023-06-13 08:18:22 +00:00
|
|
|
/**
|
|
|
|
* Get the id attribute value.
|
|
|
|
*
|
|
|
|
* @returns { Promise<string> } 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.
|
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @crossplatform
|
|
|
|
* @since 10
|
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* Get the id attribute value.
|
|
|
|
*
|
|
|
|
* @returns { Promise<string> } the id value.
|
2024-06-13 02:30:51 +00:00
|
|
|
* @throws { BusinessError } 17000002 - The async function is not called with await.
|
|
|
|
* @throws { BusinessError } 17000004 - The window or component is invisible or destroyed.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @crossplatform
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2022-09-14 13:07:20 +00:00
|
|
|
getId(): Promise<string>;
|
2022-03-08 10:42:53 +00:00
|
|
|
|
2022-09-14 13:07:20 +00:00
|
|
|
/**
|
|
|
|
* Get the text attribute value.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @returns { Promise<string> } the text value.
|
|
|
|
* @throws { BusinessError } 17000002 - if the async function was not called with await.
|
|
|
|
* @throws { BusinessError } 17000004 - if the component is invisible or destroyed.
|
2022-09-14 13:07:20 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 9
|
|
|
|
* @test
|
|
|
|
*/
|
2023-06-13 08:18:22 +00:00
|
|
|
/**
|
|
|
|
* Get the text attribute value.
|
|
|
|
*
|
|
|
|
* @returns { Promise<string> } the text value.
|
|
|
|
* @throws { BusinessError } 17000002 - if the async function was not called with await.
|
|
|
|
* @throws { BusinessError } 17000004 - if the component is invisible or destroyed.
|
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @crossplatform
|
|
|
|
* @since 10
|
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* Get the text attribute value.
|
|
|
|
*
|
|
|
|
* @returns { Promise<string> } the text value.
|
2024-06-13 02:30:51 +00:00
|
|
|
* @throws { BusinessError } 17000002 - The async function is not called with await.
|
|
|
|
* @throws { BusinessError } 17000004 - The window or component is invisible or destroyed.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @crossplatform
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2022-09-14 13:07:20 +00:00
|
|
|
getText(): Promise<string>;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the type name.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @returns { Promise<string> } 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.
|
2022-09-14 13:07:20 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 9
|
|
|
|
* @test
|
|
|
|
*/
|
2023-06-13 08:18:22 +00:00
|
|
|
/**
|
|
|
|
* Get the type name.
|
|
|
|
*
|
|
|
|
* @returns { Promise<string> } 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.
|
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @crossplatform
|
|
|
|
* @since 10
|
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* Get the type name.
|
|
|
|
*
|
|
|
|
* @returns { Promise<string> } the type name.
|
2024-06-13 02:30:51 +00:00
|
|
|
* @throws { BusinessError } 17000002 - The async function is not called with await.
|
|
|
|
* @throws { BusinessError } 17000004 - The window or component is invisible or destroyed.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @crossplatform
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2022-09-14 13:07:20 +00:00
|
|
|
getType(): Promise<string>;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the clickable status of this {@link Component}.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @returns { Promise<boolean> } 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.
|
2022-09-14 13:07:20 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 9
|
|
|
|
* @test
|
|
|
|
*/
|
2023-06-13 08:18:22 +00:00
|
|
|
/**
|
|
|
|
* Get the clickable status of this {@link Component}.
|
|
|
|
*
|
|
|
|
* @returns { Promise<boolean> } 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.
|
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @crossplatform
|
|
|
|
* @since 10
|
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* Get the clickable status of this {@link Component}.
|
|
|
|
*
|
|
|
|
* @returns { Promise<boolean> } the clickable status.
|
2024-06-13 02:30:51 +00:00
|
|
|
* @throws { BusinessError } 17000002 - The async function is not called with await.
|
|
|
|
* @throws { BusinessError } 17000004 - The window or component is invisible or destroyed.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @crossplatform
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2022-09-14 13:07:20 +00:00
|
|
|
isClickable(): Promise<boolean>;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the longClickable status of this {@link Component}.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @returns { Promise<boolean> } 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.
|
2022-09-14 13:07:20 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 9
|
|
|
|
* @test
|
|
|
|
*/
|
2023-06-13 08:18:22 +00:00
|
|
|
/**
|
|
|
|
* Get the longClickable status of this {@link Component}.
|
|
|
|
*
|
|
|
|
* @returns { Promise<boolean> } 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.
|
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @crossplatform
|
|
|
|
* @since 10
|
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* Get the clickable status of this {@link Component}.
|
|
|
|
*
|
|
|
|
* @returns { Promise<boolean> } the clickable status.
|
2024-06-13 02:30:51 +00:00
|
|
|
* @throws { BusinessError } 17000002 - The async function is not called with await.
|
|
|
|
* @throws { BusinessError } 17000004 - The window or component is invisible or destroyed.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @crossplatform
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2022-09-14 13:07:20 +00:00
|
|
|
isLongClickable(): Promise<boolean>;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the scrollable status of this {@link Component}.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @returns { Promise<boolean> } 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.
|
2022-09-14 13:07:20 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 9
|
|
|
|
* @test
|
|
|
|
*/
|
2023-06-13 08:18:22 +00:00
|
|
|
/**
|
|
|
|
* Get the scrollable status of this {@link Component}.
|
|
|
|
*
|
|
|
|
* @returns { Promise<boolean> } 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.
|
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @crossplatform
|
|
|
|
* @since 10
|
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* Get the scrollable status of this {@link Component}.
|
|
|
|
*
|
|
|
|
* @returns { Promise<boolean> } the scrollable status.
|
2024-06-13 02:30:51 +00:00
|
|
|
* @throws { BusinessError } 17000002 - The async function is not called with await.
|
|
|
|
* @throws { BusinessError } 17000004 - The window or component is invisible or destroyed.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @crossplatform
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2022-09-14 13:07:20 +00:00
|
|
|
isScrollable(): Promise<boolean>;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the enabled status of this {@link Component}.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @returns { Promise<boolean> } 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.
|
2022-09-14 13:07:20 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 9
|
|
|
|
* @test
|
|
|
|
*/
|
2023-06-13 08:18:22 +00:00
|
|
|
/**
|
|
|
|
* Get the enabled status of this {@link Component}.
|
|
|
|
*
|
|
|
|
* @returns { Promise<boolean> } 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.
|
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @crossplatform
|
|
|
|
* @since 10
|
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* Get the enabled status of this {@link Component}.
|
|
|
|
*
|
|
|
|
* @returns { Promise<boolean> } the enabled status.
|
2024-06-13 02:30:51 +00:00
|
|
|
* @throws { BusinessError } 17000002 - The async function is not called with await.
|
|
|
|
* @throws { BusinessError } 17000004 - The window or component is invisible or destroyed.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @crossplatform
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2022-09-14 13:07:20 +00:00
|
|
|
isEnabled(): Promise<boolean>;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the focused status of this {@link Component}.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @returns { Promise<boolean> } 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.
|
2022-09-14 13:07:20 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 9
|
|
|
|
* @test
|
|
|
|
*/
|
2023-06-13 08:18:22 +00:00
|
|
|
/**
|
|
|
|
* Get the focused status of this {@link Component}.
|
|
|
|
*
|
|
|
|
* @returns { Promise<boolean> } 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.
|
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @crossplatform
|
|
|
|
* @since 10
|
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* Get the focused status of this {@link Component}.
|
|
|
|
*
|
|
|
|
* @returns { Promise<boolean> } the focused status.
|
2024-06-13 02:30:51 +00:00
|
|
|
* @throws { BusinessError } 17000002 - The async function is not called with await.
|
|
|
|
* @throws { BusinessError } 17000004 - The window or component is invisible or destroyed.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @crossplatform
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2022-09-14 13:07:20 +00:00
|
|
|
isFocused(): Promise<boolean>;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the selected status of this {@link Component}.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @returns { Promise<boolean> } 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.
|
2022-09-14 13:07:20 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 9
|
|
|
|
* @test
|
|
|
|
*/
|
2023-06-13 08:18:22 +00:00
|
|
|
/**
|
|
|
|
* Get the selected status of this {@link Component}.
|
|
|
|
*
|
|
|
|
* @returns { Promise<boolean> } 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.
|
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @crossplatform
|
|
|
|
* @since 10
|
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* Get the selected status of this {@link Component}.
|
|
|
|
*
|
|
|
|
* @returns { Promise<boolean> } the selected status.
|
2024-06-13 02:30:51 +00:00
|
|
|
* @throws { BusinessError } 17000002 - The async function is not called with await.
|
|
|
|
* @throws { BusinessError } 17000004 - The window or component is invisible or destroyed.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @crossplatform
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2022-09-14 13:07:20 +00:00
|
|
|
isSelected(): Promise<boolean>;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the checked status of this {@link Component}.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @returns { Promise<boolean> } 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.
|
2022-09-14 13:07:20 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 9
|
|
|
|
* @test
|
|
|
|
*/
|
2023-06-13 08:18:22 +00:00
|
|
|
/**
|
|
|
|
* Get the checked status of this {@link Component}.
|
|
|
|
*
|
|
|
|
* @returns { Promise<boolean> } 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.
|
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @crossplatform
|
|
|
|
* @since 10
|
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* Get the checked status of this {@link Component}.
|
|
|
|
*
|
|
|
|
* @returns { Promise<boolean> } the checked status.
|
2024-06-13 02:30:51 +00:00
|
|
|
* @throws { BusinessError } 17000002 - The async function is not called with await.
|
|
|
|
* @throws { BusinessError } 17000004 - The window or component is invisible or destroyed.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @crossplatform
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2022-09-14 13:07:20 +00:00
|
|
|
isChecked(): Promise<boolean>;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the checkable status of this {@link Component}.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @returns { Promise<boolean> } 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.
|
2022-09-14 13:07:20 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 9
|
|
|
|
* @test
|
|
|
|
*/
|
2023-06-13 08:18:22 +00:00
|
|
|
/**
|
|
|
|
* Get the checkable status of this {@link Component}.
|
|
|
|
*
|
|
|
|
* @returns { Promise<boolean> } 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.
|
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @crossplatform
|
|
|
|
* @since 10
|
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* Get the checkable status of this {@link Component}.
|
|
|
|
*
|
|
|
|
* @returns { Promise<boolean> } the checkable status.
|
2024-06-13 02:30:51 +00:00
|
|
|
* @throws { BusinessError } 17000002 - The async function is not called with await.
|
|
|
|
* @throws { BusinessError } 17000004 - The window or component is invisible or destroyed.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @crossplatform
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2022-09-14 13:07:20 +00:00
|
|
|
isCheckable(): Promise<boolean>;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Inject text to this {@link Component},applicable to TextInput.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @param { string } text The text to inject.
|
|
|
|
* @returns { Promise<void> }
|
|
|
|
* @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.
|
2022-09-14 13:07:20 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 9
|
|
|
|
* @test
|
|
|
|
*/
|
2023-06-13 08:18:22 +00:00
|
|
|
/**
|
|
|
|
* Inject text to this {@link Component},applicable to TextInput.
|
|
|
|
*
|
|
|
|
* @param { string } text The text to inject.
|
|
|
|
* @returns { Promise<void> }
|
|
|
|
* @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.
|
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @crossplatform
|
|
|
|
* @since 10
|
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* Inject text to this {@link Component},applicable to TextInput.
|
|
|
|
*
|
2023-12-20 02:30:28 +00:00
|
|
|
* @param { string } text - the text to inject.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @returns { Promise<void> }
|
2024-04-12 08:13:39 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed.
|
2024-06-13 02:30:51 +00:00
|
|
|
* @throws { BusinessError } 17000002 - The async function is not called with await.
|
|
|
|
* @throws { BusinessError } 17000004 - The window or component is invisible or destroyed.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @crossplatform
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2022-09-14 13:07:20 +00:00
|
|
|
inputText(text: string): Promise<void>;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Clear text of this {@link Component},applicable to TextInput.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @returns { Promise<void> }
|
|
|
|
* @throws { BusinessError } 17000002 - if the async function was not called with await.
|
|
|
|
* @throws { BusinessError } 17000004 - if the component is invisible or destroyed.
|
2022-09-14 13:07:20 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 9
|
|
|
|
* @test
|
|
|
|
*/
|
2023-06-13 08:18:22 +00:00
|
|
|
/**
|
|
|
|
* Clear text of this {@link Component},applicable to TextInput.
|
|
|
|
*
|
|
|
|
* @returns { Promise<void> }
|
|
|
|
* @throws { BusinessError } 17000002 - if the async function was not called with await.
|
|
|
|
* @throws { BusinessError } 17000004 - if the component is invisible or destroyed.
|
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @crossplatform
|
|
|
|
* @since 10
|
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
2023-11-09 11:43:57 +00:00
|
|
|
* Clear text of this {@link Component},applicable to TextInput.
|
2023-11-09 09:12:06 +00:00
|
|
|
*
|
|
|
|
* @returns { Promise<void> }
|
2024-06-13 02:30:51 +00:00
|
|
|
* @throws { BusinessError } 17000002 - The async function is not called with await.
|
|
|
|
* @throws { BusinessError } 17000004 - The window or component is invisible or destroyed.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @crossplatform
|
|
|
|
* @atomicservice
|
2024-06-28 09:18:36 +00:00
|
|
|
* @since 11
|
2023-11-09 09:12:06 +00:00
|
|
|
* @test
|
|
|
|
*/
|
2022-09-14 13:07:20 +00:00
|
|
|
clearText(): Promise<void>;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Scroll on this {@link Component} to the top,applicable to scrollable one.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @param { number } speed The speed of swipe (pixels per second),default is 600,the value ranges from 200 to 40000,set it 600 if out of range.
|
|
|
|
* @returns { Promise<void> }
|
|
|
|
* @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.
|
2022-09-14 13:07:20 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 9
|
|
|
|
* @test
|
|
|
|
*/
|
2023-06-13 08:18:22 +00:00
|
|
|
/**
|
|
|
|
* Scroll on this {@link Component} to the top,applicable to scrollable one.
|
|
|
|
*
|
|
|
|
* @param { number } speed The speed of swipe (pixels per second),default is 600,the value ranges from 200 to 40000,set it 600 if out of range.
|
|
|
|
* @returns { Promise<void> }
|
|
|
|
* @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.
|
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @crossplatform
|
|
|
|
* @since 10
|
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* Scroll on this {@link Component} to the top,applicable to scrollable one.
|
|
|
|
*
|
2023-12-20 02:30:28 +00:00
|
|
|
* @param { number } [speed] - the speed of swipe(pixels per second),ranges from 200 to 40000.Set it default 600 if out of range or null or undefined.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @returns { Promise<void> }
|
2024-04-17 09:08:08 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Incorrect parameter types; 2. Parameter verification failed.
|
2024-06-13 02:30:51 +00:00
|
|
|
* @throws { BusinessError } 17000002 - The async function is not called with await.
|
|
|
|
* @throws { BusinessError } 17000004 - The window or component is invisible or destroyed.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @crossplatform
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2022-09-14 13:07:20 +00:00
|
|
|
scrollToTop(speed?: number): Promise<void>;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Scroll on this {@link Component} to the bottom,applicable to scrollable one.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @param { number } speed The speed of swipe (pixels per second),default is 600,the value ranges from 200 to 40000,set it 600 if out of range.
|
|
|
|
* @returns { Promise<void> }
|
|
|
|
* @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.
|
2022-09-14 13:07:20 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 9
|
|
|
|
* @test
|
|
|
|
*/
|
2023-06-13 08:18:22 +00:00
|
|
|
/**
|
|
|
|
* Scroll on this {@link Component} to the bottom,applicable to scrollable one.
|
|
|
|
*
|
|
|
|
* @param { number } speed The speed of swipe (pixels per second),default is 600,the value ranges from 200 to 40000,set it 600 if out of range.
|
|
|
|
* @returns { Promise<void> }
|
|
|
|
* @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.
|
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @crossplatform
|
|
|
|
* @since 10
|
|
|
|
* @test
|
|
|
|
*/
|
2022-09-14 13:07:20 +00:00
|
|
|
/**
|
2023-11-09 09:12:06 +00:00
|
|
|
* Scroll on this {@link Component} to the bottom,applicable to scrollable one.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
2023-12-20 02:30:28 +00:00
|
|
|
* @param { number } [speed] - the speed of swipe(pixels per second),ranges from 200 to 40000. Set it default 600 if out of range or null or undefined.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @returns { Promise<void> }
|
2024-04-17 09:08:08 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Incorrect parameter types; 2. Parameter verification failed.
|
2024-06-13 02:30:51 +00:00
|
|
|
* @throws { BusinessError } 17000002 - The async function is not called with await.
|
|
|
|
* @throws { BusinessError } 17000004 - The window or component is invisible or destroyed.
|
2022-09-14 13:07:20 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
2023-11-09 09:12:06 +00:00
|
|
|
* @crossplatform
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
2022-09-14 13:07:20 +00:00
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
scrollToBottom(speed?: number): Promise<void>;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Scroll on this {@link Component}to find matched {@link Component},applicable to scrollable one.
|
|
|
|
*
|
|
|
|
* @param { On } on The attribute requirements of the target {@link Component}.
|
|
|
|
* @returns { Promise<Component> } 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.
|
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 9
|
|
|
|
* @test
|
|
|
|
*/
|
|
|
|
/**
|
2023-06-13 08:18:22 +00:00
|
|
|
* Scroll on this {@link Component}to find matched {@link Component},applicable to scrollable one.
|
|
|
|
*
|
|
|
|
* @param { On } on The attribute requirements of the target {@link Component}.
|
|
|
|
* @returns { Promise<Component> } 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.
|
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @crossplatform
|
|
|
|
* @since 10
|
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
2023-11-09 11:43:57 +00:00
|
|
|
* Scroll on this {@link Component}to find matched {@link Component},applicable to scrollable one.
|
2023-11-09 09:12:06 +00:00
|
|
|
*
|
2023-12-20 02:30:28 +00:00
|
|
|
* @param { On } on - the attribute requirements of the target {@link Component}.
|
2023-11-09 11:43:57 +00:00
|
|
|
* @returns { Promise<Component> } the found result,or undefined if not found.
|
2024-04-12 08:13:39 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed.
|
2024-06-13 02:30:51 +00:00
|
|
|
* @throws { BusinessError } 17000002 - The async function is not called with await.
|
|
|
|
* @throws { BusinessError } 17000004 - The window or component is invisible or destroyed.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @crossplatform
|
|
|
|
* @atomicservice
|
2024-06-28 09:18:36 +00:00
|
|
|
* @since 11
|
2023-11-09 09:12:06 +00:00
|
|
|
* @test
|
|
|
|
*/
|
2022-09-14 13:07:20 +00:00
|
|
|
scrollSearch(on: On): Promise<Component>;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the bounds rect of this {@link Component}.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @returns { Promise<Rect> } 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.
|
2022-09-14 13:07:20 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 9
|
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* Get the bounds rect of this {@link Component}.
|
|
|
|
*
|
|
|
|
* @returns { Promise<Rect> } 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.
|
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2024-05-07 08:45:16 +00:00
|
|
|
/**
|
|
|
|
* Get the bounds rect of this {@link Component}.
|
|
|
|
*
|
|
|
|
* @returns { Promise<Rect> } the bounds rect object.
|
2024-06-13 02:30:51 +00:00
|
|
|
* @throws { BusinessError } 17000002 - The async function is not called with await.
|
|
|
|
* @throws { BusinessError } 17000004 - The window or component is invisible or destroyed.
|
2024-05-07 08:45:16 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @crossplatform
|
|
|
|
* @atomicservice
|
|
|
|
* @since 12
|
|
|
|
* @test
|
|
|
|
*/
|
2022-09-14 13:07:20 +00:00
|
|
|
getBounds(): Promise<Rect>;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the boundsCenter of this {@link Component}.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @returns { Promise<Point> } 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.
|
2022-09-14 13:07:20 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 9
|
|
|
|
* @test
|
|
|
|
*/
|
2023-06-13 08:18:22 +00:00
|
|
|
/**
|
|
|
|
* Get the boundsCenter of this {@link Component}.
|
|
|
|
*
|
|
|
|
* @returns { Promise<Point> } 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.
|
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @crossplatform
|
|
|
|
* @since 10
|
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* Get the boundsCenter of this {@link Component}.
|
|
|
|
*
|
|
|
|
* @returns { Promise<Point> } the boundsCenter object.
|
2024-06-13 02:30:51 +00:00
|
|
|
* @throws { BusinessError } 17000002 - The async function is not called with await.
|
|
|
|
* @throws { BusinessError } 17000004 - The window or component is invisible or destroyed.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @crossplatform
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2022-09-14 13:07:20 +00:00
|
|
|
getBoundsCenter(): Promise<Point>;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Drag this {@link Component} to the bounds rect of target Component.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @param { Component } target The target {@link Component}.
|
|
|
|
* @returns { Promise<void> }
|
|
|
|
* @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.
|
2022-09-14 13:07:20 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 9
|
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* Drag this {@link Component} to the bounds rect of target Component.
|
|
|
|
*
|
2023-12-20 02:30:28 +00:00
|
|
|
* @param { Component } target - the target {@link Component}.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @returns { Promise<void> }
|
2024-04-12 08:13:39 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed.
|
2024-06-13 02:30:51 +00:00
|
|
|
* @throws { BusinessError } 17000002 - The async function is not called with await.
|
|
|
|
* @throws { BusinessError } 17000004 - The window or component is invisible or destroyed.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2022-09-14 13:07:20 +00:00
|
|
|
dragTo(target: Component): Promise<void>;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Pinch enlarge this {@link Component} to the target scale.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @param { number } scale The scale of the pinch enlarge this {@link Component}'s size.
|
|
|
|
* @returns { Promise<void> }
|
|
|
|
* @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.
|
2022-09-14 13:07:20 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 9
|
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* Pinch enlarge this {@link Component} to the target scale.
|
|
|
|
*
|
2024-04-12 08:13:39 +00:00
|
|
|
* @param { number } scale - the scale of the pinch enlarge this {@link Component}'s size, ranges greater than 1.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @returns { Promise<void> }
|
2024-04-12 08:13:39 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed.
|
2024-06-13 02:30:51 +00:00
|
|
|
* @throws { BusinessError } 17000002 - The async function is not called with await.
|
|
|
|
* @throws { BusinessError } 17000004 - The window or component is invisible or destroyed.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
2023-11-16 09:13:21 +00:00
|
|
|
* @crossplatform
|
2023-11-09 09:12:06 +00:00
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2022-09-14 13:07:20 +00:00
|
|
|
pinchOut(scale: number): Promise<void>;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Pinch shrink this {@link Component} to the target scale.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @param { number } scale The scale of the pinch shrink this {@link Component}'s size.
|
|
|
|
* @returns { Promise<void> }
|
|
|
|
* @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.
|
2022-09-14 13:07:20 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 9
|
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* Pinch shrink this {@link Component} to the target scale.
|
|
|
|
*
|
2024-04-12 08:13:39 +00:00
|
|
|
* @param { number } scale - the scale of the pinch shrink this {@link Component}'s size, ranges from 0 to 1.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @returns { Promise<void> }
|
2024-04-12 08:13:39 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed.
|
2024-06-13 02:30:51 +00:00
|
|
|
* @throws { BusinessError } 17000002 - The async function is not called with await.
|
|
|
|
* @throws { BusinessError } 17000004 - The window or component is invisible or destroyed.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
2023-11-16 09:13:21 +00:00
|
|
|
* @crossplatform
|
2023-11-09 09:12:06 +00:00
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2022-09-14 13:07:20 +00:00
|
|
|
pinchIn(scale: number): Promise<void>;
|
2023-11-16 09:13:21 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the description attribute value.
|
|
|
|
*
|
|
|
|
* @returns { Promise<string> } the description value.
|
2024-06-13 02:30:51 +00:00
|
|
|
* @throws { BusinessError } 17000002 - The async function is not called with await.
|
|
|
|
* @throws { BusinessError } 17000004 - The window or component is invisible or destroyed.
|
2023-11-16 09:13:21 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
2023-11-30 13:41:42 +00:00
|
|
|
* @atomicservice
|
2023-11-16 09:13:21 +00:00
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
|
|
|
getDescription(): Promise<string>;
|
2022-03-08 10:42:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2022-09-14 13:07:20 +00:00
|
|
|
* The unified facade of UiTest framework,can be used to find {@link Component},trigger keyEvents,perform
|
2022-03-08 10:42:53 +00:00
|
|
|
* coordinates-based UI actions,capture screen and so on.
|
|
|
|
*
|
2023-05-06 06:29:02 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
2022-09-14 13:07:20 +00:00
|
|
|
* @since 9
|
2022-03-08 10:42:53 +00:00
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2024-05-07 08:43:00 +00:00
|
|
|
/**
|
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @crossplatform
|
|
|
|
* @atomicservice
|
|
|
|
* @since 12
|
|
|
|
* @test
|
|
|
|
*/
|
2022-09-14 13:07:20 +00:00
|
|
|
declare class Driver {
|
2022-03-08 10:42:53 +00:00
|
|
|
/**
|
2022-09-14 13:07:20 +00:00
|
|
|
* Create an {@link Driver} object.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @returns { Driver } the {@link Driver} object.
|
|
|
|
* @throws { BusinessError } 17000001 - if the test framework failed to initialize.
|
2022-03-08 10:42:53 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
2022-09-14 13:07:20 +00:00
|
|
|
* @since 9
|
2022-03-08 10:42:53 +00:00
|
|
|
* @test
|
|
|
|
*/
|
2023-06-13 08:18:22 +00:00
|
|
|
/**
|
|
|
|
* Create an {@link Driver} object.
|
|
|
|
*
|
|
|
|
* @returns { Driver } the {@link Driver} object.
|
|
|
|
* @throws { BusinessError } 17000001 - if the test framework failed to initialize.
|
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @crossplatform
|
|
|
|
* @since 10
|
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* Create an {@link Driver} object.
|
|
|
|
*
|
|
|
|
* @returns { Driver } the {@link Driver} object.
|
2024-06-13 02:30:51 +00:00
|
|
|
* @throws { BusinessError } 17000001 - Initialization failed.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @crossplatform
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2022-09-14 13:07:20 +00:00
|
|
|
static create(): Driver;
|
2022-03-08 10:42:53 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Delay with specified duration.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @param { number } duration The delay duration in milliseconds.
|
|
|
|
* @returns { Promise<void> }
|
|
|
|
* @throws { BusinessError } 401 - if the input parameters are invalid.
|
|
|
|
* @throws { BusinessError } 17000002 - if the async function was not called with await.
|
2022-03-08 10:42:53 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
2022-09-14 13:07:20 +00:00
|
|
|
* @since 9
|
2022-03-08 10:42:53 +00:00
|
|
|
* @test
|
|
|
|
*/
|
2023-06-13 08:18:22 +00:00
|
|
|
/**
|
|
|
|
* Delay with specified duration.
|
|
|
|
*
|
|
|
|
* @param { number } duration The delay duration in milliseconds.
|
|
|
|
* @returns { Promise<void> }
|
|
|
|
* @throws { BusinessError } 401 - if the input parameters are invalid.
|
|
|
|
* @throws { BusinessError } 17000002 - if the async function was not called with await.
|
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @crossplatform
|
|
|
|
* @since 10
|
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* Delay with specified duration.
|
|
|
|
*
|
2024-04-12 08:13:39 +00:00
|
|
|
* @param { number } duration - the delay duration in milliseconds, not less than 0.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @returns { Promise<void> }
|
2024-04-12 08:13:39 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed.
|
2024-06-13 02:30:51 +00:00
|
|
|
* @throws { BusinessError } 17000002 - The async function is not called with await.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @crossplatform
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2022-09-14 13:07:20 +00:00
|
|
|
delayMs(duration: number): Promise<void>;
|
2022-03-08 10:42:53 +00:00
|
|
|
|
|
|
|
/**
|
2022-09-14 13:07:20 +00:00
|
|
|
* Find the first matched {@link Component} on current UI.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @param { On } on The attribute requirements of the target {@link Component}.
|
|
|
|
* @returns { Promise<Component> } 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.
|
2022-03-08 10:42:53 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
2022-09-14 13:07:20 +00:00
|
|
|
* @since 9
|
2022-03-08 10:42:53 +00:00
|
|
|
* @test
|
|
|
|
*/
|
2023-06-13 08:18:22 +00:00
|
|
|
/**
|
|
|
|
* Find the first matched {@link Component} on current UI.
|
|
|
|
*
|
|
|
|
* @param { On } on The attribute requirements of the target {@link Component}.
|
|
|
|
* @returns { Promise<Component> } 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.
|
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @crossplatform
|
|
|
|
* @since 10
|
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* Find the first matched {@link Component} on current UI.
|
|
|
|
*
|
2023-12-20 02:30:28 +00:00
|
|
|
* @param { On } on - the attribute requirements of the target {@link Component}.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @returns { Promise<Component> } the first matched {@link Component} or undefined.
|
2024-04-12 08:13:39 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed.
|
2024-06-13 02:30:51 +00:00
|
|
|
* @throws { BusinessError } 17000002 - The async function is not called with await.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @crossplatform
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2022-09-14 13:07:20 +00:00
|
|
|
findComponent(on: On): Promise<Component>;
|
2022-03-08 10:42:53 +00:00
|
|
|
|
2022-06-01 02:58:47 +00:00
|
|
|
/**
|
|
|
|
* Find the first matched {@link UiWindow} window.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @param { WindowFilter } filter The filer condition of the target {@link UiWindow}.
|
|
|
|
* @returns { Promise<UiWindow> } 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.
|
2022-06-01 02:58:47 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 9
|
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* Find the first matched {@link UiWindow} window.
|
|
|
|
*
|
2023-12-20 02:30:28 +00:00
|
|
|
* @param { WindowFilter } filter - the filer condition of the target {@link UiWindow}.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @returns { Promise<UiWindow> } the first matched {@link UiWindow} or undefined.
|
2024-04-12 08:13:39 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed.
|
2024-06-13 02:30:51 +00:00
|
|
|
* @throws { BusinessError } 17000002 - The async function is not called with await.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2022-09-14 13:07:20 +00:00
|
|
|
findWindow(filter: WindowFilter): Promise<UiWindow>;
|
2022-06-01 02:58:47 +00:00
|
|
|
|
2022-05-16 07:30:16 +00:00
|
|
|
/**
|
2022-09-14 13:07:20 +00:00
|
|
|
* Find the first matched {@link Component} on current UI during the time given.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @param { On } on The attribute requirements of the target {@link Component}.
|
|
|
|
* @param { number } time Duration of finding in milliseconds
|
|
|
|
* @returns { Promise<Component> } 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.
|
2022-05-16 07:30:16 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 9
|
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* Find the first matched {@link Component} on current UI during the time given.
|
|
|
|
*
|
2023-12-20 02:30:28 +00:00
|
|
|
* @param { On } on - the attribute requirements of the target {@link Component}.
|
2024-04-16 12:12:13 +00:00
|
|
|
* @param { number } time - duration of finding in milliseconds, not less than 0.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @returns { Promise<Component> } the first matched {@link Component} or undefined.
|
2024-04-12 08:13:39 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed.
|
2024-06-13 02:30:51 +00:00
|
|
|
* @throws { BusinessError } 17000002 - The async function is not called with await.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2022-09-14 13:07:20 +00:00
|
|
|
waitForComponent(on: On, time: number): Promise<Component>;
|
2022-05-16 07:30:16 +00:00
|
|
|
|
2022-03-08 10:42:53 +00:00
|
|
|
/**
|
2022-09-14 13:07:20 +00:00
|
|
|
* Find all the matched {@link Component}s on current UI.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @param { On } on The attribute requirements of the target {@link Component}.
|
|
|
|
* @returns { Promise<Array<Component>> } 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.
|
2022-03-08 10:42:53 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
2022-09-14 13:07:20 +00:00
|
|
|
* @since 9
|
2022-03-08 10:42:53 +00:00
|
|
|
* @test
|
|
|
|
*/
|
2023-06-13 08:18:22 +00:00
|
|
|
/**
|
|
|
|
* Find all the matched {@link Component}s on current UI.
|
|
|
|
*
|
|
|
|
* @param { On } on The attribute requirements of the target {@link Component}.
|
|
|
|
* @returns { Promise<Array<Component>> } 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.
|
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @crossplatform
|
|
|
|
* @since 10
|
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* Find all the matched {@link Component}s on current UI.
|
|
|
|
*
|
2023-12-20 02:30:28 +00:00
|
|
|
* @param { On } on - the attribute requirements of the target {@link Component}.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @returns { Promise<Array<Component>> } the matched {@link Component}s list.
|
2024-04-12 08:13:39 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed.
|
2024-06-13 02:30:51 +00:00
|
|
|
* @throws { BusinessError } 17000002 - The async function is not called with await.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @crossplatform
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2022-09-14 13:07:20 +00:00
|
|
|
findComponents(on: On): Promise<Array<Component>>;
|
2022-03-08 10:42:53 +00:00
|
|
|
|
|
|
|
/**
|
2022-09-14 13:07:20 +00:00
|
|
|
* Assert t the matched {@link Component}s exists on current UI;if not,assertError will be raised.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @param { On } on The attribute requirements of the target {@link Component}.
|
|
|
|
* @returns { Promise<void> }
|
|
|
|
* @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.
|
2022-03-08 10:42:53 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
2022-09-14 13:07:20 +00:00
|
|
|
* @since 9
|
2022-03-08 10:42:53 +00:00
|
|
|
* @test
|
|
|
|
*/
|
2023-06-13 08:18:22 +00:00
|
|
|
/**
|
|
|
|
* Assert t the matched {@link Component}s exists on current UI;if not,assertError will be raised.
|
|
|
|
*
|
|
|
|
* @param { On } on The attribute requirements of the target {@link Component}.
|
|
|
|
* @returns { Promise<void> }
|
|
|
|
* @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.
|
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @crossplatform
|
|
|
|
* @since 10
|
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* Assert t the matched {@link Component}s exists on current UI;if not,assertError will be raised.
|
|
|
|
*
|
2023-12-20 02:30:28 +00:00
|
|
|
* @param { On } on - the attribute requirements of the target {@link Component}.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @returns { Promise<void> }
|
2024-04-12 08:13:39 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed.
|
2024-06-13 02:30:51 +00:00
|
|
|
* @throws { BusinessError } 17000002 - The async function is not called with await.
|
|
|
|
* @throws { BusinessError } 17000003 - Assertion failed.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @crossplatform
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2022-09-14 13:07:20 +00:00
|
|
|
assertComponentExist(on: On): Promise<void>;
|
2022-03-08 10:42:53 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Press the BACK key.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @returns { Promise<void> }
|
|
|
|
* @throws { BusinessError } 17000002 - if the async function was not called with await.
|
2022-03-08 10:42:53 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
2022-09-14 13:07:20 +00:00
|
|
|
* @since 9
|
2022-03-08 10:42:53 +00:00
|
|
|
* @test
|
|
|
|
*/
|
2023-06-13 08:18:22 +00:00
|
|
|
/**
|
|
|
|
* Press the BACK key.
|
|
|
|
*
|
|
|
|
* @returns { Promise<void> }
|
|
|
|
* @throws { BusinessError } 17000002 - if the async function was not called with await.
|
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @crossplatform
|
|
|
|
* @since 10
|
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* Press the BACK key.
|
|
|
|
*
|
|
|
|
* @returns { Promise<void> }
|
2024-06-13 02:30:51 +00:00
|
|
|
* @throws { BusinessError } 17000002 - The async function is not called with await.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @crossplatform
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2022-09-14 13:07:20 +00:00
|
|
|
pressBack(): Promise<void>;
|
2022-03-08 10:42:53 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Press the specified key.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @param { number } keyCode the target keyCode.
|
|
|
|
* @returns { Promise<void> }
|
|
|
|
* @throws { BusinessError } 401 - if the input parameters are invalid.
|
|
|
|
* @throws { BusinessError } 17000002 - if the async function was not called with await.
|
2022-03-08 10:42:53 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
2022-09-14 13:07:20 +00:00
|
|
|
* @since 9
|
2022-03-08 10:42:53 +00:00
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* Press the specified key.
|
|
|
|
*
|
2023-12-20 02:30:28 +00:00
|
|
|
* @param { number } keyCode - the target keyCode.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @returns { Promise<void> }
|
2024-04-12 08:13:39 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed.
|
2024-06-13 02:30:51 +00:00
|
|
|
* @throws { BusinessError } 17000002 - The async function is not called with await.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
2023-11-16 09:13:21 +00:00
|
|
|
* @crossplatform
|
2023-11-09 09:12:06 +00:00
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2022-09-14 13:07:20 +00:00
|
|
|
triggerKey(keyCode: number): Promise<void>;
|
2022-03-08 10:42:53 +00:00
|
|
|
|
2022-06-16 04:00:31 +00:00
|
|
|
/**
|
|
|
|
* Press two or three key combinations
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @param { number } key0 the first keyCode.
|
|
|
|
* @param { number } key1 the second keyCode.
|
|
|
|
* @param { number } key2 the third keyCode.
|
|
|
|
* @returns { Promise<void> }
|
|
|
|
* @throws { BusinessError } 401 - if the input parameters are invalid.
|
|
|
|
* @throws { BusinessError } 17000002 - if the async function was not called with await.
|
2022-06-16 04:00:31 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 9
|
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* Press two or three key combinations
|
|
|
|
*
|
2024-04-12 08:13:39 +00:00
|
|
|
* @param { number } key0 - the first keyCode.
|
|
|
|
* @param { number } key1 - the second keyCode.
|
2023-12-22 01:11:38 +00:00
|
|
|
* @param { number } [key2] - the third keyCode,set it default 0 if null or undefined.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @returns { Promise<void> }
|
2024-04-12 08:13:39 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed.
|
2024-06-13 02:30:51 +00:00
|
|
|
* @throws { BusinessError } 17000002 - The async function is not called with await.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
2023-11-16 09:13:21 +00:00
|
|
|
* @crossplatform
|
2023-11-09 09:12:06 +00:00
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2022-06-16 04:00:31 +00:00
|
|
|
triggerCombineKeys(key0: number, key1: number, key2?: number): Promise<void>;
|
|
|
|
|
2022-03-08 10:42:53 +00:00
|
|
|
/**
|
|
|
|
* Click on the specified location on the screen.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @param { number } x The x-coordinate.
|
|
|
|
* @param { number } y The y-coordinate.
|
|
|
|
* @returns { Promise<void> }
|
|
|
|
* @throws { BusinessError } 401 - if the input parameters are invalid.
|
|
|
|
* @throws { BusinessError } 17000002 - if the async function was not called with await.
|
2022-03-08 10:42:53 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
2022-09-14 13:07:20 +00:00
|
|
|
* @since 9
|
2022-03-08 10:42:53 +00:00
|
|
|
* @test
|
|
|
|
*/
|
2023-06-13 08:18:22 +00:00
|
|
|
/**
|
|
|
|
* Click on the specified location on the screen.
|
|
|
|
*
|
|
|
|
* @param { number } x The x-coordinate.
|
|
|
|
* @param { number } y The y-coordinate.
|
|
|
|
* @returns { Promise<void> }
|
|
|
|
* @throws { BusinessError } 401 - if the input parameters are invalid.
|
|
|
|
* @throws { BusinessError } 17000002 - if the async function was not called with await.
|
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @crossplatform
|
|
|
|
* @since 10
|
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* Click on the specified location on the screen.
|
|
|
|
*
|
2024-04-12 08:13:39 +00:00
|
|
|
* @param { number } x - the x-coordinate, not less than 0.
|
|
|
|
* @param { number } y - the y-coordinate, not less than 0.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @returns { Promise<void> }
|
2024-04-12 08:13:39 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed.
|
2024-06-13 02:30:51 +00:00
|
|
|
* @throws { BusinessError } 17000002 - The async function is not called with await.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @crossplatform
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2022-09-14 13:07:20 +00:00
|
|
|
click(x: number, y: number): Promise<void>;
|
2022-03-08 10:42:53 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* DoubleClick on the specified location on the screen.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @param { number } x The x-coordinate.
|
|
|
|
* @param { number } y The y-coordinate.
|
|
|
|
* @returns { Promise<void> }
|
|
|
|
* @throws { BusinessError } 401 - if the input parameters are invalid.
|
|
|
|
* @throws { BusinessError } 17000002 - if the async function was not called with await.
|
2022-03-08 10:42:53 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
2022-09-14 13:07:20 +00:00
|
|
|
* @since 9
|
2022-03-08 10:42:53 +00:00
|
|
|
* @test
|
|
|
|
*/
|
2023-06-13 08:18:22 +00:00
|
|
|
/**
|
|
|
|
* DoubleClick on the specified location on the screen.
|
|
|
|
*
|
|
|
|
* @param { number } x The x-coordinate.
|
|
|
|
* @param { number } y The y-coordinate.
|
|
|
|
* @returns { Promise<void> }
|
|
|
|
* @throws { BusinessError } 401 - if the input parameters are invalid.
|
|
|
|
* @throws { BusinessError } 17000002 - if the async function was not called with await.
|
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @crossplatform
|
|
|
|
* @since 10
|
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* DoubleClick on the specified location on the screen.
|
|
|
|
*
|
2024-04-12 08:13:39 +00:00
|
|
|
* @param { number } x - the x-coordinate, not less than 0.
|
|
|
|
* @param { number } y - the y-coordinate, not less than 0.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @returns { Promise<void> }
|
2024-04-12 08:13:39 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed.
|
2024-06-13 02:30:51 +00:00
|
|
|
* @throws { BusinessError } 17000002 - The async function is not called with await.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @crossplatform
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2022-09-14 13:07:20 +00:00
|
|
|
doubleClick(x: number, y: number): Promise<void>;
|
2022-03-08 10:42:53 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* LongClick on the specified location on the screen.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @param { number } x The x-coordinate.
|
|
|
|
* @param { number } y The y-coordinate.
|
|
|
|
* @returns { Promise<void> }
|
|
|
|
* @throws { BusinessError } 401 - if the input parameters are invalid.
|
|
|
|
* @throws { BusinessError } 17000002 - if the async function was not called with await.
|
2022-03-08 10:42:53 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
2022-09-14 13:07:20 +00:00
|
|
|
* @since 9
|
2022-03-08 10:42:53 +00:00
|
|
|
* @test
|
|
|
|
*/
|
2023-06-13 08:18:22 +00:00
|
|
|
/**
|
|
|
|
* LongClick on the specified location on the screen.
|
|
|
|
*
|
|
|
|
* @param { number } x The x-coordinate.
|
|
|
|
* @param { number } y The y-coordinate.
|
|
|
|
* @returns { Promise<void> }
|
|
|
|
* @throws { BusinessError } 401 - if the input parameters are invalid.
|
|
|
|
* @throws { BusinessError } 17000002 - if the async function was not called with await.
|
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @crossplatform
|
|
|
|
* @since 10
|
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* LongClick on the specified location on the screen.
|
|
|
|
*
|
2024-04-12 08:13:39 +00:00
|
|
|
* @param { number } x - the x-coordinate, not less than 0.
|
|
|
|
* @param { number } y - the y-coordinate, not less than 0.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @returns { Promise<void> }
|
2024-04-12 08:13:39 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed.
|
2024-06-13 02:30:51 +00:00
|
|
|
* @throws { BusinessError } 17000002 - The async function is not called with await.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @crossplatform
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2022-09-14 13:07:20 +00:00
|
|
|
longClick(x: number, y: number): Promise<void>;
|
2022-03-08 10:42:53 +00:00
|
|
|
|
2022-06-01 02:58:47 +00:00
|
|
|
/**
|
|
|
|
* Swipe on the screen between the specified points.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @param { number } startx The x-coordinate of the starting point.
|
|
|
|
* @param { number } starty The y-coordinate of the starting point.
|
|
|
|
* @param { number } endx The x-coordinate of the ending point.
|
|
|
|
* @param { number } endy The y-coordinate of the ending point.
|
|
|
|
* @param { number } speed The speed of swipe (pixels per second),default is 600,the value ranges from 200 to 40000,set it 600 if out of range.
|
|
|
|
* @returns { Promise<void> }
|
|
|
|
* @throws { BusinessError } 401 - if the input parameters are invalid.
|
|
|
|
* @throws { BusinessError } 17000002 - if the async function was not called with await.
|
2022-06-01 02:58:47 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 9
|
|
|
|
* @test
|
|
|
|
*/
|
2023-06-13 08:18:22 +00:00
|
|
|
/**
|
|
|
|
* Swipe on the screen between the specified points.
|
|
|
|
*
|
|
|
|
* @param { number } startx The x-coordinate of the starting point.
|
|
|
|
* @param { number } starty The y-coordinate of the starting point.
|
|
|
|
* @param { number } endx The x-coordinate of the ending point.
|
|
|
|
* @param { number } endy The y-coordinate of the ending point.
|
|
|
|
* @param { number } speed The speed of swipe (pixels per second),default is 600,the value ranges from 200 to 40000,set it 600 if out of range.
|
|
|
|
* @returns { Promise<void> }
|
|
|
|
* @throws { BusinessError } 401 - if the input parameters are invalid.
|
|
|
|
* @throws { BusinessError } 17000002 - if the async function was not called with await.
|
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @crossplatform
|
|
|
|
* @since 10
|
|
|
|
* @test
|
|
|
|
*/
|
2022-09-14 13:07:20 +00:00
|
|
|
/**
|
2023-11-09 09:12:06 +00:00
|
|
|
* Swipe on the screen between the specified points.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
2024-04-12 08:13:39 +00:00
|
|
|
* @param { number } startx - the x-coordinate of the starting point, not less than 0.
|
|
|
|
* @param { number } starty - the y-coordinate of the starting point, not less than 0.
|
|
|
|
* @param { number } endx - the x-coordinate of the ending point, not less than 0.
|
|
|
|
* @param { number } endy - the y-coordinate of the ending point, not less than 0.
|
2023-12-20 02:30:28 +00:00
|
|
|
* @param { number } [speed] - the speed of swipe(pixels per second),ranges from 200 to 40000. Set it default 600 if out of range or null or undefined.
|
2023-05-06 06:29:02 +00:00
|
|
|
* @returns { Promise<void> }
|
2024-04-12 08:13:39 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed.
|
2024-06-13 02:30:51 +00:00
|
|
|
* @throws { BusinessError } 17000002 - The async function is not called with await.
|
2022-05-16 07:30:16 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
2023-11-09 09:12:06 +00:00
|
|
|
* @crossplatform
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
2022-05-16 07:30:16 +00:00
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
swipe(startx: number, starty: number, endx: number, endy: number, speed?: number): Promise<void>;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Drag on the screen between the specified points.
|
|
|
|
*
|
|
|
|
* @param { number } startx The x-coordinate of the starting point.
|
|
|
|
* @param { number } starty The y-coordinate of the starting point.
|
|
|
|
* @param { number } endx The x-coordinate of the ending point.
|
|
|
|
* @param { number } endy The y-coordinate of the ending point.
|
|
|
|
* @param { number } speed The speed of swipe (pixels per second),default is 600,the value ranges from 200 to 40000,set it 600 if out of range.
|
|
|
|
* @returns { Promise<void> }
|
|
|
|
* @throws { BusinessError } 401 - if the input parameters are invalid.
|
|
|
|
* @throws { BusinessError } 17000002 - if the async function was not called with await.
|
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 9
|
|
|
|
* @test
|
|
|
|
*/
|
|
|
|
/**
|
|
|
|
* Drag on the screen between the specified points.
|
|
|
|
*
|
2024-04-12 08:13:39 +00:00
|
|
|
* @param { number } startx - the x-coordinate of the starting point, not less than 0.
|
|
|
|
* @param { number } starty - the y-coordinate of the starting point, not less than 0.
|
|
|
|
* @param { number } endx - the x-coordinate of the ending point, not less than 0.
|
|
|
|
* @param { number } endy - the y-coordinate of the ending point, not less than 0.
|
2023-12-20 02:30:28 +00:00
|
|
|
* @param { number } [speed] the speed of drag(pixels per second),ranges from 200 to 40000. Set it default 600 if out of range or null or undefined.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @returns { Promise<void> }
|
2024-04-12 08:13:39 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed.
|
2024-06-13 02:30:51 +00:00
|
|
|
* @throws { BusinessError } 17000002 - The async function is not called with await.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
|
|
|
drag(startx: number, starty: number, endx: number, endy: number, speed?: number): Promise<void>;
|
2022-05-16 07:30:16 +00:00
|
|
|
|
2022-03-08 10:42:53 +00:00
|
|
|
/**
|
2023-02-22 09:55:03 +00:00
|
|
|
* Capture current screen and save as picture which PNG format.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @param { string } savePath the path where to store the picture.
|
|
|
|
* @returns { Promise<boolean> } 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.
|
2022-03-08 10:42:53 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
2023-02-22 09:55:03 +00:00
|
|
|
* @since 9
|
2022-03-08 10:42:53 +00:00
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* Capture current screen and save as picture which PNG format.
|
|
|
|
*
|
2024-04-12 08:13:39 +00:00
|
|
|
* @param { string } savePath - the path where to store the picture, must be in the application sandbox directory.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @returns { Promise<boolean> } true if screen-capturing and file-storing are completed successfully,false otherwise.
|
2024-04-12 08:13:39 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed.
|
2024-06-13 02:30:51 +00:00
|
|
|
* @throws { BusinessError } 17000002 - The async function is not called with await.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2023-02-22 09:55:03 +00:00
|
|
|
screenCap(savePath: string): Promise<boolean>;
|
2022-07-18 08:25:31 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Set the rotation of the device display.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @param { DisplayRotation } rotation The target rotation to set.
|
|
|
|
* @returns { Promise<void> }
|
|
|
|
* @throws { BusinessError } 401 - if the input parameters are invalid.
|
|
|
|
* @throws { BusinessError } 17000002 - if the async function was not called with await.
|
2022-07-18 08:25:31 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 9
|
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* Set the rotation of the device display.
|
|
|
|
*
|
2023-12-20 02:30:28 +00:00
|
|
|
* @param { DisplayRotation } rotation - the target rotation to set.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @returns { Promise<void> }
|
2024-04-12 08:13:39 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed.
|
2024-06-13 02:30:51 +00:00
|
|
|
* @throws { BusinessError } 17000002 - The async function is not called with await.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2022-09-14 13:07:20 +00:00
|
|
|
setDisplayRotation(rotation: DisplayRotation): Promise<void>;
|
2022-07-18 08:25:31 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the rotation of the device display.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @returns { Promise<DisplayRotation> } the current display rotation.
|
|
|
|
* @throws { BusinessError } 17000002 - if the async function was not called with await.
|
2022-07-18 08:25:31 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 9
|
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* Get the rotation of the device display.
|
|
|
|
*
|
|
|
|
* @returns { Promise<DisplayRotation> } the current display rotation.
|
2024-06-13 02:30:51 +00:00
|
|
|
* @throws { BusinessError } 17000002 - The async function is not called with await.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2022-09-14 13:07:20 +00:00
|
|
|
getDisplayRotation(): Promise<DisplayRotation>;
|
2022-07-18 08:25:31 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Enable/disable the rotation of device display.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @param { boolean } enabled Enable the rotation or not.
|
|
|
|
* @returns { Promise<void> }
|
|
|
|
* @throws { BusinessError } 401 - if the input parameters are invalid.
|
|
|
|
* @throws { BusinessError } 17000002 - if the async function was not called with await.
|
2022-07-18 08:25:31 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 9
|
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* Enable/disable the rotation of device display.
|
|
|
|
*
|
2023-12-20 02:30:28 +00:00
|
|
|
* @param { boolean } enabled - enable the rotation or not.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @returns { Promise<void> }
|
2024-04-12 08:13:39 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed.
|
2024-06-13 02:30:51 +00:00
|
|
|
* @throws { BusinessError } 17000002 - The async function is not called with await.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2022-09-14 13:07:20 +00:00
|
|
|
setDisplayRotationEnabled(enabled: boolean): Promise<void>;
|
2022-07-18 08:25:31 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the size of the device display.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @returns { Promise<Point> } the size of the device display.
|
|
|
|
* @throws { BusinessError } 17000002 - if the async function was not called with await.
|
2022-07-18 08:25:31 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 9
|
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* Get the size of the device display.
|
|
|
|
*
|
|
|
|
* @returns { Promise<Point> } the size of the device display.
|
2024-06-13 02:30:51 +00:00
|
|
|
* @throws { BusinessError } 17000002 - The async function is not called with await.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2022-09-14 13:07:20 +00:00
|
|
|
getDisplaySize(): Promise<Point>;
|
2022-07-18 08:25:31 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the density of the device display.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @returns { Promise<Point> } the density of the device display.
|
|
|
|
* @throws { BusinessError } 17000002 - if the async function was not called with await.
|
2022-07-18 08:25:31 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 9
|
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* Get the density of the device display.
|
|
|
|
*
|
|
|
|
* @returns { Promise<Point> } the density of the device display.
|
2024-06-13 02:30:51 +00:00
|
|
|
* @throws { BusinessError } 17000002 - The async function is not called with await.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2022-09-14 13:07:20 +00:00
|
|
|
getDisplayDensity(): Promise<Point>;
|
2022-07-18 08:25:31 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Wake up the device display.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @returns { Promise<void> }
|
|
|
|
* @throws { BusinessError } 17000002 - if the async function was not called with await.
|
2022-07-18 08:25:31 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 9
|
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* Wake up the device display.
|
|
|
|
*
|
|
|
|
* @returns { Promise<void> }
|
2024-06-13 02:30:51 +00:00
|
|
|
* @throws { BusinessError } 17000002 - The async function is not called with await.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2022-09-14 13:07:20 +00:00
|
|
|
wakeUpDisplay(): Promise<void>;
|
2022-07-18 08:25:31 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Press the home key.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @returns { Promise<void> }
|
|
|
|
* @throws { BusinessError } 17000002 - if the async function was not called with await.
|
2022-07-18 08:25:31 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 9
|
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* Press the home key.
|
|
|
|
*
|
|
|
|
* @returns { Promise<void> }
|
2024-06-13 02:30:51 +00:00
|
|
|
* @throws { BusinessError } 17000002 - The async function is not called with await.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2022-09-14 13:07:20 +00:00
|
|
|
pressHome(): Promise<void>;
|
2022-07-18 08:25:31 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Wait for the UI become idle.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @param { number } idleTime the threshold of UI idle time, in millisecond.
|
|
|
|
* @param { number } timeout The maximum time to wait for idle, in millisecond.
|
|
|
|
* @returns { Promise<boolean> } 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.
|
2022-07-18 08:25:31 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 9
|
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* Wait for the UI become idle.
|
|
|
|
*
|
2024-04-12 08:13:39 +00:00
|
|
|
* @param { number } idleTime - the threshold of UI idle time, in millisecond, not less than 0.
|
|
|
|
* @param { number } timeout - the maximum time to wait for idle, in millisecond, not less than 0.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @returns { Promise<boolean> } true if wait for idle succeed in the timeout, false otherwise.
|
2024-04-12 08:13:39 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed.
|
2024-06-13 02:30:51 +00:00
|
|
|
* @throws { BusinessError } 17000002 - The async function is not called with await.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2022-09-14 13:07:20 +00:00
|
|
|
waitForIdle(idleTime: number, timeout: number): Promise<boolean>;
|
2022-07-18 08:25:31 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Inject fling on the device display.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @param { Point } from The coordinate point where the finger touches the screen.
|
|
|
|
* @param { Point } to The coordinate point where the finger leaves the screen.
|
|
|
|
* @param { number } stepLen the length of each step, in pixels.
|
|
|
|
* @param { number } speed The speed of fling (pixels per second),default is 600,the value ranges from 200 to 40000,set it 600 if out of range.
|
|
|
|
* @returns { Promise<void> }
|
|
|
|
* @throws { BusinessError } 401 - if the input parameters are invalid.
|
|
|
|
* @throws { BusinessError } 17000002 - if the async function was not called with await.
|
2022-07-18 08:25:31 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 9
|
|
|
|
* @test
|
|
|
|
*/
|
2023-06-13 08:18:22 +00:00
|
|
|
/**
|
|
|
|
* Inject fling on the device display.
|
|
|
|
*
|
|
|
|
* @param { Point } from The coordinate point where the finger touches the screen.
|
|
|
|
* @param { Point } to The coordinate point where the finger leaves the screen.
|
|
|
|
* @param { number } stepLen the length of each step, in pixels.
|
|
|
|
* @param { number } speed The speed of fling (pixels per second),default is 600,the value ranges from 200 to 40000,set it 600 if out of range.
|
|
|
|
* @returns { Promise<void> }
|
|
|
|
* @throws { BusinessError } 401 - if the input parameters are invalid.
|
|
|
|
* @throws { BusinessError } 17000002 - if the async function was not called with await.
|
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @crossplatform
|
|
|
|
* @since 10
|
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* Inject fling on the device display.
|
|
|
|
*
|
2023-12-20 02:30:28 +00:00
|
|
|
* @param { Point } from - the coordinate point where the finger touches the screen.
|
|
|
|
* @param { Point } to - the coordinate point where the finger leaves the screen.
|
|
|
|
* @param { number } stepLen - the length of each step, in pixels.
|
|
|
|
* @param { number } [speed] - the speed of fling(pixels per second),ranges from 200 to 40000. Set it default 600 if out of range or null or undefined.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @returns { Promise<void> }
|
2024-04-12 08:13:39 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed.
|
2024-06-13 02:30:51 +00:00
|
|
|
* @throws { BusinessError } 17000002 - The async function is not called with await.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @crossplatform
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2022-09-14 13:07:20 +00:00
|
|
|
fling(from: Point, to: Point, stepLen: number, speed: number): Promise<void>;
|
2022-07-18 08:25:31 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Inject multi-pointer action on the device display.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @param { PointerMatrix } pointers The two-dimensional array of pointers to inject.
|
|
|
|
* @param { number } speed The speed of swipe (pixels per second),default is 600,the value ranges from 200 to 40000,set it 600 if out of range.
|
|
|
|
* @returns { Promise<boolean> } 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.
|
2022-07-18 08:25:31 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 9
|
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* Inject multi-pointer action on the device display.
|
|
|
|
*
|
2023-12-20 02:30:28 +00:00
|
|
|
* @param { PointerMatrix } pointers - the two-dimensional array of pointers to inject.
|
|
|
|
* @param { number } [speed] - the speed of swipe(pixels per second),ranges from 200 to 40000. Set it default 600 if out of range or null or undefined.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @returns { Promise<boolean> } true if the operation finished, false
|
2024-04-12 08:13:39 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed.
|
2024-06-13 02:30:51 +00:00
|
|
|
* @throws { BusinessError } 17000002 - The async function is not called with await.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
2023-11-16 09:13:21 +00:00
|
|
|
* @crossplatform
|
2023-11-09 09:12:06 +00:00
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2022-09-14 13:07:20 +00:00
|
|
|
injectMultiPointerAction(pointers: PointerMatrix, speed?: number): Promise<boolean>;
|
2023-04-21 09:47:24 +00:00
|
|
|
|
2023-02-22 08:58:29 +00:00
|
|
|
/**
|
|
|
|
* Inject fling on the device display.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @param { UiDirection } direction The direction of this action.
|
|
|
|
* @param { number } speed The speed of fling (pixels per second),default is 600,the value ranges from 200 to 40000,set it 600 if out of range.
|
|
|
|
* @returns { Promise<void> }
|
|
|
|
* @throws { BusinessError } 401 - if the input parameters are invalid.
|
|
|
|
* @throws { BusinessError } 17000002 - if the async function was not called with await.
|
2023-02-22 08:58:29 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 10
|
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* Inject fling on the device display.
|
|
|
|
*
|
2023-12-20 02:30:28 +00:00
|
|
|
* @param { UiDirection } direction - the direction of this action.
|
|
|
|
* @param { number } speed - the speed of fling (pixels per second),default is 600,the value ranges from 200 to 40000,set it 600 if out of range.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @returns { Promise<void> }
|
2024-04-12 08:13:39 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @throws { BusinessError } 17000002 - if the async function was not called with await.
|
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2024-05-13 01:50:49 +00:00
|
|
|
/**
|
|
|
|
* Inject fling on the device display.
|
|
|
|
*
|
|
|
|
* @param { UiDirection } direction - the direction of this action.
|
|
|
|
* @param { number } speed - the speed of fling (pixels per second),default is 600,the value ranges from 200 to 40000,set it 600 if out of range.
|
|
|
|
* @returns { Promise<void> }
|
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed.
|
2024-06-13 02:30:51 +00:00
|
|
|
* @throws { BusinessError } 17000002 - The async function is not called with await.
|
2024-05-13 01:50:49 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @crossplatform
|
|
|
|
* @atomicservice
|
|
|
|
* @since 12
|
|
|
|
* @test
|
|
|
|
*/
|
2023-03-01 01:42:16 +00:00
|
|
|
fling(direction: UiDirection, speed: number): Promise<void>;
|
2023-04-21 09:47:24 +00:00
|
|
|
|
2023-02-22 08:58:29 +00:00
|
|
|
/**
|
|
|
|
* Click on the specified location on the screen with the specified mouse button, and press the specified key simultaneously if necessary.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @param { Point } p The coordinate of the specified location.
|
|
|
|
* @param { MouseButton } btnId The button of Mouse.
|
|
|
|
* @param { number } key1 the first keyCode.
|
|
|
|
* @param { number } key2 the second keyCode.
|
|
|
|
* @returns { Promise<void> }
|
|
|
|
* @throws { BusinessError } 401 - if the input parameters are invalid.
|
|
|
|
* @throws { BusinessError } 17000002 - if the async function was not called with await.
|
2023-02-22 08:58:29 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 10
|
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* Click on the specified location on the screen with the specified mouse button, and press the specified key simultaneously if necessary.
|
|
|
|
*
|
2023-12-20 02:30:28 +00:00
|
|
|
* @param { Point } p - the coordinate of the specified location.
|
|
|
|
* @param { MouseButton } btnId - the button of Mouse.
|
2023-12-22 01:11:38 +00:00
|
|
|
* @param { number } [key1] - the first keyCode,set it default 0 if null or undefined.
|
|
|
|
* @param { number } [key2] - the second keyCode,set it default 0 if null or undefined.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @returns { Promise<void> }
|
2024-04-12 08:13:39 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed.
|
2024-06-13 02:30:51 +00:00
|
|
|
* @throws { BusinessError } 17000002 - The async function is not called with await.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2023-02-22 09:55:03 +00:00
|
|
|
mouseClick(p: Point, btnId: MouseButton, key1?: number, key2?: number): Promise<void>;
|
2023-04-21 09:47:24 +00:00
|
|
|
|
2023-02-22 08:58:29 +00:00
|
|
|
/**
|
2023-03-02 08:40:23 +00:00
|
|
|
* Move the mouse cursor to the specified location.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @param { Point } p The coordinate of the specified location.
|
|
|
|
* @returns { Promise<void> }
|
|
|
|
* @throws { BusinessError } 401 - if the input parameters are invalid.
|
|
|
|
* @throws { BusinessError } 17000002 - if the async function was not called with await.
|
2023-02-22 08:58:29 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 10
|
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* Move the mouse cursor to the specified location.
|
|
|
|
*
|
2023-12-20 02:30:28 +00:00
|
|
|
* @param { Point } p - the coordinate of the specified location.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @returns { Promise<void> }
|
2024-04-12 08:13:39 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed.
|
2024-06-13 02:30:51 +00:00
|
|
|
* @throws { BusinessError } 17000002 - The async function is not called with await.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2023-02-22 08:58:29 +00:00
|
|
|
mouseMoveTo(p: Point): Promise<void>;
|
2023-04-21 09:47:24 +00:00
|
|
|
|
2023-02-22 08:58:29 +00:00
|
|
|
/**
|
|
|
|
* The mouse wheel scrolls the specified cell at the specified position, and press the specified key simultaneously if necessary.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @param { Point } p The coordinate of the specified location.
|
|
|
|
* @param { boolean } down Whether the mouse wheel rolls down.
|
|
|
|
* @param { number } d The number of cells that the mouse wheel scrolls, each cell will make the target point shift 120 pixels.
|
|
|
|
* @param { number } key1 the first keyCode.
|
|
|
|
* @param { number } key2 the second keyCode.
|
|
|
|
* @returns { Promise<void> }
|
|
|
|
* @throws { BusinessError } 401 - if the input parameters are invalid.
|
|
|
|
* @throws { BusinessError } 17000002 - if the async function was not called with await.
|
2023-02-22 08:58:29 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 10
|
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* The mouse wheel scrolls the specified cell at the specified position, and press the specified key simultaneously if necessary.
|
|
|
|
*
|
2023-12-20 02:30:28 +00:00
|
|
|
* @param { Point } p - the coordinate of the specified location.
|
|
|
|
* @param { boolean } down - whether the mouse wheel rolls down.
|
|
|
|
* @param { number } d - the number of cells that the mouse wheel scrolls, each cell will make the target point shift 120 pixels.
|
2023-12-22 01:11:38 +00:00
|
|
|
* @param { number } [key1] - the first keyCode,set it default 0 if null or undefined.
|
|
|
|
* @param { number } [key2] - the second keyCode,set it default 0 if null or undefined.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @returns { Promise<void> }
|
2024-04-12 08:13:39 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed.
|
2024-06-13 02:30:51 +00:00
|
|
|
* @throws { BusinessError } 17000002 - The async function is not called with await.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2023-09-14 06:18:22 +00:00
|
|
|
mouseScroll(p: Point, down: boolean, d: number, key1?: number, key2?: number): Promise<void>;
|
2023-09-14 06:40:23 +00:00
|
|
|
/**
|
|
|
|
* The mouse wheel scrolls the specified cell at the specified position, and press the specified key simultaneously if necessary.
|
|
|
|
*
|
2023-10-08 01:49:26 +00:00
|
|
|
* @param { Point } p - the coordinate of the specified location.
|
|
|
|
* @param { boolean } down - whether the mouse wheel rolls down.
|
|
|
|
* @param { number } d - the number of cells that the mouse wheel scrolls, each cell will make the target point shift 120 pixels.
|
2023-12-22 01:11:38 +00:00
|
|
|
* @param { number } [key1] - the first keyCode,set it default 0 if null or undefined.
|
|
|
|
* @param { number } [key2] - the second keyCode,set it default 0 if null or undefined.
|
2023-12-20 03:56:49 +00:00
|
|
|
* @param { number } [speed] - The Speed of mouse wheel rolls(cells per second),ranges from 1 to 500.Set it default 20 if out of range or null or undefined.
|
2023-09-14 06:40:23 +00:00
|
|
|
* @returns { Promise<void> }
|
2024-04-12 08:13:39 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed.
|
2024-06-13 02:30:51 +00:00
|
|
|
* @throws { BusinessError } 17000002 - The async function is not called with await.
|
2023-09-14 06:40:23 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
2023-11-09 09:12:06 +00:00
|
|
|
* @atomicservice
|
2023-09-14 06:40:23 +00:00
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
|
|
|
mouseScroll(p: Point, down: boolean, d: number, key1?: number, key2?: number, speed?: number): Promise<void>;
|
2023-04-21 09:47:24 +00:00
|
|
|
|
2023-02-22 09:55:03 +00:00
|
|
|
/**
|
|
|
|
* Capture the specified area of current screen and save as picture which PNG format.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @param { string } savePath the path where to store the picture.
|
2023-12-20 02:30:28 +00:00
|
|
|
* @param { Rect } rect The specified area of current screen, default to full screen.
|
2023-05-06 06:29:02 +00:00
|
|
|
* @returns { Promise<boolean> } 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.
|
2023-02-22 09:55:03 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 10
|
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* Capture the specified area of current screen and save as picture which PNG format.
|
|
|
|
*
|
2024-04-12 08:13:39 +00:00
|
|
|
* @param { string } savePath - the path where to store the picture, must be in the application sandbox directory.
|
2023-12-20 02:30:28 +00:00
|
|
|
* @param { Rect } [rect] - the specified area of current screen, default to full screen.Set it default if null or undefined.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @returns { Promise<boolean> } true if screen-capturing and file-storing are completed successfully,false otherwise.
|
2024-04-12 08:13:39 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed.
|
2024-06-13 02:30:51 +00:00
|
|
|
* @throws { BusinessError } 17000002 - The async function is not called with await.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2023-03-02 03:01:27 +00:00
|
|
|
screenCapture(savePath: string, rect?: Rect): Promise<boolean>;
|
2023-09-14 02:42:11 +00:00
|
|
|
|
2023-05-15 06:45:47 +00:00
|
|
|
/**
|
2023-05-15 08:06:50 +00:00
|
|
|
* Create an {@link UIEventObserver} object.
|
2023-05-15 06:45:47 +00:00
|
|
|
*
|
2023-05-15 08:06:50 +00:00
|
|
|
* @returns { UIEventObserver } the {@link UIEventObserver} object.
|
2023-05-15 06:45:47 +00:00
|
|
|
* @throws { BusinessError } 17000002 - if the async function was not called with await.
|
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 10
|
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* Create an {@link UIEventObserver} object.
|
|
|
|
*
|
|
|
|
* @returns { UIEventObserver } the {@link UIEventObserver} object.
|
2024-06-13 02:30:51 +00:00
|
|
|
* @throws { BusinessError } 17000002 - The async function is not called with await.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2023-05-15 08:13:17 +00:00
|
|
|
createUIEventObserver(): UIEventObserver;
|
2023-09-14 02:42:11 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Double click on the specified location on the screen with the specified mouse button, and press the specified key simultaneously if necessary.
|
|
|
|
*
|
2023-10-08 01:49:26 +00:00
|
|
|
* @param { Point } p - the coordinate of the specified location.
|
|
|
|
* @param { MouseButton } btnId - the button of Mouse.
|
2023-12-22 01:11:38 +00:00
|
|
|
* @param { number } [key1] - the first keyCode,set it default 0 if null or undefined.
|
|
|
|
* @param { number } [key2] - the second keyCode,set it default 0 if null or undefined.
|
2023-09-14 02:42:11 +00:00
|
|
|
* @returns { Promise<void> }
|
2024-04-12 08:13:39 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed.
|
2024-06-13 02:30:51 +00:00
|
|
|
* @throws { BusinessError } 17000002 - The async function is not called with await.
|
2023-09-14 02:42:11 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
2023-11-09 09:12:06 +00:00
|
|
|
* @atomicservice
|
2023-09-14 06:18:22 +00:00
|
|
|
* @since 11
|
2023-09-14 02:42:11 +00:00
|
|
|
* @test
|
|
|
|
*/
|
|
|
|
mouseDoubleClick(p: Point, btnId: MouseButton, key1?: number, key2?: number): Promise<void>;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Long click on the specified location on the screen with the specified mouse button, and press the specified key simultaneously if necessary.
|
|
|
|
*
|
2023-10-08 01:49:26 +00:00
|
|
|
* @param { Point } p - the coordinate of the specified location.
|
|
|
|
* @param { MouseButton } btnId - the button of Mouse.
|
2023-12-22 01:11:38 +00:00
|
|
|
* @param { number } [key1] - the first keyCode,set it default 0 if null or undefined.
|
|
|
|
* @param { number } [key2] - the second keyCode,set it default 0 if null or undefined.
|
2023-09-14 02:42:11 +00:00
|
|
|
* @returns { Promise<void> }
|
2024-04-12 08:13:39 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed.
|
2024-06-13 02:30:51 +00:00
|
|
|
* @throws { BusinessError } 17000002 - The async function is not called with await.
|
2023-09-14 02:42:11 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
2023-11-09 09:12:06 +00:00
|
|
|
* @atomicservice
|
2023-09-14 06:18:22 +00:00
|
|
|
* @since 11
|
2023-09-14 02:42:11 +00:00
|
|
|
* @test
|
|
|
|
*/
|
|
|
|
mouseLongClick(p: Point, btnId: MouseButton, key1?: number, key2?: number): Promise<void>;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Swipe on the screen between the specified points with mouse.
|
|
|
|
*
|
2023-10-08 01:49:26 +00:00
|
|
|
* @param { Point } from - the starting point.
|
|
|
|
* @param { Point } to - the ending point.
|
2023-12-20 02:30:28 +00:00
|
|
|
* @param { number } [speed] - speed of swipe (pixels per second),the value ranges from 200 to 40000.Set it default 600 if out of range or null or undefined.
|
2023-09-14 02:42:11 +00:00
|
|
|
* @returns { Promise<void> }
|
2024-04-12 08:13:39 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed.
|
2024-06-13 02:30:51 +00:00
|
|
|
* @throws { BusinessError } 17000002 - The async function is not called with await.
|
2023-09-14 02:42:11 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
2023-11-09 09:12:06 +00:00
|
|
|
* @atomicservice
|
2023-09-14 06:18:22 +00:00
|
|
|
* @since 11
|
2023-09-14 02:42:11 +00:00
|
|
|
* @test
|
|
|
|
*/
|
|
|
|
mouseMoveWithTrack(from: Point, to: Point, speed?: number): Promise<void>;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Hold down the left mouse button and drag on the screen between the specified points.
|
|
|
|
*
|
2023-10-08 01:49:26 +00:00
|
|
|
* @param { Point } from - the starting point.
|
|
|
|
* @param { Point } to - the ending point.
|
2023-12-20 02:44:03 +00:00
|
|
|
* @param { number } [speed] - speed of drag (pixels per second),the value ranges from 200 to 40000,Set it default 600 if out of range or null or undefined.
|
2023-09-14 02:42:11 +00:00
|
|
|
* @returns { Promise<void> }
|
2024-04-12 08:13:39 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed.
|
2024-06-13 02:30:51 +00:00
|
|
|
* @throws { BusinessError } 17000002 - The async function is not called with await.
|
2023-09-14 02:42:11 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
2023-11-09 09:12:06 +00:00
|
|
|
* @atomicservice
|
2023-09-14 06:18:22 +00:00
|
|
|
* @since 11
|
2023-09-14 02:42:11 +00:00
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
mouseDrag(from: Point, to: Point, speed?: number): Promise<void>;
|
2023-09-14 02:42:11 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Inject text on the specified location.
|
|
|
|
*
|
2023-10-08 01:49:26 +00:00
|
|
|
* @param { Point } p - the coordinate of the specified location.
|
|
|
|
* @param { string } text - the text to inject.
|
2023-09-14 02:42:11 +00:00
|
|
|
* @returns { Promise<void> }
|
2024-04-12 08:13:39 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed.
|
2024-06-13 02:30:51 +00:00
|
|
|
* @throws { BusinessError } 17000002 - The async function is not called with await.
|
2023-09-14 02:42:11 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
2023-11-09 09:12:06 +00:00
|
|
|
* @atomicservice
|
2023-09-14 06:18:22 +00:00
|
|
|
* @since 11
|
2023-09-14 02:42:11 +00:00
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
inputText(p: Point, text: string): Promise<void>;
|
2022-03-08 10:42:53 +00:00
|
|
|
}
|
|
|
|
|
2022-06-01 02:58:47 +00:00
|
|
|
/**
|
2023-05-06 06:29:02 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
2022-06-01 02:58:47 +00:00
|
|
|
* @since 9
|
|
|
|
* @test
|
|
|
|
*/
|
2024-01-13 09:01:43 +00:00
|
|
|
/**
|
|
|
|
* Represents a window of the ohos application,user can perform operations or query attributes on it.
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2022-09-14 13:07:20 +00:00
|
|
|
declare class UiWindow {
|
2022-06-01 02:58:47 +00:00
|
|
|
/**
|
|
|
|
* Get the bundle name of this {@link UiWindow}.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @returns { Promise<string> } 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.
|
2022-06-01 02:58:47 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 9
|
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* Get the bundle name of this {@link UiWindow}.
|
|
|
|
*
|
|
|
|
* @returns { Promise<string> } the bundle name.
|
2024-06-13 02:30:51 +00:00
|
|
|
* @throws { BusinessError } 17000002 - The async function is not called with await.
|
|
|
|
* @throws { BusinessError } 17000004 - The window or component is invisible or destroyed.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2022-09-14 13:07:20 +00:00
|
|
|
getBundleName(): Promise<string>;
|
2022-06-01 02:58:47 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the bounds rect of this {@link UiWindow}.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @returns { Promise<Rect> } 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.
|
2022-06-01 02:58:47 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 9
|
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* Get the bounds rect of this {@link UiWindow}.
|
|
|
|
*
|
|
|
|
* @returns { Promise<Rect> } the bounds rect object.
|
2024-06-13 02:30:51 +00:00
|
|
|
* @throws { BusinessError } 17000002 - The async function is not called with await.
|
|
|
|
* @throws { BusinessError } 17000004 - The window or component is invisible or destroyed.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
2023-11-16 09:13:21 +00:00
|
|
|
* @crossplatform
|
2023-11-09 09:12:06 +00:00
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2022-09-14 13:07:20 +00:00
|
|
|
getBounds(): Promise<Rect>;
|
|
|
|
|
2022-06-01 02:58:47 +00:00
|
|
|
/**
|
|
|
|
* Get the title of this {@link UiWindow}.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @returns { Promise<string> } 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.
|
2022-06-01 02:58:47 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 9
|
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* Get the title of this {@link UiWindow}.
|
|
|
|
*
|
|
|
|
* @returns { Promise<string> } the title value.
|
2024-06-13 02:30:51 +00:00
|
|
|
* @throws { BusinessError } 17000002 - The async function is not called with await.
|
|
|
|
* @throws { BusinessError } 17000004 - The window or component is invisible or destroyed.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2022-09-14 13:07:20 +00:00
|
|
|
getTitle(): Promise<string>;
|
|
|
|
|
2022-06-01 02:58:47 +00:00
|
|
|
/**
|
2022-09-14 13:07:20 +00:00
|
|
|
* Get the window mode of this {@link UiWindow}.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @returns { Promise<WindowMode> } 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.
|
2022-06-01 02:58:47 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 9
|
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* Get the window mode of this {@link UiWindow}.
|
|
|
|
*
|
|
|
|
* @returns { Promise<WindowMode> } the {@link WindowMode} object
|
2024-06-13 02:30:51 +00:00
|
|
|
* @throws { BusinessError } 17000002 - The async function is not called with await.
|
|
|
|
* @throws { BusinessError } 17000004 - The window or component is invisible or destroyed.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2022-09-14 13:07:20 +00:00
|
|
|
getWindowMode(): Promise<WindowMode>;
|
2022-06-01 02:58:47 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the focused status of this {@link UiWindow}.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @returns { Promise<boolean> } 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.
|
2022-06-01 02:58:47 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 9
|
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* Get the focused status of this {@link UiWindow}.
|
|
|
|
*
|
|
|
|
* @returns { Promise<boolean> } the focused status
|
2024-06-13 02:30:51 +00:00
|
|
|
* @throws { BusinessError } 17000002 - The async function is not called with await.
|
|
|
|
* @throws { BusinessError } 17000004 - The window or component is invisible or destroyed.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2022-09-14 13:07:20 +00:00
|
|
|
isFocused(): Promise<boolean>;
|
2022-06-01 02:58:47 +00:00
|
|
|
|
|
|
|
/**
|
2022-09-14 13:07:20 +00:00
|
|
|
* Get the active status of this {@link UiWindow}.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @returns { Promise<boolean> } 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.
|
2022-06-01 02:58:47 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 9
|
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* Get the active status of this {@link UiWindow}.
|
|
|
|
*
|
|
|
|
* @returns { Promise<boolean> } the actived status
|
2024-06-13 02:30:51 +00:00
|
|
|
* @throws { BusinessError } 17000002 - The async function is not called with await.
|
|
|
|
* @throws { BusinessError } 17000004 - The window or component is invisible or destroyed.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 11
|
2023-11-16 09:13:21 +00:00
|
|
|
* @deprecated since 11
|
2023-12-01 01:47:10 +00:00
|
|
|
* @useinstead ohos.UiTest.UiWindow#isActive
|
2023-11-09 09:12:06 +00:00
|
|
|
* @test
|
|
|
|
*/
|
2022-09-14 13:07:20 +00:00
|
|
|
isActived(): Promise<boolean>;
|
2022-06-01 02:58:47 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Set the focused status of this {@link UiWindow}.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @returns { Promise<void> }
|
|
|
|
* @throws { BusinessError } 17000002 - if the async function was not called with await.
|
|
|
|
* @throws { BusinessError } 17000004 - if the window is invisible or destroyed.
|
2022-06-01 02:58:47 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 9
|
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* Set the focused status of this {@link UiWindow}.
|
|
|
|
*
|
|
|
|
* @returns { Promise<void> }
|
2024-06-13 02:30:51 +00:00
|
|
|
* @throws { BusinessError } 17000002 - The async function is not called with await.
|
|
|
|
* @throws { BusinessError } 17000004 - The window or component is invisible or destroyed.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2022-09-14 13:07:20 +00:00
|
|
|
focus(): Promise<void>;
|
2022-06-01 02:58:47 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Move this {@link UiWindow} to the specified points.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @param { number } x The x coordinate of destination.
|
|
|
|
* @param { number } y The y coordinate of destination.
|
|
|
|
* @returns { Promise<void> }
|
|
|
|
* @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.
|
2022-06-01 02:58:47 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 9
|
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* Move this {@link UiWindow} to the specified points.
|
|
|
|
*
|
2024-04-12 08:13:39 +00:00
|
|
|
* @param { number } x - the x coordinate of destination, not less than 0.
|
|
|
|
* @param { number } y - the y coordinate of destination, not less than 0.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @returns { Promise<void> }
|
2024-04-12 08:13:39 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed.
|
2024-06-13 02:30:51 +00:00
|
|
|
* @throws { BusinessError } 17000002 - The async function is not called with await.
|
|
|
|
* @throws { BusinessError } 17000004 - The window or component is invisible or destroyed.
|
|
|
|
* @throws { BusinessError } 17000005 - This operation is not supported.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2022-09-14 13:07:20 +00:00
|
|
|
moveTo(x: number, y: number): Promise<void>;
|
2022-06-01 02:58:47 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Resize this {@link UiWindow} to the specified size for the specified direction.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @param { number } wide The expected wide of the window after resizing.
|
|
|
|
* @param { number } height The expected height of the window after resizing.
|
|
|
|
* @param { ResizeDirection } direction The expected direction of the window after resizing.
|
|
|
|
* @returns { Promise<void> }
|
|
|
|
* @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.
|
2022-06-01 02:58:47 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 9
|
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* Resize this {@link UiWindow} to the specified size for the specified direction.
|
|
|
|
*
|
2023-12-20 02:30:28 +00:00
|
|
|
* @param { number } wide - the expected wide of the window after resizing.
|
|
|
|
* @param { number } height - the expected height of the window after resizing.
|
|
|
|
* @param { ResizeDirection } direction - the expected direction of the window after resizing.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @returns { Promise<void> }
|
2024-04-12 08:13:39 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed.
|
2024-06-13 02:30:51 +00:00
|
|
|
* @throws { BusinessError } 17000002 - The async function is not called with await.
|
|
|
|
* @throws { BusinessError } 17000004 - The window or component is invisible or destroyed.
|
|
|
|
* @throws { BusinessError } 17000005 - This operation is not supported.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2022-09-14 13:07:20 +00:00
|
|
|
resize(wide: number, height: number, direction: ResizeDirection): Promise<void>;
|
2022-06-01 02:58:47 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Change this {@link UiWindow} into split screen mode.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @returns { Promise<void> }
|
|
|
|
* @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.
|
2022-06-01 02:58:47 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 9
|
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* Change this {@link UiWindow} into split screen mode.
|
|
|
|
*
|
|
|
|
* @returns { Promise<void> }
|
2024-06-13 02:30:51 +00:00
|
|
|
* @throws { BusinessError } 17000002 - The async function is not called with await.
|
|
|
|
* @throws { BusinessError } 17000004 - The window or component is invisible or destroyed.
|
|
|
|
* @throws { BusinessError } 17000005 - This operation is not supported.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2022-09-14 13:07:20 +00:00
|
|
|
split(): Promise<void>;
|
2022-06-01 02:58:47 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Maximize this {@link UiWindow}.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @returns { Promise<void> }
|
|
|
|
* @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.
|
2022-06-01 02:58:47 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 9
|
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* Maximize this {@link UiWindow}.
|
|
|
|
*
|
|
|
|
* @returns { Promise<void> }
|
2024-06-13 02:30:51 +00:00
|
|
|
* @throws { BusinessError } 17000002 - The async function is not called with await.
|
|
|
|
* @throws { BusinessError } 17000004 - The window or component is invisible or destroyed.
|
|
|
|
* @throws { BusinessError } 17000005 - This operation is not supported.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2022-09-14 13:07:20 +00:00
|
|
|
maximize(): Promise<void>;
|
2022-06-01 02:58:47 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Minimize this {@link UiWindow}.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @returns { Promise<void> }
|
|
|
|
* @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.
|
2022-06-01 02:58:47 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 9
|
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* Minimize this {@link UiWindow}.
|
|
|
|
*
|
|
|
|
* @returns { Promise<void> }
|
2024-06-13 02:30:51 +00:00
|
|
|
* @throws { BusinessError } 17000002 - The async function is not called with await.
|
|
|
|
* @throws { BusinessError } 17000004 - The window or component is invisible or destroyed.
|
|
|
|
* @throws { BusinessError } 17000005 - This operation is not supported.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2022-09-14 13:07:20 +00:00
|
|
|
minimize(): Promise<void>;
|
2022-06-01 02:58:47 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Resume this {@link UiWindow}.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @returns { Promise<void> }
|
|
|
|
* @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.
|
2022-06-01 02:58:47 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 9
|
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* Resume this {@link UiWindow}.
|
|
|
|
*
|
|
|
|
* @returns { Promise<void> }
|
2024-06-13 06:09:53 +00:00
|
|
|
* @throws { BusinessError } 17000002 - The async function is not called with await.
|
2024-06-13 02:30:51 +00:00
|
|
|
* @throws { BusinessError } 17000004 - The window or component is invisible or destroyed.
|
|
|
|
* @throws { BusinessError } 17000005 - This operation is not supported.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2022-09-14 13:07:20 +00:00
|
|
|
resume(): Promise<void>;
|
2022-06-01 02:58:47 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Close this {@link UiWindow}.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @returns { Promise<void> }
|
|
|
|
* @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.
|
2022-06-01 02:58:47 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 9
|
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* Close this {@link UiWindow}.
|
|
|
|
*
|
|
|
|
* @returns { Promise<void> }
|
2024-06-13 02:30:51 +00:00
|
|
|
* @throws { BusinessError } 17000002 - The async function is not called with await.
|
|
|
|
* @throws { BusinessError } 17000004 - The window or component is invisible or destroyed.
|
|
|
|
* @throws { BusinessError } 17000005 - This operation is not supported.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2022-09-14 13:07:20 +00:00
|
|
|
close(): Promise<void>;
|
2023-11-16 09:13:21 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the active status of this {@link UiWindow}.
|
|
|
|
*
|
|
|
|
* @returns { Promise<boolean> } the active status.
|
2024-06-13 02:30:51 +00:00
|
|
|
* @throws { BusinessError } 17000002 - The async function is not called with await.
|
|
|
|
* @throws { BusinessError } 17000004 - The window or component is invisible or destroyed.
|
2023-11-16 09:13:21 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
|
|
|
isActive(): Promise<boolean>;
|
2022-09-14 13:07:20 +00:00
|
|
|
}
|
2022-06-01 02:58:47 +00:00
|
|
|
|
2022-07-18 08:25:31 +00:00
|
|
|
/**
|
|
|
|
* Represents a two-dimensional array of pointers on the device display, it's used to build a
|
|
|
|
* multi-finger trace which can be injected with UiDriver.
|
|
|
|
*
|
2023-05-06 06:29:02 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
2022-07-18 08:25:31 +00:00
|
|
|
* @since 9
|
|
|
|
* @test
|
|
|
|
*/
|
2024-01-12 09:31:23 +00:00
|
|
|
/**
|
|
|
|
* Represents a two-dimensional array of pointers on the device display, it's used to build a
|
|
|
|
* multi-finger trace which can be injected with UiDriver.
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @crossplatform
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2022-08-29 08:56:47 +00:00
|
|
|
declare class PointerMatrix {
|
2022-09-14 13:07:20 +00:00
|
|
|
/**
|
2022-07-18 08:25:31 +00:00
|
|
|
* Create an {@link PointerMatrix} object.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @param { number } fingers The number of fingers.
|
|
|
|
* @param { number } steps The number of steps of each finger trace.
|
|
|
|
* @returns { PointerMatrix } the {@link PointerMatrix} object.
|
|
|
|
* @throws { BusinessError } 401 - if the input parameters are invalid.
|
2022-07-18 08:25:31 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 9
|
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* Create an {@link PointerMatrix} object.
|
|
|
|
*
|
2024-04-12 08:13:39 +00:00
|
|
|
* @param { number } fingers - The number of fingers, ranges from 1 to 10.
|
|
|
|
* @param { number } steps - The number of steps of each finger trace, ranges from 1 to 1000.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @returns { PointerMatrix } the {@link PointerMatrix} object.
|
2024-04-12 08:13:39 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
2023-11-16 09:13:21 +00:00
|
|
|
* @crossplatform
|
2023-11-09 09:12:06 +00:00
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2022-09-14 13:07:20 +00:00
|
|
|
static create(fingers: number, steps: number): PointerMatrix;
|
2022-07-18 08:25:31 +00:00
|
|
|
|
2022-09-14 13:07:20 +00:00
|
|
|
/**
|
|
|
|
* Set the point value of an element in the PointerMatrix.
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
|
|
|
* @param { number } finger The index of target finger to set.
|
|
|
|
* @param { number } step The index of target step to set.
|
|
|
|
* @param { Point } point The coordinate of target step to set.
|
|
|
|
* @throws { BusinessError } 401 - if the input parameters are invalid.
|
2022-09-14 13:07:20 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 9
|
|
|
|
* @test
|
|
|
|
*/
|
2023-11-09 09:12:06 +00:00
|
|
|
/**
|
|
|
|
* Set the point value of an element in the PointerMatrix.
|
|
|
|
*
|
2023-12-20 02:30:28 +00:00
|
|
|
* @param { number } finger - the index of target finger to set.
|
|
|
|
* @param { number } step - the index of target step to set.
|
|
|
|
* @param { Point } point - the coordinate of target step to set.
|
2024-04-12 08:13:39 +00:00
|
|
|
* @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; 2. Incorrect parameter types; 3. Parameter verification failed.
|
2023-11-09 09:12:06 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
2023-11-16 09:13:21 +00:00
|
|
|
* @crossplatform
|
2023-11-09 09:12:06 +00:00
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2022-09-14 13:07:20 +00:00
|
|
|
setPoint(finger: number, step: number, point: Point): void;
|
2022-07-18 08:25:31 +00:00
|
|
|
}
|
|
|
|
|
2022-03-08 10:42:53 +00:00
|
|
|
/**
|
|
|
|
* The static builder for building {@link By}object conveniently,usage example:BY.text('txt').enabled(true).
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
2022-03-08 10:42:53 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 8
|
2022-09-14 13:07:20 +00:00
|
|
|
* @deprecated since 9
|
2022-10-11 14:16:29 +00:00
|
|
|
* @useinstead ohos.uitest.ON
|
2022-09-14 13:07:20 +00:00
|
|
|
* @test
|
|
|
|
*/
|
|
|
|
declare const BY: By;
|
2024-01-12 08:26:08 +00:00
|
|
|
|
2022-09-14 13:07:20 +00:00
|
|
|
/**
|
|
|
|
* The static builder for building {@link On}object conveniently,usage example:ON.text('txt').enabled(true).
|
2023-05-06 06:29:02 +00:00
|
|
|
*
|
2022-09-14 13:07:20 +00:00
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @since 9
|
2022-03-08 10:42:53 +00:00
|
|
|
* @test
|
|
|
|
*/
|
2024-01-12 08:26:08 +00:00
|
|
|
/**
|
|
|
|
* The static builder for building {@link On}object conveniently,usage example:ON.text('txt').enabled(true).
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Test.UiTest
|
|
|
|
* @crossplatform
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
* @test
|
|
|
|
*/
|
2022-09-14 13:07:20 +00:00
|
|
|
declare const ON: On;
|
2022-03-08 10:42:53 +00:00
|
|
|
|
2023-04-21 09:47:24 +00:00
|
|
|
export {
|
2023-05-06 06:29:02 +00:00
|
|
|
UiComponent,
|
|
|
|
UiDriver,
|
|
|
|
Component,
|
|
|
|
Driver,
|
|
|
|
UiWindow,
|
|
|
|
ON,
|
2023-09-11 10:22:09 +00:00
|
|
|
On,
|
2023-05-06 06:29:02 +00:00
|
|
|
BY,
|
2023-09-11 10:22:09 +00:00
|
|
|
By,
|
2023-05-06 06:29:02 +00:00
|
|
|
MatchPattern,
|
|
|
|
DisplayRotation,
|
|
|
|
ResizeDirection,
|
|
|
|
WindowMode,
|
2023-12-19 09:52:15 +00:00
|
|
|
Point,
|
|
|
|
WindowFilter,
|
|
|
|
Rect,
|
2023-05-06 06:29:02 +00:00
|
|
|
PointerMatrix,
|
|
|
|
UiDirection,
|
2023-05-09 12:04:09 +00:00
|
|
|
MouseButton,
|
2023-05-15 03:40:19 +00:00
|
|
|
UIElementInfo,
|
|
|
|
UIEventObserver
|
2023-05-06 06:29:02 +00:00
|
|
|
};
|