-
Notifications
You must be signed in to change notification settings - Fork 193
chore: setup Loki for visual regression testing #1666
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
Loki Test ErrorsI've encountered several issues while running
Location: Issue: ** Suggested Fix:**
** Notes: **
|
|
We had Loki for visual regression before and we removed it. I don't remember clearly why, but I don't think we're planning on re-introducing it. |
rocket chat fuselage use to have loki in the past be but started to get some issues because of apple silicon discrepancies when taking screenshots from macOS But I noticed that Rocket.Chat main repo doesn't used loki in the past . but isn't this is gsoc 2025 project list that has been selected , @dougfabris and @ggazzo is my mentor. currently this is wip. |
|
@Anxhul10 don't worry, he wasn't aware about the project 😆 |
I got little heart attack right now ... |
chore: add scss file & transitive dependency support
chore: minor improvements
chore: fuselageSnap local init
fix: merge conflicts
chore: optimize fuselage snap
chore: update refs
Mentor(s) :
Mentee:
Project Overview
Visual regression testing is used to detect visual bugs caused by styling issues, misalignments, font rendering, or dependency updates. Common problems include overlapping modules, missing or hidden elements, or components rendering outside the visible area.
This project reintroduces visual testing for Fuselage with two execution modes:
Offline mode – run tests locally against stored baseline snapshots.
Online mode – run tests on a remote environment (e.g., CI/CD).
Additionally, it implements a smart testing mode that selectively runs visual tests only for affected components, rather than executing the entire suite each time. This significantly improves efficiency while maintaining reliability in catching visual regressions early in the development cycle.
Real-Life Example: Why This Project is Needed
When Fuselage was running on Storybook 8, the visuals were stable. However, after upgrading to Storybook 9, several visual changes appeared.
The pull request (PR) that introduced the Storybook upgrade passed the CI/CD pipeline even though it caused visual regressions — because no visual tests were in place. As a result, the PR was merged, and visual issues made it into the main branch.
Examples of issues after the Storybook upgrade:
This highlights the importance of visual regression testing — it ensures that even if functional tests pass, unintended visual changes are caught before merging.
Usage Guide
1. Offline Mode
Run the following command at the root of the repository to generate and compare visual snapshots locally:
In the Storybook setup containing packages such as fuselage, fuselage-toastbar, onboarding-ui, and layout, the following scripts are available:
update-storybookBuilds Storybook in the current package where the command is executed.
After building, it removes old refs for that package and creates new refs in
.loki/refs.loki:test-ciUsed in the Docker action to compare refs and diffs visually during CI.
loki:testRuns visual tests for the current package locally inside Docker.
This script uses the flag:
2. Online Mode
Push your changes to GitHub.
This will automatically trigger visual regression tests for the affected packages and components in the CI/CD pipeline.
Sequence Diagram: Loki Visual Regression Testing Workflow
Related Pull Requests
fuselageSnap.fuselageSnap.zenika/alpine-chrome:with-node.fuselageSnapin Docker action to ensure consistency.fuselageSnapinitialization at repo root.What Can Be Improved Further?
Expansion Possibilities
Acknowledgements
I would like to thank my mentors and the Rocket.Chat community for giving me the opportunity to work on this awesome project.
This experience pushed me out of my comfort zone, encouraged me to read and understand documentation deeply, and taught me how to approach real-world open source challenges.
It truly made my summer an amazing journey of learning and growth.