Skip to content

[DEV-11797] add backstop tests#2456

Merged
adamdoe merged 9 commits intodevfrom
new-tests
Dec 18, 2025
Merged

[DEV-11797] add backstop tests#2456
adamdoe merged 9 commits intodevfrom
new-tests

Conversation

@adamdoe
Copy link
Copy Markdown
Collaborator

@adamdoe adamdoe commented Dec 16, 2025

This pull request introduces a comprehensive set of regression tests for the CDC COVE Gallery visualizations by adding Storybook stories and automated visual regression testing infrastructure. It also integrates BackstopJS for visual regression testing and provides supporting scripts for user interaction automation. The changes are grouped into new Storybook stories for different visualization types, BackstopJS integration, and supporting helper scripts.

Storybook regression test stories:

  • Added Gallery.Charts.stories.tsx, Gallery.DataBite.stories.tsx, and Gallery.Maps.stories.tsx to the Storybook _stories directory, providing automated rendering and regression tests for a wide variety of chart, data bite, and map examples from the CDC COVE Gallery. Each story uses a helper function to verify that the visualization and its container render correctly. [1] [2] [3]

BackstopJS visual regression testing integration:

  • Added BackstopJS scripts to package.json (backstop:reference, backstop:test, backstop:approve, backstop:open) to facilitate visual regression testing workflows.

Automation scripts for BackstopJS:

  • Introduced clickAndHoverHelper.js, onBefore.js, and onReady.js in backstop_data/engine_scripts/puppet/ to automate user interactions (hover, click, type, scroll) and to ensure that scenarios are fully loaded and ready for screenshot capture during BackstopJS runs. [1] [2] [3]

These changes together provide a robust framework for automated regression testing of visualizations, ensuring that future changes do not introduce visual bugs.

- Added multiple new bitmap reference images for various charts and maps in the backstop_data/bitmaps_reference directory.
- Introduced click and hover helper functions in backstop_data/engine_scripts/puppet to streamline interaction handling during visual regression tests.
- Updated onBefore and onReady scripts to utilize the new helper functions for improved scenario execution.
- Enhanced package.json with new BackstopJS commands for easier testing and report generation.
@adamdoe adamdoe changed the title New tests [DEV-11797] add backstop tests Dec 16, 2025
@adamdoe adamdoe requested review from Viseghoh and khartco December 16, 2025 23:39
@khartco
Copy link
Copy Markdown
Collaborator

khartco commented Dec 18, 2025

Looks really good. I did notice one failure when running a test directly after a reference run, and I think a quick note in the README or somewhere else about running it would be good (mostly, start storybook first, run reference on the good/stable branch, run test on new branch, etc -- if that's actually the case)

Screenshot 2025-12-18 at 3 50 12 PM

@adamdoe adamdoe merged commit d5d4989 into dev Dec 18, 2025
3 checks passed
@adamdoe adamdoe deleted the new-tests branch December 18, 2025 23:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants