Refactor snackbar locators#860
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #860 +/- ##
==========================================
Coverage 77.04% 77.04%
Complexity 2231 2231
==========================================
Files 103 103
Lines 9214 9214
==========================================
Hits 7099 7099
Misses 2115 2115
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
What?
Part of: #778
This PR standardizes the way we locate snackbar components in our E2E tests by migrating from CSS class selectors to the component's built-in
data-test-id.Why?
The Gutenberg snackbar component already provides

data-test-id="snackbar", but we weren't utilizing it consistently. Previously, we were querying.components-snackbar__content. Moving togetByTestIdaligns with our testing best practices.How?
page.locator( '.components-snackbar__content' )withpage.getByTestId( 'snackbar' ).settings.spec.jsto correctly filter and verify the snackbar visibility using the new test ID.Use of AI Tools
AI assistance: Yes
Tool(s): Claude Code
Model(s): Sonnet 4.6
Used for: Code review, PR description
Testing Instructions
Verify that CI passes, or run the updated E2E test locally:
Changelog Entry