Skip to content

Commit 487cfba

Browse files
authored
Merge pull request LambdaTest#1182 from amanchopra1905/stage
smart ui updates
2 parents 4a1ecf2 + c7be842 commit 487cfba

File tree

3 files changed

+26
-46
lines changed

3 files changed

+26
-46
lines changed

docs/smartui-cli-build-name.md

Lines changed: 18 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
id: smartui-sdk-build-name
33
title: Grouping Screenshots through Build Names
4-
sidebar_label: Fetch Results
4+
sidebar_label: Groups Screenshots by Build Names
55
description: In this documentation, learn how to group screenshots in a single build across multiple executions.
66
- Visual Regression
77
- Visual Regression Testing Guide
@@ -22,8 +22,6 @@ import Tabs from '@theme/Tabs';
2222
import TabItem from '@theme/TabItem';
2323
import NewTag from '../src/component/newTag';
2424

25-
---
26-
2725
<script type="application/ld+json"
2826
dangerouslySetInnerHTML={{ __html: JSON.stringify({
2927
"@context": "https://schema.org",
@@ -47,28 +45,24 @@ import NewTag from '../src/component/newTag';
4745
})
4846
}}
4947
></script>
50-
5148
SmartUI CLI allows you to group screenshots in a build name and append new screenshots to an existing build. This feature enables you to assign build names, add screenshots to existing builds and manage your visual tests efficiently.
5249

53-
5450
## Prerequisites
5551

5652
- Basic understanding of Command Line Interface
5753
- Login to [LambdaTest SmartUI](https://smartui.lambdatest.com/) with your credentials.
5854
- Ensure you are using `@lambdatest/smartui-cli` version 4.0.14 or higher.
5955
- A properly configured SmartUI CLI project
6056

61-
## Steps to Use
62-
63-
### **Step 1:** Install SmartUI CLI
57+
## Step 1: Install SmartUI CLI
6458

6559
If you haven't already installed SmartUI CLI, install it using npm:
6660

6761
```bash
6862
npm i @lambdatest/smartui-cli
6963
```
7064

71-
### **Step 2:** Configure your Project Token
65+
## Step 2: Configure your Project Token
7266

7367
Setup your project token show in the **SmartUI** app after, creating your project.
7468

@@ -95,7 +89,7 @@ $Env:PROJECT_TOKEN="123456#1234abcd-****-****-****-************"
9589
</TabItem>
9690
</Tabs>
9791

98-
### **Step 3:** Execute Tests with custom Build Names
92+
## Step 3: Execute Tests with custom Build Names
9993

10094
You can add a custom build name by adding the `--buildName` flag to your test execution command. Here are different ways to use this feature:
10195

@@ -111,14 +105,14 @@ npx smartui --config .smartui.json exec --buildName "Sample Build Name" -- <exec
111105
>npx smartui --config .smartui.json exec --buildName "Sample Build Name" -- node test.js
112106
>```
113107
114-
#### Default Usage
108+
### Default Usage
115109
If no buildname is specified, a random build name is added to the builds:
116110
117111
```bash
118112
npx smartui --config .smartui.json exec -- <execution-command>
119113
```
120114
121-
### **Step 4:** Advanced Use Case
115+
## Step 4: Advanced Use Case
122116

123117
If you are running multiple test cases in a single job (e.g., using HyperExecute) and want to club all screenshots under a single build while maintaining consistent Git baseline management, you can do the following:
124118

@@ -127,34 +121,15 @@ This can be done as follows:
127121
```bash
128122
npx smartui --config .smartui.json exec --buildName $env:JOB_ID -- node test.js
129123
```
130-
##### This approach ensures:
131-
132-
- A new build is created for every HyperExecute job.
133-
- Screenshots from all tests in the same job are appended to the same build.
134-
- Git branching strategies remain unaffected, improving baseline management across branches.
135-
136-
137-
>## Key Benefits
138-
>1. Efficient grouping of screenshots by build names.
139-
>2. Seamless integration with Git baseline management.
140-
>3. Flexibility to append screenshots to existing builds.
141-
>4. Optimized workflows for parallel and single-job executions.
142-
143-
144-
<nav aria-label="breadcrumbs">
145-
<ul className="breadcrumbs">
146-
<li className="breadcrumbs__item">
147-
<a className="breadcrumbs__link" target="_self" href="https://www.lambdatest.com">
148-
Home
149-
</a>
150-
</li>
151-
<li className="breadcrumbs__item">
152-
<a className="breadcrumbs__link" target="_self" href="https://www.lambdatest.com/support/docs/">
153-
Support
154-
</a>
155-
</li>
156-
<li className="breadcrumbs__item breadcrumbs__item--active">
157-
<span className="breadcrumbs__link"> Smart UI with Cypress </span>
158-
</li>
159-
</ul>
160-
</nav>
124+
125+
## Key Benefits
126+
- **Efficient Grouping:** Screenshots are grouped by build names, improving organization and traceability.
127+
- **Seamless Git Integration:** Integrates smoothly with Git to maintain baseline integrity across branches.
128+
- **Flexible Updates:** Allows appending screenshots to existing builds, enhancing adaptability.
129+
- **Optimized Workflows:** Supports streamlined operations for both parallel and single-job executions.
130+
131+
## Conclusion
132+
This approach provides a structured and efficient way to manage visual tests:
133+
- **New Build for Each HyperExecute Job:** A dedicated build is created for every HyperExecute job, ensuring clear separation and traceability.
134+
- **Consolidated Screenshot Grouping:** Screenshots from all tests within the same job are appended to a single build for seamless organization.
135+
- **Uninterrupted Git Workflow:** Git branching strategies remain unaffected, enabling robust baseline management across branches.

docs/smartui-guided-walkthrough.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,14 @@ The SmartUI dashboard presents a comparison between the baseline and the capture
5454
### Diff Controls
5555
Located at the center of the top menu, the Diff Controls allow testers to customize how visual differences are displayed, offering multiple options to refine the comparison process. The available modes are:
5656

57+
#### Layers
5758
- **Captured Diffs :** Highlights the differences detected in the current captured screenshots when compared to the baseline. Ideal for spotting changes introduced in the latest version.
5859
- **Baseline Diffs :** Displays the differences by focusing on the baseline's unique elements. Helps identify elements missing or changed in the new capture. Annotations : Allows users to add notes or highlight specific regions of interest on the screenshots. Useful for documenting findings or collaborating with team members.
60+
- **Annotations :** Controls the visibility of your annotations in both parallel and landscape views with a toggle, default set to off, ensuring a clean visual field when not needed.
61+
62+
#### Diff Options
5963
- **Strict Mode :** Highlights exact pixel mismatches between the baseline and captured screenshots. Best suited for detailed visual inspections where high precision is required.
60-
- **Smart Ignore :** Automatically ignores minor, non-critical differences (e.g., anti-aliasing, rendering variations). Useful for reducing noise in tests, allowing the focus to remain on significant UI changes.
64+
- **Smart Ignore :** Iintelligently hides the displacement differences, allowing you to concentrate on actual content changes that impact the user experience.
6165

6266
### Variants
6367
The top menu includes browser variants, which allow cross-browser testing. Variants visible in the screenshot include: Chrome, Firefox, Edge, Playwright WebKit (Pw-Webkit). Each variant shows the same test across different browsers and resolutions, helping identify browser-specific visual issues.

sidebars.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2778,6 +2778,7 @@ module.exports = {
27782778
collapsed: true,
27792779
label: "CLI Configurations",
27802780
items: [
2781+
"smartui-sdk-build-name",
27812782
"smartui-sdk-fetch-results",
27822783
"smartui-cli-responsive-dom",
27832784
"smartui-sdk-config-options",
@@ -2824,6 +2825,7 @@ module.exports = {
28242825
]
28252826
},
28262827
"smartui-pdf-comparison",
2828+
"smartui-draw-on-ui",
28272829
]
28282830
},
28292831
{
@@ -2840,7 +2842,7 @@ module.exports = {
28402842
{
28412843
type: "category",
28422844
collapsed: true,
2843-
label: "Trigger Visual Tests from CI/CD tools",
2845+
label: "Run Visual Tests on PRs",
28442846
items: [
28452847
"smartui-github-app-integration",
28462848
],
@@ -2869,7 +2871,6 @@ module.exports = {
28692871
label: "Project Management",
28702872
items: [
28712873
"smartui-project-settings",
2872-
"smartui-draw-on-ui",
28732874
"test-settings-options",
28742875
"html-dom-smartui-options",
28752876
"smart-ui-build-options",

0 commit comments

Comments
 (0)