Skip to content

Commit c32de3b

Browse files
authored
Merge pull request #2056 from Ishavyas9/main
updated doc's
2 parents 2e877d7 + d88c233 commit c32de3b

File tree

5 files changed

+215
-3
lines changed

5 files changed

+215
-3
lines changed
69.6 KB
Loading

docs/appium-autoheal.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,12 +127,12 @@ You can generate capabilities for your test requirements with the help of our in
127127
You can also control Smart Heal dynamically during test execution using runtime hooks. This is useful when you want healing active in specific phases or after major UI changes.
128128

129129
```java
130-
// Start Smart Heal
131-
driver.executeScript("lambda-heal-start");
132-
133130
// Stop Smart Heal
134131
driver.executeScript("lambda-heal-stop");
135132

133+
// Start Smart Heal
134+
driver.executeScript("lambda-heal-start");
135+
136136
```
137137

138138
### 4. Running Your Tests

docs/appium-rokutv.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,21 @@ If you are unable to run the automation script with the above mentioned commands
301301

302302
Your test results would be displayed on the test console (or command-line interface if you are using terminal/cmd) and on the [LambdaTest App Automation Dashboard](https://appautomation.lambdatest.com/build).
303303

304+
## Supported Commands
305+
We utilise the Appium Roku Driver to run tests on Roku via Appium, here's a list of all the commands the driver supports from the project's [README](https://github.com/headspinio/appium-roku-driver?tab=readme-ov-file#roku-commands):
306+
307+
|Command|Parameters|Description|
308+
|-------|----------|-----------|
309+
|`roku: pressKey`|`key`|Press the remote key whose value matches `key` (must be one of the [supported key values](https://developer.roku.com/en-ca/docs/developer-program/debugging/external-control-api.md#keypress-key-values) from the Roku documentation). As addressed in the documentation, Roku TVs also support additional keys such as `PowerOff` and `PowerOn`. |
310+
|`roku: deviceInfo`||Get information about the Roku device|
311+
|`roku: getApps`||Get a list of apps installed on the device. The response will be a list of objects with the following keys: `id`, `type`, `subtype`, `version`, and `name`.|
312+
|`roku: activeApp`||Get information about the active app, in the same format as `roku: getApps`.|
313+
|`roku: activateApp`|`appId` (required), `contentId`, `mediaType`|Launch an app with the corresponding `appId`. Optionally include `contentId` and `mediaType` information (with the same properties as described above for the `activateApp` command)|
314+
|`roku: selectElement`|`elementId` (required) |Moves the focus on an element having locator XPath as `elementId`. If it is unable to focus on the element, the driver will respond with an error.|
315+
|`roku: playerState`||Get the state of the media player. The data will be returned as a JSON object, corresponding to the information included in the [query/media-player ECP result](https://developer.roku.com/en-ca/docs/developer-program/dev-tools/external-control-api.md#querymedia-player-example)
316+
|`roku: deepLink`|`contentId`, `mediaType`|As described in the [Roku dev docs](https://developer.roku.com/en-ca/docs/developer-program/discovery/implementing-deep-linking.md#using-ecp-commands-for-testing-deep-linking), you can deep link into content in the running application using a content ID and media type. For this command, `contentId` is required, and `mediaType` defaults to `movie` and must be one of the [valid media types](https://developer.roku.com/en-ca/docs/developer-program/discovery/implementing-deep-linking.md#mediatype-behavior). Note that this command acts on the currently-running app. If you want to test deep-linking into an app that is not launched, use `activateApp` instead.|
317+
|`roku: ecpInput`|`params`|This command allows calling the `/input` ECP command directly. An arbitrary set of key/value pairs can be sent in as a JSON object. No url-encoding of the values needs to be done. For example, to represent the parameters in the ECP command `POST /input?acceleration.x=0.0&acceleration.y=0.0&acceleration.z=9.8` from the ECP docs, you would construct a `params` of `{"acceleration.x": "0.0", "acceleration.y": "0.0", "acceleration.z": "9.8"}`|
318+
304319
## Additional Links
305320

306321
---

docs/xcresult.md

Lines changed: 192 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,192 @@
1+
---
2+
id: xcresult
3+
title: XCResult
4+
sidebar_label: XCResult
5+
description: Learn how to generate and download Xcode Result Bundles (.xcresult) for XCUI test executions on LambdaTest. Debug smarter with detailed reports directly in Xcode.
6+
keywords:
7+
- xcuitest
8+
- xcui result bundle
9+
- xcuitest report
10+
- xcuitest logs
11+
- lambdatest xcuitest
12+
- xcui xcresult
13+
- app testing
14+
- real devices
15+
url: https://www.lambdatest.com/support/docs/xcresult/
16+
site_name: LambdaTest
17+
slug: xcresult/
18+
---
19+
20+
import CodeBlock from '@theme/CodeBlock';
21+
import Tabs from '@theme/Tabs';
22+
import TabItem from '@theme/TabItem';
23+
import {YOUR_LAMBDATEST_USERNAME, YOUR_LAMBDATEST_ACCESS_KEY} from "@site/src/component/keys";
24+
25+
<script type="application/ld+json"
26+
dangerouslySetInnerHTML={{ __html: JSON.stringify({
27+
"@context": "https://schema.org",
28+
"@type": "BreadcrumbList",
29+
"itemListElement": [{
30+
"@type": "ListItem",
31+
"position": 1,
32+
"name": "Home",
33+
"item": "https://www.lambdatest.com"
34+
},{
35+
"@type": "ListItem",
36+
"position": 2,
37+
"name": "Support",
38+
"item": "https://www.lambdatest.com/support/docs/"
39+
},{
40+
"@type": "ListItem",
41+
"position": 3,
42+
"name": "XCUI Testing on LambdaTest",
43+
"item": "https://www.lambdatest.com/support/docs/getting-started-with-xcuitest/"
44+
}]
45+
})
46+
}}
47+
></script>
48+
49+
# XCResult on LambdaTest
50+
51+
Apple’s **Native XCResult Bundles (`.xcresult`)** are comprehensive test reports generated when you run XCUITest cases. These bundles include **test hierarchy, logs, stack traces, screenshots, and performance data**, which can be directly viewed in Xcode. They provide developers with rich debugging information, making it easier to analyze why a test passed or failed.
52+
53+
On LambdaTest, you can now **generate and download `.xcresult` bundles** for your XCUI test sessions. You can access them via the **REST API**.
54+
55+
---
56+
## Prerequisites
57+
58+
- Your LambdaTest [Username and Access Key](https://accounts.lambdatest.com/security).
59+
- Access to an **iOS app (.ipa)** and an **XCUI Test app (.ipa)**.
60+
- Xcode installed locally to view `.xcresult` bundles.
61+
62+
---
63+
64+
## Flow for Adding XCUI Result Bundles
65+
66+
### Step 1: Upload Your Application and Test Suite
67+
68+
To begin testing, you need to upload both your iOS application (.ipa) file and your XCUI test suite (.ipa) file to LambdaTest. These files are required before executing tests.
69+
70+
Detailed upload steps are available here: [Getting Started with XCUI Testing – Running Your First Test](https://www.lambdatest.com/support/docs/getting-started-with-xcuitest/#running-your-first-test-a-step-by-step-guide)
71+
72+
### Step 2: Execute Your Tests with Result Bundles
73+
74+
To generate `.xcresult` bundles for your XCUI test executions, you must pass `"enableResultBundle": true` in your build request and use the new build endpoint:
75+
76+
```
77+
POST https://mobile-api.lambdatest.com/mobile-automation/api/v1/xcuitest/builds
78+
```
79+
80+
This endpoint initiates your test run and enables generation of the result bundle.
81+
82+
| Parameter | Description | Values |
83+
|--------------------|-------------------------------------------------------|--------------------------------|
84+
| enableResultBundle | Enable generating result bundles for your XCUI build. | true/false (default: false) |
85+
86+
Below is an example cURL command to execute your test with result bundles enabled:
87+
88+
<Tabs className="docs__val">
89+
90+
<TabItem value="bash" label="Linux / MacOS" default>
91+
92+
<div className="lambdatest__codeblock">
93+
<CodeBlock className="language-bash">
94+
95+
```bash
96+
curl --location --request POST 'https://mobile-api.lambdatest.com/framework/v1/xcui/build' \
97+
--header 'Authorization: Basic BASIC_AUTH_TOKEN' \
98+
--header 'Content-Type: application/json' \
99+
--data-raw '{
100+
"app" : "APP_ID",
101+
"testSuite": "TEST_SUITE_ID",
102+
"device" : ["iPhone 11-14"],
103+
"video" : true,
104+
"queueTimeout": 10800,
105+
"idleTimeout": 150,
106+
"devicelog": true,
107+
"network": false,
108+
"build" : "Proverbial-XCUITest",
109+
"enableResultBundle": true
110+
}'
111+
```
112+
113+
</CodeBlock>
114+
</div>
115+
116+
</TabItem>
117+
118+
<TabItem value="powershell" label="Windows" default>
119+
120+
<div className="lambdatest__codeblock">
121+
<CodeBlock className="lamguage-powershell">
122+
123+
```bash
124+
curl --location --request POST "https://mobile-api.lambdatest.com/framework/v1/xcui/build" \
125+
--header "Authorization: Basic BASIC_AUTH_TOKEN" \
126+
--header "Content-Type: application/json" \
127+
--data-raw "{
128+
"app" : "APP_ID",
129+
"testSuite": "TEST_SUITE_ID",
130+
"device" : ["iPhone 11-14"],
131+
"video" : true,
132+
"queueTimeout": 10800,
133+
"idleTimeout": 150,
134+
"devicelog": true,
135+
"network": false,
136+
"build" : "Proverbial-XCUITest",
137+
"enableResultBundle": true
138+
}"
139+
```
140+
</CodeBlock>
141+
</div>
142+
143+
</TabItem>
144+
</Tabs>
145+
146+
### Step 3: Retrieve the Result Bundle
147+
148+
Result bundles are generated at the Build level. To download the `.xcresult` bundle for a specific session, use the following GET endpoint:
149+
150+
:::note
151+
- In case of sharding, each shard execution is treated as a separate shards and generates its own `.xcresult` bundle. You will need to retrieve each shard's bundle individually. For more information, see [Sharding in HyperExecute](https://www.lambdatest.com/support/docs/sharding-rd-hyperexec/).
152+
- To view the `.xcresult` for a specific shard, you must pass the `shard:shardId` as a query parameter in your request.
153+
:::
154+
155+
```
156+
GET https://mobile-api.lambdatest.com/mobile-automation/api/v1/framework/builds/{build-id}/xcresult
157+
```
158+
159+
Replace `{build-id}` with the actual build ID.
160+
161+
Example cURL command to download the result bundle:
162+
163+
<div className="lambdatest__codeblock">
164+
<CodeBlock className="language-bash">
165+
{`curl --location --request GET \\
166+
'https://mobile-api.lambdatest.com/mobile-automation/api/v1/framework/builds/{build-id}/xcresult' \\
167+
--header 'Authorization: Basic BASIC_AUTH_TOKEN' \\
168+
--output xcui-result-bundle.zip`}
169+
</CodeBlock>
170+
</div>
171+
172+
:::tip
173+
You will need your **BASIC_AUTH_TOKEN** (Base64 encoded `username:accesskey`) in the request header.
174+
If you’re unsure how to generate it, follow the instructions here: [Executing the Test](https://www.lambdatest.com/support/docs/getting-started-with-xcuitest/#step-3-executing-the-test).
175+
:::
176+
177+
The response is a binary ZIP file containing the `.xcresult` bundle, which you can unzip and open directly in Xcode for detailed analysis.
178+
179+
### Step 4: Report Structure
180+
181+
The `.xcresult` bundle contains a comprehensive report of your XCUI test execution, including:
182+
183+
- **Summary View**: Shows total tests executed, number passed, and number failed with a visual chart.
184+
- **Errors Section**: Lists any critical errors or crashes encountered (e.g., test runner crashes with signal codes).
185+
- **Tests Section**: Provides execution duration, device and OS version details, and per-device results.
186+
- **Device & Configuration Matrix**: Displays which tests passed/failed on specific device configurations.
187+
- **Individual Test Details**: Each test case shows its status (pass/fail), failure reason, logs, and any assertion errors.
188+
189+
190+
You can open the `.xcresult` bundle directly in Xcode to explore these details visually, enabling efficient debugging and analysis of your test runs.
191+
192+
![xcui-result-bundles](../assets/images/real-device-app-testing/XCUI_image.png)

sidebars.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3017,6 +3017,11 @@ module.exports = {
30173017
label: "Xml Report",
30183018
id: "xcui-xml-report",
30193019
},
3020+
{
3021+
type: "doc",
3022+
label: "XCResult",
3023+
id: "xcresult",
3024+
},
30203025
],
30213026
],
30223027

0 commit comments

Comments
 (0)