Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 22 additions & 23 deletions docs/smartui-gitlab-pr-checks-exec.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ The SmartUI configuration file is used to specify project settings. You can also

## Step 3: Configure GitLab CI/CD Pipeline

Create or update your `.gitlab-ci.yml` file. The key difference with the Exec method is that you use `npx smartui exec --gitURL` to run your tests.
Create or update your `.gitlab-ci.yml` file. The key difference with the Exec method is that you use `npx smartui exec --githubURL` to run your tests.

### Complete GitLab CI/CD Configuration

Expand Down Expand Up @@ -144,9 +144,9 @@ visual_regression_tests:
echo "GitLab Status URL: ${GIT_URL}"

# Run tests with SmartUI Exec and GitLab integration
npx smartui exec --gitURL "${GIT_URL}" -- npm test
# Or: npx smartui exec --gitURL "${GIT_URL}" -- npx wdio run wdio.conf.ts
# Or: npx smartui exec --gitURL "${GIT_URL}" -- npm run test:mobile
npx smartui exec --githubURL "${GIT_URL}" -- npm test
# Or: npx smartui exec --githubURL "${GIT_URL}" -- npx wdio run wdio.conf.ts
# Or: npx smartui exec --githubURL "${GIT_URL}" -- npm run test:mobile

only:
- merge_requests
Expand Down Expand Up @@ -201,8 +201,8 @@ visual_regression_tests:
echo "GitLab Status URL: ${GIT_URL}"

# Run tests with SmartUI Exec and GitLab integration
npx smartui exec --gitURL "${GIT_URL}" -- mvn test
# Or: npx smartui exec --gitURL "${GIT_URL}" -- ./gradlew test (for Gradle)
npx smartui exec --githubURL "${GIT_URL}" -- mvn test
# Or: npx smartui exec --githubURL "${GIT_URL}" -- ./gradlew test (for Gradle)

only:
- merge_requests
Expand Down Expand Up @@ -253,9 +253,9 @@ visual_regression_tests:
echo "GitLab Status URL: ${GIT_URL}"

# Run tests with SmartUI Exec and GitLab integration
npx smartui exec --gitURL "${GIT_URL}" -- pytest
# Or: npx smartui exec --gitURL "${GIT_URL}" -- python -m unittest discover
# Or: npx smartui exec --gitURL "${GIT_URL}" -- behave
npx smartui exec --githubURL "${GIT_URL}" -- pytest
# Or: npx smartui exec --githubURL "${GIT_URL}" -- python -m unittest discover
# Or: npx smartui exec --githubURL "${GIT_URL}" -- behave

only:
- merge_requests
Expand Down Expand Up @@ -306,8 +306,8 @@ visual_regression_tests:
echo "GitLab Status URL: ${GIT_URL}"

# Run tests with SmartUI Exec and GitLab integration
npx smartui exec --gitURL "${GIT_URL}" -- bundle exec rspec
# Or: npx smartui exec --gitURL "${GIT_URL}" -- bundle exec cucumber
npx smartui exec --githubURL "${GIT_URL}" -- bundle exec rspec
# Or: npx smartui exec --githubURL "${GIT_URL}" -- bundle exec cucumber

only:
- merge_requests
Expand All @@ -327,17 +327,17 @@ visual_regression_tests:
2. **GitLab Project ID**: Automatically available as `CI_PROJECT_ID` in GitLab CI/CD
3. **Commit SHA**: Use `CI_COMMIT_SHA` for regular commits, or `CI_MERGE_REQUEST_SHA` for merge requests
4. **GitLab API URL**: Construct as `https://gitlab.com/api/v4/projects/{projectId}/statuses/{commitId}`
5. **Exec Command**: Use `npx smartui exec --gitURL "${GIT_URL}" -- <your-test-command>`
5. **Exec Command**: Use `npx smartui exec --githubURL "${GIT_URL}" -- <your-test-command>`

:::info Understanding the SmartUI Exec Command

The `npx smartui exec` command wraps your test execution and provides SmartUI integration:

```bash
npx smartui exec --gitURL "<gitlab-url>" -- <your-test-command>
npx smartui exec --githubURL "<gitlab-url>" -- <your-test-command>
```

- `--gitURL`: GitLab API URL for status updates (legacy name, works with GitLab)
- `--githubURL`: GitLab API URL for status updates (legacy name, works with GitLab)
- `--`: Separator before your test command
- `<your-test-command>`: Your normal test command (e.g., `npm test`, `mvn test`, `pytest`)

Expand Down Expand Up @@ -443,7 +443,7 @@ visual_regression_tests:
echo "GitLab Status URL: ${GIT_URL}"

# Run web tests with SmartUI Exec
npx smartui exec --gitURL "${GIT_URL}" -- npm test
npx smartui exec --githubURL "${GIT_URL}" -- npm test

only:
- merge_requests
Expand Down Expand Up @@ -489,7 +489,7 @@ visual_regression_tests:
echo "GitLab Status URL: ${GIT_URL}"

# Run Java tests with SmartUI Exec
npx smartui exec --gitURL "${GIT_URL}" -- mvn test
npx smartui exec --githubURL "${GIT_URL}" -- mvn test

only:
- merge_requests
Expand Down Expand Up @@ -537,8 +537,8 @@ visual_regression_tests:
echo "GitLab Status URL: ${GIT_URL}"

# Run mobile tests with SmartUI Exec
npx smartui exec --gitURL "${GIT_URL}" -- npm run test:mobile
# Or: npx smartui exec --gitURL "${GIT_URL}" -- npx wdio run wdio.conf.ts
npx smartui exec --githubURL "${GIT_URL}" -- npm run test:mobile
# Or: npx smartui exec --githubURL "${GIT_URL}" -- npx wdio run wdio.conf.ts

only:
- merge_requests
Expand Down Expand Up @@ -584,7 +584,7 @@ visual_regression_tests:
echo "GitLab Status URL: ${GIT_URL}"

# Run Java mobile tests with SmartUI Exec
npx smartui exec --gitURL "${GIT_URL}" -- mvn test -D suite=mobile-tests.xml
npx smartui exec --githubURL "${GIT_URL}" -- mvn test -D suite=mobile-tests.xml

only:
- merge_requests
Expand All @@ -610,7 +610,7 @@ visual_regression_tests:

**Solutions**:
1. Verify GitLab integration is active in [LambdaTest Integrations](https://integrations.lambdatest.com/)
2. Check that `--gitURL` parameter is correctly set in the exec command
2. Check that `--githubURL` parameter is correctly set in the exec command
3. Verify GitLab API URL format: `https://gitlab.com/api/v4/projects/{projectId}/statuses/{commitId}`
4. Ensure `CI_PROJECT_ID` and `CI_COMMIT_SHA` are correctly set
5. For merge requests, use `CI_MERGE_REQUEST_SHA` instead of `CI_COMMIT_SHA`
Expand Down Expand Up @@ -658,10 +658,10 @@ visual_regression_tests:

| Aspect | SmartUI Exec (This Guide) | SmartUI Hooks |
|--------|---------------------------|---------------|
| **Command** | Use `npx smartui exec --gitURL <url> -- <command>` | Run tests normally (`npm test`, `mvn test`, `pytest`) |
| **Command** | Use `npx smartui exec --githubURL <url> -- <command>` | Run tests normally (`npm test`, `mvn test`, `pytest`) |
| **Integration** | Requires CLI wrapper | Automatic via capabilities |
| **Setup** | Install SmartUI CLI, configure `.smartui.json` | Add capabilities to test config |
| **GitLab Integration** | Use `--gitURL` parameter with exec | Add `github.url` capability |
| **GitLab Integration** | Use `--githubURL` parameter with exec | Add `github.url` capability with `GITHUB_URL` |
| **Languages** | Java SDK, CLI projects, all frameworks | TypeScript/JS/Java/Python/Ruby/C#/WebdriverIO/Appium |
| **Project Token** | Required (`PROJECT_TOKEN`) | Not required (uses `LT_USERNAME`/`LT_ACCESS_KEY`) |
| **Server Address** | May need `SMARTUI_SERVER_ADDRESS` for non-Selenium | Not required |
Expand All @@ -671,7 +671,6 @@ visual_regression_tests:
## Next Steps

- Learn about [SmartUI CLI Exec Commands](/support/docs/smartui-cli-exec) for detailed exec usage
- Explore [SmartUI Best Practices](/support/docs/smartui-best-practices) for efficient visual testing workflows
- Check the [SmartUI Troubleshooting Guide](/support/docs/smartui-troubleshooting-guide/) for common issues
- Review [GitLab CI/CD Documentation](https://docs.gitlab.com/ee/ci/) for advanced pipeline configuration

Expand Down
Loading
Loading