Baseline Management in SmartUI
info
This guide explains how to effectively manage baselines in SmartUI for your visual regression testing workflow.
Understanding Baselines
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.
Types of Baselines
- Project Baseline: Set in project settings, used as the default comparison point
- Branch Baseline: Specific to a branch, used when Smart Git is enabled
- Dynamic Baseline: Specified during test execution
- Build Baseline: A specific build marked as baseline
Dynamic Baseline Specification
SmartUI allows you to specify baselines dynamically during test execution, providing flexibility in your testing workflow.
Branch-based Baseline
npx smartui --baselineBranch "branch-name" exec -- <execution command>
Use Cases:
- Testing against a specific branch's latest approved build
- Comparing feature branch against development branch
- Testing hotfix against production branch
Build-based Baseline
npx smartui --baselineBuild "build-name" exec -- <execution command>
Use Cases:
- Testing against a specific build version
- Comparing against a known good build
- Testing against a production build
Mark as Baseline
SmartUI provides the ability to mark builds as baseline directly through the CLI. This overwrites the global baseline branch present in the Project Settings.
Basic Usage
npx smartui --markBaseline exec -- <execution command>
Baseline Management Strategies
1. Feature Development
Scenario: Managing baselines during feature development
# 1. Set feature branch baseline
npx smartui --baselineBranch "feature/new-login" exec -- <execution command>