Skip to content

Conversation

@ahmedhamouda78
Copy link
Member

Description

Fixes flaky e2e tests in the map-with-location-search feature that were failing across multiple PRs with timeout errors.

Problem

The tests were experiencing race conditions where cy.findByRole would attempt to interact with the search textbox before it was fully rendered and visible, resulting in:

AssertionError: Timed out retrying after 15000ms: Unable to find an accessible element with the role "textbox" and name `/search/i`

Solution

  • Added timeout: 30000 to all textbox queries to allow more time for rendering
  • Added .should('be.visible') assertion before interactions to ensure element is ready
  • Applied fix to both common/geo.ts and map-with-location-search.steps.ts

Testing

This fix addresses the flaky test failures seen in recent PRs. The tests should now wait properly for the search input to be visible before attempting to interact with it.

Related Issues

Fixes test failures in:

…rch textbox

The map-with-location-search e2e tests were flaky due to race conditions
where cy.findByRole would attempt to interact with the search textbox
before it was fully rendered and visible.

Changes:
- Added timeout: 30000 to all textbox queries to allow more time for rendering
- Added .should('be.visible') assertion before interactions to ensure element is ready
- Applied fix to both common/geo.ts and map-with-location-search.steps.ts

This resolves the 'Unable to find an accessible element with the role textbox'
timeout errors that were causing test failures across multiple PRs.
@ahmedhamouda78 ahmedhamouda78 requested a review from a team as a code owner January 28, 2026 10:01
@changeset-bot
Copy link

changeset-bot bot commented Jan 28, 2026

⚠️ No Changeset found

Latest commit: d10bbc5

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

sarayev
sarayev previously approved these changes Jan 28, 2026
Added explicit wait step in Background to ensure the map canvas and search
input are rendered before tests attempt to interact with them. This addresses
the flaky test failures where the component wasn't fully loaded in CI.
Adding debugging to understand root cause of flaky test:
- Log current URL and page content
- Capture console errors
- Take screenshot before checking for map
- Log body HTML length and text content

This will help identify why the component isn't rendering in CI.
Ahmed Hamouda added 2 commits January 28, 2026 15:25
Cypress doesn't allow cy commands inside promise callbacks.
Simplified debugging to just take screenshots which will show
the page state when the test fails.
Using console.log instead of cy.log to avoid Cypress promise issues.
This will output to the CI logs showing:
- Current URL
- Body HTML length
- Body text content
- Screenshot of page state
Ahmed Hamouda added 2 commits January 28, 2026 17:08
- Use cy.document() to access DOM directly without promise issues
- Log page state, element existence, and content
- Add full-page screenshots
- Create custom workflow to run only geo tests for faster iteration
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.

2 participants