Skip to content

Commit 56aa961

Browse files
authored
Merge pull request LambdaTest#1164 from amanchopra1905/stage
hyp os browser update
2 parents 98f3fc2 + 1bbc165 commit 56aa961

File tree

1 file changed

+48
-3
lines changed

1 file changed

+48
-3
lines changed

docs/hyperexecute-how-to-configure-os-and-browser.md

Lines changed: 48 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,17 +43,62 @@ import HyperExecuteSupportedLanguageRepos from '../src/component/SupportedLangua
4343
></script>
4444
This documentation will guide you through configuring the Operating System and Browser for your test suite on HyperExecute. We will cover the step-by-step method to implement the configuration for various test frameworks supported by HyperExecute. Each section provides practical examples to help you integrate HyperExecute with your existing automation suite.
4545

46-
You can easily implement it on your own project. For demo purposes, we are using the TestNG sample repository. You can also access the sample repository for your desired framework:
47-
46+
For demonstration purposes, we use the TestNG sample repository. However, you can apply the same concepts to your preferred framework. You can access the sample repositories for your required frameworks:
4847
<HyperExecuteSupportedLanguageRepos />
4948

50-
## Step 1: Update the LambdaTest Capabilities in your test suite
49+
## Step 1: Update LambdaTest Capabilities in your test suite
50+
Configuring the capabilities is the first step to define the environment for your tests. These capabilities allow you to specify parameters such as the Operating System, Browser, and Browser Version on which your tests will run. LambdaTest capabilities serve as a bridge between your test framework and the HyperExecute cloud infrastructure.
51+
52+
### Key Attributes to Configure
53+
- **`platform` :** Specifies the operating system (e.g., Windows, macOS, or Linux).
54+
- **`browserName` :** Indicates the browser to be used (e.g., Chrome, Firefox, or Edge).
55+
- **`version` :** Defines the specific version or sets it as latest to always use the most recent version.
56+
57+
Below is a Java example using the TestNG framework:
58+
```java title="Test.java"
59+
DesiredCapabilities caps = new DesiredCapabilities();
60+
caps.setCapability("platform", "Windows");
61+
caps.setCapability("browserName", "Chrome");
62+
caps.setCapability("version", "latest"); //latest, dev, beta, latest-1, latest-2, ...
63+
```
64+
65+
The above configuration ensures that your tests run on Windows OS using the latest version of Google Chrome.
5166

5267
## Step 2: Configure your HyperExecute YAML file
68+
The HyperExecute YAML configuration file is the blueprint for running your tests in the HyperExecute cloud environment. It defines the testing environment, execution strategy, and resource allocation. Properly configuring this file ensures that your tests are executed efficiently across the desired platforms and browsers.
69+
5370
<Tabs className="docs__val" queryString="test-method">
5471
<TabItem value="autosplit" label="AutoSplit" default>
72+
[AutoSplit mode](https://www.lambdatest.com/support/docs/deep-dive-into-hyperexecute-yaml/#autosplit) automatically splits your scenarios among the concurrent number of tasks and executes them parallelly. This ensures optimal utilization of resources and significantly reduces the overall execution time of your test suite.
73+
74+
In this method, you simply set the [`runson`](https://www.lambdatest.com/support/docs/deep-dive-into-hyperexecute-yaml/#runson) flag to specify the Operating System for running your tests.
75+
76+
```yaml title="hyperexecute_autosplit.yaml"
77+
runson: linux #linux, win, win11, mac, mac13
78+
```
79+
> 📕 Learn more about [AutoSplit Test Method](https://www.lambdatest.com/support/docs/hyperexecute-auto-split-strategy/)
5580
</TabItem>
5681

5782
<TabItem value="matrix" label="Matrix">
83+
[Matrix mode](https://www.lambdatest.com/support/docs/deep-dive-into-hyperexecute-yaml/#matrix) allows you to run the same set of tests across multiple combinations of environments, configurations, or parameters. This is particularly useful for ensuring that your software works correctly under different conditions, such as various operating systems, browser versions, or dependency files.
84+
85+
- **`runson: ${matrix.os}` :** Dynamically selects the operating system from the matrix.os list (Windows, macOS, Linux) for each test job.
86+
- **`os` :** Lists the operating systems for testing: `win`, `mac`, and `linux`.
87+
- **`tests` :** Specifies the test cases to run, such as `Test_1` and `Test_2`.
88+
- **`browser` :** Defines the browsers for testing, in this case, Chrome and Microsoft Edge.
89+
- **`version` :** Sets the browser versions to test, such as latest for the most recent stable version or dev for development versions.
90+
- **`files` :** Points to files or dependencies required for executing the tests, such as `@File1` and `@File2`.
91+
92+
```yaml title="hyperexecute_matrix.yaml"
93+
runson: ${matrix.os}
94+
95+
matrix:
96+
os: ["win", "mac", "linux"]
97+
tests: ["Test_1", "Test_2"]
98+
browser: ["Chrome", "MicrosoftEdge"]
99+
version: ["latest, dev"]
100+
files: ["@File1","@File2"]
101+
```
102+
> 📕 Learn more about [Matrix Test Method](https://www.lambdatest.com/support/docs/hyperexecute-matrix-multiplexing-strategy/)
58103
</TabItem>
59104
</Tabs>

0 commit comments

Comments
 (0)