World’s largest virtual agentic engineering & quality conference
Install TestMu AI's SmartUI agent skill and use your AI coding agent to run visual regression tests and review results on the SmartUI dashboard.

Mythili Raju
Author

Sushobhit Dua
Reviewer
Last Updated on: July 28, 2026
Writing a visual regression suite by hand means learning a CLI, a config file format, and a different screenshot call for every framework, then debugging why the first run flagged forty false positives from a cookie banner. TestMu AI's SmartUI agent skill exists so an AI coding agent handles that setup correctly the first time, from a plain-language request instead of trial and error.
The skill lives in the open-source agent-skills repository alongside skills for accessibility testing and every major framework. This walkthrough installs it, configures a real project, runs a first visual test on Playwright and Selenium, and covers the two things that make or break a visual suite: reviewing results correctly and killing false positives before they train your team to ignore the dashboard.
An agent skill is a folder of verified instructions and code patterns that an AI coding agent reads before it generates anything, so it produces the correct SmartUI CLI command and config on the first attempt rather than an outdated pattern scraped from a two-year-old blog post. The agent-skills repository packages this per framework and testing discipline, and smartui-skill is the one for visual regression.
SmartUI itself is TestMu AI's visual regression testing product: it captures screenshots through a CLI or an SDK call inside your existing suite, compares them against an approved baseline, and applies an AI engine to filter out anti-aliasing and rendering noise before a reviewer sees the diff. The skill is the fast path to wiring that up correctly from your terminal.
git clone https://github.com/LambdaTest/agent-skills && cd agent-skills
npx agentskillsforall add https://github.com/LambdaTest/agent-skills.git --skill smartui-skillSet your SmartUI project token, generated from the SmartUI dashboard, as an environment variable so the CLI can authenticate:
export PROJECT_TOKEN="your-smartui-project-token"
# Only needed if you also run Selenium against the cloud grid:
export LT_USERNAME="your-username"
export LT_ACCESS_KEY="your-access-key"Ask your agent to scaffold a config for your target browsers and breakpoints, or generate one directly:
npx smartui config:create smartui.config.jsonA config that covers desktop and mobile in one run looks like this:
{
"web": {
"browsers": ["chrome", "firefox", "safari"],
"viewports": [[1920, 1080], [1366, 768], [375, 812]]
},
"waitForPageRender": 2000,
"waitForTimeout": 5000
}Commit this file to source control. Pinning the browser and viewport list here, instead of leaving it to whatever ran locally, is what keeps two developers' runs comparable against the same baseline.
Tell the agent what to cover in plain language, for example: "Add a SmartUI visual test for the homepage and login page, waiting for network idle before each screenshot." It should produce something close to the patterns below, one per framework.
const { chromium } = require('playwright');
const { smartuiSnapshot } = require('@lambdatest/smartui-cli');
(async () => {
const browser = await chromium.launch();
const page = await browser.newPage();
await page.goto('https://www.testmuai.com/selenium-playground/');
await page.waitForLoadState('networkidle');
await smartuiSnapshot(page, 'Selenium Playground Home');
await browser.close();
})();Wrap the run with the SmartUI CLI so screenshots upload and compare against your project's baseline instead of just saving locally:
npx smartui --config smartui.config.json exec -- npx playwright testSelenium calls SmartUI directly against the cloud grid rather than through the CLI wrapper, using smartUI.project in the capabilities:
Map<String, Object> ltOptions = new HashMap<>();
ltOptions.put("user", System.getenv("LT_USERNAME"));
ltOptions.put("accessKey", System.getenv("LT_ACCESS_KEY"));
ltOptions.put("build", "smartui-selenium");
ltOptions.put("smartUI.project", "My SmartUI Project");
ChromeOptions options = new ChromeOptions();
options.setCapability("LT:Options", ltOptions);
WebDriver driver = new RemoteWebDriver(new URL("https://hub.lambdatest.com/wd/hub"), options);
driver.get("https://www.testmuai.com/selenium-playground/");
((JavascriptExecutor) driver).executeScript("smartui.takeScreenshot=selenium-playground-home");For a marketing site or a set of pages with no test suite behind them, list the URLs and let the CLI crawl and capture them directly, without writing any test code:
[
{ "name": "Homepage", "url": "https://example.com/", "waitForTimeout": 3000 },
{ "name": "Pricing", "url": "https://example.com/pricing", "waitForTimeout": 2000 }
]npx smartui --config smartui.config.json capture urls.json --buildName "release-v2.1"The first run against a project has no baseline, so every screenshot captured becomes the baseline automatically. Every run after that produces a diff, and results land in the SmartUI dashboard for review, not in your terminal.
If a build never shows up in the dashboard at all, the most common cause is a missing environment variable - verify PROJECT_TOKEN, or LT_USERNAME and LT_ACCESS_KEY for the Selenium path, are actually exported in the shell that ran the tests.
A visual suite that flags the same three widgets on every run trains a team to stop reading the report within two sprints. Fix the sources of noise before you scale up coverage, not after.
ignoreDOM regions in the config.networkidle and add an explicit wait on the element you are about to screenshot, not just a fixed timeout.Note: SmartUI's AI engine filters anti-aliasing and rendering noise automatically once you're capturing through the cloud grid, cutting false positives by up to 95%. Start testing free
| Problem | Fix |
|---|---|
| Screenshots show a blank or half-loaded page | Add waitForLoadState('networkidle') and an explicit wait before the screenshot call |
| Build never appears in the dashboard | Confirm PROJECT_TOKEN or LT_USERNAME/LT_ACCESS_KEY are exported in the CI environment, not just locally |
| Every run flags the same widget | Add it to hideSelectors or ignoreDOM instead of raising the global threshold |
| Viewport differs between local and CI runs | Pin the viewport list in smartui.config.json and commit it to source control |
| Command runs but nothing is captured | Check the test command is wrapped with npx smartui exec --, not run standalone |
login-validation-error, not screenshot-1, so a failing build is readable without opening every diff.Install the skill, generate a config pinned to the browsers and breakpoints you actually support, and run one page you suspect changes often before scaling to the full suite. The first run sets your baseline; every run after that is only as trustworthy as how well you have masked the dynamic content that would otherwise flag noise as a regression.
For the full debugging table and CI/CD templates for GitHub Actions, see the smartui-skill playbook, or read the visual regression testing guide to see how SmartUI's AI engine classifies and scores each detected change beyond the raw diff.
Author
Mythili is a Community Contributor at TestMu AI with 3+ years of experience in software testing and marketing. She holds certifications in Automation Testing, KaneAI, Selenium, Appium, Playwright, and Cypress. At TestMu AI, she leads go-to-market (GTM) strategies, collaborates on feature launches, and creates SEO optimized content that bridges technical depth with business relevance. A graduate of St. Joseph’s University, Bangalore, Mythili has authored 35+ blogs and learning hubs on AI-driven test automation and quality engineering. Her work focuses on making complex QA topics accessible while aligning content strategy with product and business goals.
Reviewer
Sushobhit Dua is an Engineering Manager at TestMu AI (formerly LambdaTest), leading SmartUI, the visual regression and visual testing product. He manages the team that builds and ships SmartUI and maintains and cuts releases of the open-source SmartUI CLI. He works primarily in Core Java, Spring Boot, and Gradle, and is an AMCAT Certified Software Engineer. He brings over 10 years of software engineering experience, with earlier work as a Software Engineer at ecare Technology Labs. Sushobhit owns the SmartUI roadmap and the engineering decisions behind it.
Did you find this page helpful?
More Related Blogs
TestMu AI forEnterprise
Get access to solutions built on Enterprise
grade security, privacy, & compliance