diff --git a/en/application-dev/application-test/arkxtest-guidelines.md b/en/application-dev/application-test/arkxtest-guidelines.md index 334f69a8ca24eb8de3bb83cd1405fb14a25132bd..bd82cae45fb4c673f014bcc13cfc02beb3853a2e 100644 --- a/en/application-dev/application-test/arkxtest-guidelines.md +++ b/en/application-dev/application-test/arkxtest-guidelines.md @@ -48,7 +48,7 @@ arkXtest is divided into two parts: unit test framework and UI test framework. Software for writing test scripts: DevEco Studio 3.0 or later -Hardware for running test scripts: PC connected to a OpenHarmony device, such as the RK3568 development board +Hardware for running test scripts: PC connected to an OpenHarmony device, such as the RK3568 development board ### Setting Up the Environment @@ -63,8 +63,8 @@ Hardware for running test scripts: PC connected to a OpenHarmony device, such as ## Writing a Unit Test Script ```TS -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' -import abilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'; +import abilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; const delegator = abilityDelegatorRegistry.getAbilityDelegator() export default function abilityTest() { @@ -197,11 +197,12 @@ The framework supports multiple test case execution modes, which are triggered b | breakOnError | Whether to enable break-on-error mode. When this mode is enabled, the test execution process exits if a test assertion error or any other error occurs.| **true**/**false** (default value) | -s breakOnError true | | testType | Type of the test case to be executed. | function, performance, power, reliability, security, global, compatibility, user, standard, safety, resilience| -s testType function | | level | Level of the test case to be executed. | 0, 1, 2, 3, 4 | -s level 0 | -| size | Size of the test case to be executed. | small, medium, large | -s size small | +| size | Size of the test case to be executed. | small, medium, large | -s size small | +| stress | Number of times that the test case is executed. | Positive integer | -s stress 1000 | **Running Commands** -Configure hdc-related environment variables, and then perform the following: +> Configure hdc-related environment variables, and then perform the following: - Open the CLI. - Run the **aa test** commands. @@ -260,12 +261,18 @@ Example 9: Execute test cases at the specified level. hdc shell aa test -b xxx -p xxx -s unittest OpenHarmonyTestRunner -s level 0 ``` -Example 10: Execute test cases with the specified level. +Example 10: Execute test cases with the specified size. ```shell hdc shell aa test -b xxx -p xxx -s unittest OpenHarmonyTestRunner -s size small ``` +Example 11: Execute test cases for a specified number of times. + +```shell + hdc shell aa test -b xxx -p xxx -s unittest OpenHarmonyTestRunner -s stress 1000 +``` + **Viewing the Test Result** - During test execution in the CLI, the log information similar to the following is displayed: @@ -394,11 +401,11 @@ Run the following command, restart the device, and execute the test case again: hdc shell param set persist.ace.testmode.enabled 1 ``` -#### The failure log contains "uitest-api dose not allow calling concurrently" +#### The failure log contains "uitest-api does not allow calling concurrently" **Problem** -The UI test case fails to be executed. The HiLog file contains the error message "uitest-api dose not allow calling concurrently". +The UI test case fails to be executed. The HiLog file contains the error message "uitest-api does not allow calling concurrently". **Possible Causes** @@ -412,11 +419,11 @@ The UI test case fails to be executed. The HiLog file contains the error message 2. Do not execute UI test cases in multiple processes. -#### The failure log contains "dose not exist on current UI! Check if the UI has changed after you got the widget object" +#### The failure log contains "does not exist on current UI! Check if the UI has changed after you got the widget object" **Problem** -The UI test case fails to be executed. The HiLog file contains the error message "dose not exist on current UI! Check if the UI has changed after you got the widget object". +The UI test case fails to be executed. The HiLog file contains the error message "does not exist on current UI! Check if the UI has changed after you got the widget object". **Possible Causes** diff --git a/en/application-dev/application-test/figures/Execute.PNG b/en/application-dev/application-test/figures/Execute.PNG index 90dcb55338ad473d29557e4c761801b16c770d45..ba96bdfdaf430249f3506153a45c6fe439eda5cc 100644 Binary files a/en/application-dev/application-test/figures/Execute.PNG and b/en/application-dev/application-test/figures/Execute.PNG differ diff --git a/en/application-dev/application-test/figures/TestResult.PNG b/en/application-dev/application-test/figures/TestResult.PNG index 300266842efab6da7a4f7469ab8c9e890f238b89..c2938e7f8fbd4ec112506db5b9b9ac03a7b42397 100644 Binary files a/en/application-dev/application-test/figures/TestResult.PNG and b/en/application-dev/application-test/figures/TestResult.PNG differ