Frontend Development 12 min read

Visual Regression Testing: Page Comparison Tool Implementation at YouZan

YouZan implemented a BackstopJS‑based visual regression testing platform that automatically compares pre‑release and production pages, managing cases, scenarios, tags and selectors, which now runs over 1,000 tests, saves roughly 300 person‑days per year, has uncovered more than 100 e‑commerce issues, and is being extended to mini‑programs, React/Vue component checks, and traffic‑playback UI monitoring.

Youzan Coder
Youzan Coder
Youzan Coder
Visual Regression Testing: Page Comparison Tool Implementation at YouZan

Page-level testing is a crucial component of Web testing, focusing on user interface display, interaction, and user experience. This article introduces YouZan's page-level E2E quality strategy using visual regression testing as a complementary approach to traditional UI automation.

Background: Existing testing methods like UITest and cloud testing face challenges with instability and high maintenance costs. Manual testing struggles to comprehensively cover all functional variations in complex e-commerce pages where the same product detail page may display different layouts based on promotional activities.

Solution - BackstopJS: The team selected BackstopJS for visual regression testing due to its ease of use, focus on visual comparison, open-source nature, framework independence, modern browser support via Puppeteer, efficient CI/CD integration, flexible configuration, and clear reporting.

Implementation Features: The page comparison tool includes case management, scenario management, tag management, execution set & reporting capabilities, selector management, and batch configuration capabilities. The architecture enables automatic comparison between pre-release and production environments.

Results: With 1000+ test cases, the tool saves 300 person-days annually and has detected 100+ potential issues in the e-commerce domain. It supports various business scenarios including product details, transactions, membership, marketing, and more.

Future Directions: Plans include expanding to mini-program testing, improving compatibility with React/Vue frameworks for component-level visual regression testing, and integrating with traffic playback technology for comprehensive UI monitoring.

automated testingquality assuranceE2E testingBackstopJSfront-end testingvisual regression testingweb testing
Youzan Coder
Written by

Youzan Coder

Official Youzan tech channel, delivering technical insights and occasional daily updates from the Youzan tech team.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.