Skip to content

Add support for pseudoClassEnabledElements in percySnapshot options#1133

Open
Manoj-Katta wants to merge 6 commits intomasterfrom
PPLT-5015
Open

Add support for pseudoClassEnabledElements in percySnapshot options#1133
Manoj-Katta wants to merge 6 commits intomasterfrom
PPLT-5015

Conversation

@Manoj-Katta
Copy link

@Manoj-Katta Manoj-Katta commented Mar 18, 2026

Description

This PR adds support for the pseudoClassEnabledElements option in percySnapshot to allow capturing snapshots with pseudo-class states enabled on specific elements.

Changes

  • Added pseudoClassEnabledElements option support in percySnapshot function
  • The option can be passed directly to percySnapshot or configured globally via Percy config
  • When passed directly, it takes precedence over the global config setting
  • Falls back to utils.percy.config.snapshot.pseudoClassEnabledElements when not explicitly provided

Implementation Details

The implementation follows a two-tier configuration approach:

  1. Check if pseudoClassEnabledElements is passed in the options parameter
  2. If not provided, fall back to the global Percy config setting
  3. Pass the resolved value to the snapshot request

Testing

Added comprehensive test coverage:

  • ✅ Test that global Percy config pseudoClassEnabledElements is used when option is not passed
  • ✅ Test that explicit pseudoClassEnabledElements option takes precedence over global config

Jira: https://browserstack.atlassian.net/browse/PPLT-5015

@Manoj-Katta Manoj-Katta marked this pull request as ready for review March 19, 2026 03:47
@Manoj-Katta Manoj-Katta requested a review from a team as a code owner March 19, 2026 03:47
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds support for passing pseudoClassEnabledElements through percySnapshot, with a fallback to global Percy snapshot config, to enable capturing pseudo-class states for specific elements in Ember app snapshots.

Changes:

  • Resolve pseudoClassEnabledElements from per-call percySnapshot options with fallback to utils.percy.config.snapshot.
  • Include the resolved pseudoClassEnabledElements in snapshot options sent with the snapshot request.
  • Add acceptance tests covering config fallback behavior and per-call precedence.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
addon-test-support/@percy/ember/index.js Adds resolution logic for pseudoClassEnabledElements from options/config and forwards it with snapshot options.
tests/acceptance/index-test.js Adds acceptance tests validating config fallback and per-call precedence for pseudoClassEnabledElements.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds support for passing pseudoClassEnabledElements through percySnapshot, with a precedence order of explicit per-call options over global Percy config, and verifies the behavior via acceptance tests.

Changes:

  • Resolve pseudoClassEnabledElements from percySnapshot options or fall back to utils.percy.config.snapshot.pseudoClassEnabledElements.
  • Forward the resolved pseudoClassEnabledElements in snapshot options/payload.
  • Add acceptance tests covering config fallback and per-call precedence.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
tests/acceptance/index-test.js Adds tests asserting config fallback + per-call override precedence for pseudoClassEnabledElements.
addon-test-support/@percy/ember/index.js Implements option resolution and injection of pseudoClassEnabledElements into snapshot options.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

@rahulXbrowserstack rahulXbrowserstack left a comment

Choose a reason for hiding this comment

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

@Manoj-Katta Can you also attach some screenshots to show, the dev testing done

@rahulXbrowserstack Since I can't attach the staging builds I have written the tests that I have done in the jira ticket itself

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

3 participants