Skip to content

Commit c0421b0

Browse files
authored
Merge pull request #2050 from Ishavyas9/main
updated the maestro additional information
2 parents c2413f9 + fb8aa2c commit c0421b0

File tree

2 files changed

+70
-37
lines changed

2 files changed

+70
-37
lines changed
101 KB
Loading

docs/hyperexecute-maestro-testing.md

Lines changed: 70 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -80,35 +80,6 @@ You can download the CLI for your desired platform from the below mentioned link
8080
| MacOS | https://downloads.lambdatest.com/hyperexecute/darwin/hyperexecute |
8181
| Linux | https://downloads.lambdatest.com/hyperexecute/linux/hyperexecute |
8282

83-
### Setup Environment Variable
84-
Now, you need to export your environment variables *LT_USERNAME* and *LT_ACCESS_KEY* that are available in the [LambdaTest Profile page](https://accounts.lambdatest.com/detail/profile).
85-
86-
Run the below mentioned commands in your terminal to setup the CLI and the environment variables.
87-
88-
<Tabs className="docs__val">
89-
<TabItem value="bash" label="Linux / MacOS" default>
90-
91-
<div className="lambdatest__codeblock">
92-
<CodeBlock className="language-bash">
93-
{`export LT_USERNAME="${ YOUR_LAMBDATEST_USERNAME()}"
94-
export LT_ACCESS_KEY="${ YOUR_LAMBDATEST_ACCESS_KEY()}"`}
95-
</CodeBlock>
96-
</div>
97-
98-
</TabItem>
99-
100-
<TabItem value="powershell" label="Windows" default>
101-
102-
<div className="lambdatest__codeblock">
103-
<CodeBlock className="language-powershell">
104-
{`set LT_USERNAME="${ YOUR_LAMBDATEST_USERNAME()}"
105-
set LT_ACCESS_KEY="${ YOUR_LAMBDATEST_ACCESS_KEY()}"`}
106-
</CodeBlock>
107-
</div>
108-
109-
</TabItem>
110-
</Tabs>
111-
11283
## Step 3: Upload your Application
11384
Upload your <b>_android_</b> application (.apk file) or <b>iOS</b> application (.ipa file) to the LambdaTest servers using our <b>REST API</b>. You need to provide your <b>Username</b> and <b>AccessKey</b> in the format `Username:AccessKey` in the <b>cURL</b> command for authentication.
11485

@@ -195,23 +166,85 @@ This ensures that each test result is saved with a unique name like test1.xml, t
195166
## Step 6: Execute your Test Suite
196167
> **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**.
197168

198-
Run the below command in your terminal at the root folder of the project:
169+
<div className="lambdatest__codeblock">
170+
<CodeBlock className="language-bash">
171+
{`./hyperexecute --user ${ YOUR_LAMBDATEST_USERNAME()} --key ${ YOUR_LAMBDATEST_ACCESS_KEY()} --config RELATIVE_PATH_OF_YOUR_YAML_FILE `}
172+
</CodeBlock>
173+
</div>
174+
175+
<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"/>
176+
177+
## Step 7: Monitor the Test Execution
178+
Visit the [HyperExecute Dashboard](https://hyperexecute.lambdatest.com/hyperexecute) and check your Job status.
179+
180+
<img loading="lazy" src={require('../assets/images/hyperexecute/frameworks/maestro/2.png').default} alt="automation-dashboard" width="1920" height="868" className="doc_img"/>
181+
182+
183+
## Additional Information: Launching Pre-Installed Apps with Maestro
184+
In some cases, you may want to test against a pre-installed application on the device (instead of uploading and installing a new APK/IPA). Maestro supports this by allowing you to specify the app’s package identifier (Android) or bundle identifier (iOS) in your test configuration.
199185

200-
```bash
201-
./hyperexecute --config RELATIVE_PATH_OF_YOUR_YAML_FILE
186+
### Step 1: Identify the App ID (Package Name / Bundle ID)
187+
#### For Android:
188+
- Visit the app’s page on the Google Play Store.
189+
- The id parameter in the URL is the package name.
190+
- Example: For the Wikipedia app → `org.wikipedia`.
191+
192+
#### For iOS:
193+
- Identify the bundle identifier (e.g., com.apple.Preferences for Settings).
194+
195+
### Step 2: Update Your HyperExecute Configuration
196+
You can configure your YAML files to launch the pre-installed app instead of uploading a new one.
197+
198+
```yaml title="hyperexecute.yaml"
199+
...//
200+
framework:
201+
name: raw
202+
args:
203+
#highlight-next-line
204+
appId: stock
202205
```
203206

204-
OR use this command if you have not exported your username and access key in the step 2.
207+
and the launcher yaml file to tells maestro to use the pre-installed Wikipedia app.
208+
209+
```yaml reference title="android-launch.yaml"
210+
https://github.com/LambdaTest/hyperexecute-maestro-sample-test/blob/main/android-launch.yaml
211+
```
212+
213+
### Step 3: Execute your Test Suite
214+
> **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**.
205215

206216
<div className="lambdatest__codeblock">
207217
<CodeBlock className="language-bash">
208218
{`./hyperexecute --user ${ YOUR_LAMBDATEST_USERNAME()} --key ${ YOUR_LAMBDATEST_ACCESS_KEY()} --config RELATIVE_PATH_OF_YOUR_YAML_FILE `}
209219
</CodeBlock>
210220
</div>
211221

212-
<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"/>
222+
The Wikipedia app will open directly on the device, and your Maestro test steps will execute against it.
213223

214-
## Step 7: Monitor the Test Execution
215-
Visit the [HyperExecute Dashboard](https://hyperexecute.lambdatest.com/hyperexecute) and check your Job status.
224+
**Example: Wikipedia Search Flow**
225+
226+
```yaml title="android-launch.yaml"
227+
appId: org.wikipedia
228+
----
229+
launchApp
230+
231+
tapOn: "Search Wikipedia"
232+
inputText: "Maestro framework"
233+
pressKey: Enter
234+
assertVisible: "Mobile UI testing"
235+
```
236+
237+
<img loading="lazy" src={require('../assets/images/hyperexecute/frameworks/maestro/3.png').default} alt="Image" className="doc_img"/>
238+
239+
**Explanation:**
240+
241+
- **launchApp:** Opens the Wikipedia app.
242+
- **tapOn:** "Search Wikipedia" → Focuses the search bar.
243+
- **inputText:** "Maestro framework" → Enters the text.
244+
- **pressKey:** Enter → Submits the search.
245+
- **assertVisible:** "Mobile UI testing" → Validates results.
216246

217-
<img loading="lazy" src={require('../assets/images/hyperexecute/frameworks/maestro/2.png').default} alt="automation-dashboard" width="1920" height="868" className="doc_img"/>
247+
### Best Practices
248+
- Make sure the app is already installed on the device; otherwise, Maestro cannot launch it.
249+
- The same approach works for iOS using the bundle identifier.
250+
- You can also switch between multiple apps in a single flow by providing different appId values in separate steps.

0 commit comments

Comments
 (0)