Skip to content

Commit 874a7da

Browse files
amanchopra1905surishubham
authored andcommitted
Merge pull request #1966 from amanchopra1905/stage
updated the maestro doc for JUnit XML report
1 parent 5fb8a96 commit 874a7da

File tree

1 file changed

+38
-2
lines changed

1 file changed

+38
-2
lines changed

docs/hyperexecute-maestro-testing.md

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,43 @@ https://github.com/LambdaTest/hyperexecute-maestro-sample-test/blob/main/ios-sim
156156

157157
</Tabs>
158158

159-
## Step 5: Execute your Test Suite
159+
## Step 5: Generate JUnit XML Report
160+
1. Update the `runTest.sh` file to include the `--format junit` flag in the maestro test command:
161+
162+
```yaml
163+
/home/ltuser/.maestro/bin/maestro test $1 --debug-output ./MaestroLogs --format junit
164+
```
165+
166+
The above command will generate a `report.xml` file in the root directory after each test execution. Here is the complete reference of the `runTest.sh` file:
167+
168+
```yaml reference
169+
https://github.com/LambdaTest/hyperexecute-maestro-sample-test/blob/main/maestro-test/runTest.sh
170+
```
171+
172+
2. Update your HyperExecute YAML file to enable the native reporting in HyperExecute using the generated JUnit XML files.
173+
174+
```yaml title="hyperexecute.yaml"
175+
report: true
176+
partialReports:
177+
- location: .
178+
type: xml
179+
frameworkName: junit
180+
```
181+
182+
### 📘 Use Cases
183+
#### Use Case 1: One Test per Task
184+
If you're executing one test per task, a single `report.xml` will be generated per job. These individual reports can then be merged later for a consolidated result.
185+
186+
#### Use Case 2: Multiple Tests on the same Task
187+
In this case, the `report.xml` file gets overwritten after each test execution. This results in only the last test's results being preserved. To prevent overwriting, update your `testRunnerCommand` in the `hyperexecute.yaml` file to rename the report after each test:
188+
189+
```yaml title="hyperexecute.yaml"
190+
testRunnerCommand: ./maestro-test/runTest.sh $test && mv report.xml $test.xml
191+
```
192+
193+
This ensures that each test result is saved with a unique name like test1.xml, test2.xml, etc.
194+
195+
## Step 6: Execute your Test Suite
160196
> **NOTE :** In case of MacOS, if you get a permission denied warning while executing CLI, simply run **`chmod u+x ./hyperexecute`** to allow permission. In case you get a security popup, allow it from your **System Preferences** → **Security & Privacy** → **General tab**.
161197

162198
Run the below command in your terminal at the root folder of the project:
@@ -175,7 +211,7 @@ OR use this command if you have not exported your username and access key in the
175211

176212
<img loading="lazy" src={require('../assets/images/hyperexecute/frameworks/maestro/1.png').default} alt="JUnit HyperExecute Terminal Logs" width="1920" height="868" className="doc_img"/>
177213

178-
## Step 6: Monitor the Test Execution
214+
## Step 7: Monitor the Test Execution
179215
Visit the [HyperExecute Dashboard](https://hyperexecute.lambdatest.com/hyperexecute) and check your Job status.
180216

181217
<img loading="lazy" src={require('../assets/images/hyperexecute/frameworks/maestro/2.png').default} alt="automation-dashboard" width="1920" height="868" className="doc_img"/>

0 commit comments

Comments
 (0)