Skip to content

Comments

Increase alfa networkidle timeout from 2s to 6s#4

Open
wittjeff wants to merge 1 commit intojrpool:mainfrom
wittjeff:increase-alfa-networkidle-timeout
Open

Increase alfa networkidle timeout from 2s to 6s#4
wittjeff wants to merge 1 commit intojrpool:mainfrom
wittjeff:increase-alfa-networkidle-timeout

Conversation

@wittjeff
Copy link

@wittjeff wittjeff commented Feb 5, 2026

Summary

  • Increases the waitForLoadState('networkidle') timeout in the alfa test from 2000ms to 6000ms

Problem

Modern websites built with JavaScript-heavy frameworks (Wix, React SPAs, etc.) continue making network requests well after the initial page load event. The current 2-second timeout for networkidle is too aggressive, causing the alfa test to timeout and return 0 results even though the page content is available for testing.

Example error from scanning a Wix site:

ERROR: Navigation to URL timed out (TimeoutError: page.waitForLoadState: Timeout 2000ms exceeded.
=========================== logs ===========================
  "load" event fired
============================================================)

Solution

Increase the timeout to 6 seconds, which:

  • Provides sufficient time for JavaScript-heavy sites to settle
  • Maintains a reasonable upper bound to avoid excessive waits
  • Aligns better with other timeouts in the codebase (e.g., domcontentloaded uses 5-6s timeouts)

Testing

Tested against Wix sites that previously failed with the 2-second timeout. The alfa test now completes successfully and returns valid accessibility results.

Modern websites, particularly those built with frameworks like Wix,
continue making network requests well after the initial page load.
The 2-second timeout for networkidle is too aggressive and causes
the alfa test to fail on these sites, returning 0 results even
though the page content is available.

Increasing the timeout to 6 seconds provides more time for
JavaScript-heavy sites to settle while still maintaining a
reasonable upper bound.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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