From 5baa8a7b340f0e6fbc029651ba4da002a8955eac Mon Sep 17 00:00:00 2001 From: zhangzezhong Date: Fri, 6 Jun 2025 19:50:06 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=83=E8=83=BD=E5=8A=9BTestRunner=E5=91=8A?= =?UTF-8?q?=E8=AD=A6=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhangzezhong --- api/@ohos.application.testRunner.d.ts | 59 +++++++++++++++++++++++---- 1 file changed, 50 insertions(+), 9 deletions(-) diff --git a/api/@ohos.application.testRunner.d.ts b/api/@ohos.application.testRunner.d.ts index ea86d1c15b..a7ac123d98 100644 --- a/api/@ohos.application.testRunner.d.ts +++ b/api/@ohos.application.testRunner.d.ts @@ -18,6 +18,7 @@ * @kit TestKit */ +/*** if arkts 1.1 */ /** * Base class for the test framework. * If you want to implement your own unit test framework, you must inherit this class and overrides all its methods. @@ -33,10 +34,9 @@ * @interface TestRunner * @syscap SystemCapability.Ability.AbilityRuntime.Core * @atomicservice - * @since arkts {'1.1':'11', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ -interface TestRunner { +export interface TestRunner { /** * Prepare the unit testing environment for running test cases. * @@ -48,8 +48,7 @@ interface TestRunner { * * @syscap SystemCapability.Ability.AbilityRuntime.Core * @atomicservice - * @since arkts {'1.1':'11', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ onPrepare(): void; @@ -64,13 +63,55 @@ interface TestRunner { * * @syscap SystemCapability.Ability.AbilityRuntime.Core * @atomicservice - * @since arkts {'1.1':'11', '1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ onRun(): void; } +/*** endif */ +/*** if arkts 1.2 */ +/** + * Base class for the test framework. + * If you want to implement your own unit test framework, you must inherit this class and overrides all its methods. + * + * @interface TestRunner + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @atomicservice + * @since 20 + * @arkts 1.2 + */ +interface TestRunner { + /** + * Prepare the unit testing environment for running test cases. + * + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @since 8 + */ + /** + * Prepare the unit testing environment for running test cases. + * + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @atomicservice + * @since 20 + * @arkts 1.2 + */ + onPrepare(): void; -/*** if arkts 1.1 */ -export { TestRunner }; + /** + * Run all test cases. + * + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @since 8 + */ + /** + * Run all test cases. + * + * @syscap SystemCapability.Ability.AbilityRuntime.Core + * @atomicservice + * @since 20 + * @arkts 1.2 + */ + onRun(): void; +} /*** endif */ + export default TestRunner; -- Gitee