Skip to content

Handle transient navigation errors before browser recovery#59

Merged
DavertMik merged 4 commits into
mainfrom
fix/spa-navigation-recovery
Jun 30, 2026
Merged

Handle transient navigation errors before browser recovery#59
DavertMik merged 4 commits into
mainfrom
fix/spa-navigation-recovery

Conversation

@DenysKuchma

Copy link
Copy Markdown
Collaborator

Summary

Prevents transient SPA navigation errors from immediately triggering browser recovery and page reloads.

When Playwright throws navigation-related context errors during page capture or state verification, Explorbot now waits for the page DOM/URL to settle and retries before falling back to
browser recovery.

  • Added shared browser error classification for navigation transition errors
  • Retried page state capture when the page is still navigating
  • Added a wait-and-retry step before browser recovery for transient navigation failures
  • Added unit coverage for browser error classification

@DenysKuchma DenysKuchma requested a review from DavertMik June 22, 2026 19:28

@DavertMik DavertMik left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I smell overengineering here
Playwright must already handle situations like loading DOM tree with doc content loaded, so I don't think we need to re-implement it

HOWEVER, if you open a project in testomat.io there is a page spinner and content is not loaded, why dom is loaded

so the fix you need must be smarter:

to understand by XHR network requests and spinner classes on page if it is in loading mode.

please USE playwright api, do not re-implement it!

wait for all XHR requests settled on page load || all spinner classes to be hidden (spinner classes can be configured) || timeout

Promise.race(
   xhr requests.
   timeout,
   spinners
)

@DenysKuchma DenysKuchma requested a review from DavertMik June 26, 2026 20:52
@DavertMik DavertMik merged commit 9785bdd into main Jun 30, 2026
2 checks passed
@DavertMik DavertMik deleted the fix/spa-navigation-recovery branch June 30, 2026 11:20
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