|
2 | 2 |
|
3 | 3 | Welcome to the SmartUI SDK sample for Selenium Java with TestNG. This repository demonstrates how to integrate SmartUI visual regression testing with Selenium Java using TestNG framework. |
4 | 4 |
|
| 5 | +## Get your SmartUI project and token |
| 6 | + |
| 7 | +If you are new to SmartUI, follow [Running Your First Project on SmartUI](https://www.lambdatest.com/support/docs/smartui-running-your-first-project/) to create a project and obtain your **project token** and `smartui-web.json` configuration. |
| 8 | + |
5 | 9 | ## Repository Structure |
6 | 10 |
|
7 | 11 | ``` |
@@ -98,16 +102,18 @@ SmartUISnapshot.smartuiSnapshot(driver, "screenshot"); |
98 | 102 |
|
99 | 103 | ## 4. Execution and Commands |
100 | 104 |
|
| 105 | +Pass `--config smartui-web.json` to the SmartUI CLI so it uses this repository’s config (project id, token path, and build naming). Place it **before** `exec` (it is a global CLI option). |
| 106 | + |
101 | 107 | ### Local Execution |
102 | 108 |
|
103 | 109 | ```bash |
104 | | -npx smartui exec -- mvn test -D suite=sdk-local.xml |
| 110 | +npx smartui --config smartui-web.json exec -- mvn test -D suite=sdk-local.xml |
105 | 111 | ``` |
106 | 112 |
|
107 | 113 | ### Cloud Execution |
108 | 114 |
|
109 | 115 | ```bash |
110 | | -npx smartui exec -- mvn test -D suite=sdk-cloud.xml |
| 116 | +npx smartui --config smartui-web.json exec -- mvn test -D suite=sdk-cloud.xml |
111 | 117 | ``` |
112 | 118 |
|
113 | 119 | ## Test Files |
@@ -258,7 +264,7 @@ jobs: |
258 | 264 | LT_USERNAME: ${{ secrets.LT_USERNAME }} |
259 | 265 | LT_ACCESS_KEY: ${{ secrets.LT_ACCESS_KEY }} |
260 | 266 | run: | |
261 | | - npx smartui exec -- mvn test -D suite=sdk-cloud.xml |
| 267 | + npx smartui --config smartui-web.json exec -- mvn test -D suite=sdk-cloud.xml |
262 | 268 | ``` |
263 | 269 |
|
264 | 270 | ### Jenkins Pipeline Example |
@@ -288,7 +294,7 @@ pipeline { |
288 | 294 | stage('Visual Tests') { |
289 | 295 | steps { |
290 | 296 | sh 'npm install -g @lambdatest/smartui-cli' |
291 | | - sh 'npx smartui exec -- mvn test -D suite=sdk-cloud.xml' |
| 297 | + sh 'npx smartui --config smartui-web.json exec -- mvn test -D suite=sdk-cloud.xml' |
292 | 298 | } |
293 | 299 | } |
294 | 300 | } |
|
0 commit comments