Skip to content

Conversation

@ScottiBR
Copy link
Contributor

@ScottiBR ScottiBR commented Dec 5, 2025

📋 Pull Request Checklist

  • I have added unit tests to cover my changes.
  • I have added or updated Storybook stories where applicable.
  • I have tested the changes manually in the local environment.
  • I have checked that no PII data is being sent on analytics events
  • All E2E tests are passing, and I have added new tests if necessary.
  • All interfaces and types introduced or updated are strictly typed.

📝 Summary

This PR introduces visual snapshot testing into our existing E2E framework, focusing initially on the Credit Card and Gift Card components.

Using axe-core static Storybook testing to reuse our existing architecture proved unviable because we are not currently mocking backend requests in that environment. This led to inconsistencies across test runs (e.g., unpredictable payment method ordering) that made snapshot tests unreliable.

This is a "quick win" using our stable E2E environment. Added snapshot assertions to the existing Credit Card and Gift Card E2E tests. This acts as a baseline. It allows us to catch regressions immediately while we iteratively tune the snapshot configuration parameters (thresholds, masking, etc.) to better reflect the specifics of our Web SDK environment.


🧪 Tested scenarios


🔗 Related GitHub Issue / Internal Ticket number

https://youtrack.is.adyen.com/issue/COSDK-850/Implement-Snapshot-Tests-for-Drop-in-credit-card

Closes: COSDK-850


@changeset-bot
Copy link

changeset-bot bot commented Dec 5, 2025

⚠️ No Changeset found

Latest commit: 8069abe

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@netlify
Copy link

netlify bot commented Dec 5, 2025

Deploy Preview for adyen-web ready!

Name Link
🔨 Latest commit 8069abe
🔍 Latest deploy log https://app.netlify.com/projects/adyen-web/deploys/6945765d4b167d0008622298
😎 Deploy Preview https://deploy-preview-3706.checkout-web-dev.adyen.com
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @ScottiBR, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the robustness of end-to-end testing by integrating DOM snapshot tests for critical payment components. The primary goal is to proactively identify and prevent structural regressions in the Drop-in and Gift Card interfaces, ensuring visual consistency and proper rendering, especially concerning dynamic DOM manipulations like accessibility element additions.

Highlights

  • DOM Snapshot Testing: Added DOM snapshot tests for the Drop-in component to capture its initial empty credit card state, ensuring visual consistency.
  • Gift Card Integration Testing: Introduced DOM snapshot tests for the Gift Card integration to verify its appearance after details are filled, preventing structural regressions.
  • Standardized Snapshot Configuration: Defined a SCREENSHOT_CONFIG constant to standardize snapshot testing parameters across E2E tests, promoting consistency and maintainability.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces DOM snapshot testing for the Drop-in and Gift Card components to catch structural regressions. The implementation is good, adding a new SCREENSHOT_CONFIG constant for consistency. I've made a couple of suggestions: one to improve test stability by ensuring a component is fully visible before taking a snapshot, and another to adhere to file formatting conventions.

@github-actions
Copy link
Contributor

github-actions bot commented Dec 5, 2025

size-limit report 📦

Path Size
UMD 113.91 KB (0%)
Auto 120.21 KB (0%)
ESM - Core 25.45 KB (0%)
ESM - Core + Card 64.68 KB (0%)
ESM - Core + Dropin with Card 71.27 KB (0%)

@ScottiBR ScottiBR force-pushed the add-snapshot-tests branch 6 times, most recently from dc57efd to a7cede9 Compare December 5, 2025 16:36
@ScottiBR ScottiBR marked this pull request as ready for review December 5, 2025 16:57
@ScottiBR ScottiBR requested a review from a team as a code owner December 5, 2025 16:57
@ScottiBR ScottiBR requested a review from m1aw December 5, 2025 16:57
@ScottiBR ScottiBR force-pushed the add-snapshot-tests branch 2 times, most recently from 981e785 to afd6b73 Compare December 11, 2025 10:48
@ScottiBR ScottiBR changed the title improve e2e testing adding snapshots POC Snapshot tests Dec 19, 2025
@sonarqubecloud
Copy link

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.

1 participant