Skip to content

Commit 8a1f8f1

Browse files
authored
Merge pull request #14 from RushilK7/docs/smartui-cli-config-readme
docs: document --config for SmartUI CLI exec
2 parents 1f3fb36 + 493dfb7 commit 8a1f8f1

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

README.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
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.
44

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+
59
## Repository Structure
610

711
```
@@ -98,16 +102,18 @@ SmartUISnapshot.smartuiSnapshot(driver, "screenshot");
98102

99103
## 4. Execution and Commands
100104

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+
101107
### Local Execution
102108

103109
```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
105111
```
106112

107113
### Cloud Execution
108114

109115
```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
111117
```
112118

113119
## Test Files
@@ -258,7 +264,7 @@ jobs:
258264
LT_USERNAME: ${{ secrets.LT_USERNAME }}
259265
LT_ACCESS_KEY: ${{ secrets.LT_ACCESS_KEY }}
260266
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
262268
```
263269
264270
### Jenkins Pipeline Example
@@ -288,7 +294,7 @@ pipeline {
288294
stage('Visual Tests') {
289295
steps {
290296
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'
292298
}
293299
}
294300
}

0 commit comments

Comments
 (0)