-
Notifications
You must be signed in to change notification settings - Fork 5
[AnVIL Catalog] Fix flaky e2e test: deselecting filters through Search all Filters textbox #4751
Copy link
Copy link
Open
Description
Description
The e2e test Check that deselecting filters through the "Search all Filters" textbox works correctly on the Workspaces tab is flaky.
Test file: e2e/anvil-catalog/anvilcatalog-filters.spec.ts:66
Helper: e2e/testFunctions.ts:797 (testDeselectFiltersThroughSearchBar)
Failure
The test expects a checkbox to be checked after selecting a filter, but the checkbox is still unchecked when the assertion runs. This suggests a race condition — the filter selection hasn't completed before the assertion fires.
Error: expect(locator).toBeChecked() failed
Locator: getByRole('button').filter({ hasText: /^Consortia Access Only\s*\d+\s*/ })
.filter({ has: getByRole('checkbox') }).getByRole('checkbox')
Expected: checked
Received: unchecked
Timeout: 15000ms
The locator resolves 19 times during the timeout but the checkbox remains unchecked, indicating the prior click to check the box may not have registered or completed.
Possible fixes
- Add a
waitForor stability check after clicking the checkbox before assertingtoBeChecked() - Ensure the filter panel is fully loaded before interacting with checkboxes
- Increase retry/timeout if the filter state update is async
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels