fix: rewrite flaky anvil catalog filter e2e test#4763
Open
Conversation
Rewrite the filter select/deselect e2e tests to be self-contained, use test IDs and scoped locators, and fix race conditions that caused flaky failures — particularly on webkit where Escape could cancel a pending filter state update. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR rewrites the AnVIL catalog “Search all filters” Playwright E2E spec to eliminate flakiness by making interactions/locators more deterministic and removing dependencies on shared helper functions.
Changes:
- Replaced the existing
anvilcatalog-filters.spec.tsimplementation with a self-contained version using scopeddata-testidlocators and inline helpers. - Reduced test flakiness by adding explicit state assertions around checkbox/tag state transitions and keyboard dismissals.
- Removed now-unused helper exports/constants and added shared constants (
MUI_CLASSES.CHIP,ANVIL_CATALOG_CATEGORY_NAMES) to support the new selectors.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| e2e/anvil-catalog/anvilcatalog-filters.spec.ts | Full rewrite of the flaky filter search E2E tests with scoped locators and inline helpers. |
| e2e/testFunctions.ts | Removes unused filter-search helpers and an unused table-cell locator export. |
| e2e/anvil-catalog/anvilcatalog-tabs.ts | Removes unused filter name/index constants. |
| e2e/features/common/constants.ts | Adds MUI_CLASSES.CHIP selector constant used by the updated spec. |
| e2e/anvil-catalog/constants.ts | Adds ANVIL_CATALOG_CATEGORY_NAMES used to drive the rewritten tests. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
NoopDog
approved these changes
Apr 9, 2026
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…4751) Fix stale popover issue where MUI keeps old popovers in the DOM during exit animations, causing firstFilterItem to match items from the wrong dropdown. Wait for popovers to fully unmount before opening new ones, scope filter items to the active popover, and scope search results to the autocomplete popper. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #4751
anvilcatalog-filters.spec.tsto be self-contained (notestFunctions.tsdependency), with inline helpers,test.describeblocks, andtest.beforeEachfor setupdata-testid="filters"anddata-testid="search-all-filters"containers instead of searching the whole pagefilter-item,filter-term) and MUI class constants (MuiChip-root) instead of fragile role/text selectorsfilter-item(MUI list button) directly rather than the nested checkbox inputtestFunctions.ts(testSelectFiltersThroughSearchBar,testDeselectFiltersThroughSearchBar,getLastRowNthColumnTextLocator)ANVIL_CATALOG_FILTERSarray and index constants fromanvilcatalog-tabs.tsCHIPto sharedMUI_CLASSESconstants andANVIL_CATALOG_CATEGORY_NAMESto catalog constantsTest plan
🤖 Generated with Claude Code