Skip to content

Commit 76f7291

Browse files
authored
Merge pull request LambdaTest#1624 from JeeveshJ7/stage
DOT | Advanced Git Strategy
2 parents 8bef949 + 80385df commit 76f7291

File tree

6 files changed

+885
-2
lines changed

6 files changed

+885
-2
lines changed
Lines changed: 173 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,173 @@
1+
---
2+
id: smartui-baseline-management
3+
title: Baseline Management in SmartUI
4+
sidebar_label: Baseline Management
5+
description: Learn how to effectively manage baselines in SmartUI for visual regression testing, including dynamic baseline specification and baseline marking.
6+
keywords:
7+
- Baseline Management
8+
- Dynamic Baseline
9+
- Baseline Marking
10+
- SmartUI Git
11+
- Visual Regression Testing
12+
- Git Integration
13+
url: https://www.lambdatest.com/support/docs/smartui-baseline-management/
14+
site_name: LambdaTest
15+
slug: smartui-baseline-management/
16+
---
17+
18+
import Tabs from '@theme/Tabs';
19+
import TabItem from '@theme/TabItem';
20+
21+
---
22+
23+
<script type="application/ld+json"
24+
dangerouslySetInnerHTML={{ __html: JSON.stringify({
25+
"@context": "https://schema.org",
26+
"@type": "BreadcrumbList",
27+
"itemListElement": [{
28+
"@type": "ListItem",
29+
"position": 1,
30+
"name": "Home",
31+
"item": "https://www.lambdatest.com"
32+
},{
33+
"@type": "ListItem",
34+
"position": 2,
35+
"name": "Support",
36+
"item": "https://www.lambdatest.com/support/docs/"
37+
},{
38+
"@type": "ListItem",
39+
"position": 3,
40+
"name": "SmartUI Baseline Management",
41+
"item": "https://www.lambdatest.com/support/docs/smartui-baseline-management/"
42+
}]
43+
})
44+
}}
45+
></script>
46+
47+
:::info
48+
This guide explains how to effectively manage baselines in SmartUI for your visual regression testing workflow.
49+
:::
50+
51+
## Understanding Baselines
52+
53+
A baseline in SmartUI represents the reference point for visual regression testing. It's the set of screenshots against which all future builds are compared.
54+
55+
### Types of Baselines
56+
57+
1. **Project Baseline**: Set in project settings, used as the default comparison point
58+
2. **Branch Baseline**: Specific to a branch, used when Smart Git is enabled
59+
3. **Dynamic Baseline**: Specified during test execution
60+
4. **Build Baseline**: A specific build marked as baseline
61+
62+
## Dynamic Baseline Specification
63+
64+
SmartUI allows you to specify baselines dynamically during test execution, providing flexibility in your testing workflow.
65+
66+
### Branch-based Baseline
67+
68+
```bash
69+
npx smartui --baselineBranch "branch-name" exec -- <execution command>
70+
```
71+
72+
**Use Cases**:
73+
- Testing against a specific branch's latest approved build
74+
- Comparing feature branch against development branch
75+
- Testing hotfix against production branch
76+
77+
### Build-based Baseline
78+
79+
```bash
80+
npx smartui --baselineBuild "build-name" exec -- <execution command>
81+
```
82+
83+
**Use Cases**:
84+
- Testing against a specific build version
85+
- Comparing against a known good build
86+
- Testing against a production build
87+
88+
## Mark as Baseline
89+
90+
SmartUI provides the ability to mark builds as baseline directly through the CLI. This overwrites the global baseline branch present in the Project Settings.
91+
92+
### Basic Usage
93+
94+
```bash
95+
npx smartui --markBaseline exec -- <execution command>
96+
```
97+
98+
## Baseline Management Strategies
99+
100+
### 1. Feature Development
101+
102+
**Scenario**: Managing baselines during feature development
103+
104+
```bash
105+
# 1. Set feature branch baseline
106+
npx smartui --baselineBranch "feature/new-login" exec -- <execution command>
107+
108+
109+
### 2. Hotfix Management
110+
111+
**Scenario**: Managing baselines for hotfixes
112+
113+
```bash
114+
# 1. Set production as baseline
115+
npx smartui --baselineBranch "production" exec -- <execution command>
116+
```
117+
118+
### 3. Release Management
119+
120+
**Scenario**: Managing baselines for releases
121+
122+
```bash
123+
# 1. Set staging as baseline
124+
npx smartui --baselineBranch "staging" upload <dirName>
125+
126+
# 2. Mark release as new baseline
127+
npx smartui --markBaseline capture urls.json
128+
```
129+
130+
## Best Practices
131+
132+
1. **Baseline Selection**:
133+
- Choose stable builds as baselines
134+
- Document baseline selection criteria
135+
- Regular baseline updates
136+
137+
2. **Branch Management**:
138+
- Clear branch naming conventions
139+
- Document branch purposes
140+
- Regular branch cleanup
141+
142+
3. **Build Management**:
143+
- Meaningful build names
144+
- Document build purposes
145+
- Regular build cleanup
146+
147+
4. **Approval Process**:
148+
- Clear approval criteria
149+
- Document approval decisions
150+
- Maintain audit trail
151+
152+
## Troubleshooting
153+
154+
### Common Issues
155+
156+
1. **Baseline Issues**:
157+
- Verify baseline exists
158+
- Check baseline status
159+
- Review baseline history
160+
161+
2. **Comparison Issues**:
162+
- Verify build compatibility
163+
- Check branch status
164+
- Review comparison settings
165+
166+
3. **Permission Issues**:
167+
- Verify user permissions
168+
- Check branch protection
169+
- Review access settings
170+
171+
### Getting Help
172+
173+
If you encounter any issues with baseline management in SmartUI, please contact our support team at [email protected].

0 commit comments

Comments
 (0)