From d76233c1f16bd857e26cfe705e5857284db2ad24 Mon Sep 17 00:00:00 2001 From: yangyuyan Date: Thu, 19 Jun 2025 15:06:47 +0800 Subject: [PATCH] =?UTF-8?q?uitest6.0=E6=96=B0=E5=A2=9E=E6=8E=A5=E5=8F=A3.S?= =?UTF-8?q?igned-off-by:=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yangyuyan Change-Id: I67f5e8b48cd7ef55d6466bdbe71bd21b9d69fdee --- api/@ohos.UiTest.d.ts | 32 ++++++++++++++++++++++++++++++++ api/device-define/2in1.json | 3 ++- api/device-define/tv.json | 4 +++- 3 files changed, 37 insertions(+), 2 deletions(-) diff --git a/api/@ohos.UiTest.d.ts b/api/@ohos.UiTest.d.ts index 47815947ca..7ffdeef4a4 100755 --- a/api/@ohos.UiTest.d.ts +++ b/api/@ohos.UiTest.d.ts @@ -2443,6 +2443,23 @@ declare class On { * @arkts 1.1&1.2 */ hint(val: string, pattern?: MatchPattern): On; + + /** + * Specifies the original text for the target Component. + * If the accessibility property 'accessibilityLevel' of a component is set to 'no' or 'no-hide-descendants', + * you will not be able to use {@link On.text} to match the component with the specified original text, but you can use this method to achieve it; + * if the component does not set the above accessibility property, this method has no difference with {@link On.text} + * + * @param { string } text - the original text value. + * @param { MatchPattern } [pattern] - the {@link MatchPattern} of the text value, Set it default {@link MatchPattern.EQUALS} if null or undefined. + * @returns { On } this {@link On} object. + * @throws { BusinessError } 17000007 - Parameter verification failed. + * @syscap SystemCapability.Test.UiTest + * @atomicservice + * @since 20 + * @test + */ + originalText(text: string, pattern?: MatchPattern): On; } /** @@ -3439,6 +3456,21 @@ declare class Component { * @arkts 1.2 */ scrollSearch(on: On, vertical?: boolean, offset?: number): Promise; + /** + * Get the original text attribute value. + * If the accessibility property 'accessibilityLevel' of a component is set to 'no' or 'no-hide-descendants', + * you will not be able to use {@link Component.getText} to get the original text of the component, but you can use this method to achieve it; + * if the component does not set the above accessibility property, this method has no difference with {@link Component.getText} + * + * @returns { Promise } the original text value. + * @throws { BusinessError } 17000002 - The async function is not called with await. + * @throws { BusinessError } 17000004 - The window or component is invisible or destroyed. + * @syscap SystemCapability.Test.UiTest + * @atomicservice + * @since 20 + * @test + */ + getOriginalText(): Promise; } /** diff --git a/api/device-define/2in1.json b/api/device-define/2in1.json index c6daec28bd..e82f3c063d 100644 --- a/api/device-define/2in1.json +++ b/api/device-define/2in1.json @@ -222,6 +222,7 @@ "SystemCapability.FileManagement.File.Environment", "SystemCapability.FileManagement.File.FileIO", "SystemCapability.ArkUI.ArkUI.Full", - "SystemCapability.Global.I18n" + "SystemCapability.Global.I18n", + "SystemCapability.Test.PerfTest" ] } \ No newline at end of file diff --git a/api/device-define/tv.json b/api/device-define/tv.json index 2036d68db4..b9f9b77162 100644 --- a/api/device-define/tv.json +++ b/api/device-define/tv.json @@ -195,6 +195,8 @@ "SystemCapability.Communication.Bluetooth.Core", "SystemCapability.Security.Cert", "SystemCapability.Update.UpdateService", - "SystemCapability.Window.SessionManager" + "SystemCapability.Window.SessionManager", + "SystemCapability.Test.UiTest", + "SystemCapability.Test.PerfTest" ] } -- Gitee