Skip to content

Conversation

@brunoamui
Copy link
Collaborator

Problem

E2E tests were taking 18-26 minutes to fail due to page load timeouts. Tests waited 120 seconds per page load, and when pages failed to load (due to hanging resources or network issues), the tests would run for a very long time before reporting failures.

Additionally, there was no visibility into:

  • Which specific URLs were timing out
  • How long pages actually took to load
  • What errors occurred during page loads
  • Which resources were causing hangs

Solution

This PR makes tests fail fast (within 30 seconds instead of 120 seconds) and adds comprehensive diagnostic logging to help identify the root cause of timeout issues.

Changes

1. Cypress Configuration (cypress.config.cjs)

  • ✅ Reduced pageLoadTimeout from 120s → 30s (4x faster failure)
  • ✅ Added defaultCommandTimeout: 10000 (10s for commands)

2. Navigation Tests (helpcenter-navigation-status.cy.js)

  • ✅ Added timing logs showing when page load starts and completion time
  • ✅ Added error logging for uncaught exceptions with context
  • ✅ Updated cy.visit() with explicit 30s timeout
  • ✅ Added error callbacks to log exact failure time and error message

3. Copy for AI Tests (copy-for-llm.cy.js)

  • ✅ Added logging of selected tutorial URL to cypress.log file (visible in CI)
  • ✅ Added language slug logging for all three languages (EN/ES/PT)
  • ✅ Added timing information for page loads
  • ✅ Added error logging for uncaught exceptions
  • ✅ Updated all 6 cy.visit() calls with 30s timeout

Impact

Before:

  • Tests waited 120s per page timeout
  • Total failure time: 18-26 minutes
  • No visibility into which resource was hanging

After:

  • Tests fail after 30s max per page
  • Total failure time: ~5-8 minutes (4x faster)
  • Detailed logs show:
    • Which URL is being tested
    • When page load starts
    • How long the visit takes
    • Exact error message and timing when it fails
    • Which exceptions occur during page load

Example Log Output

📋 HELP CENTER NAVIGATION TEST
[1/3] Testing: announcements
    Page: "Amazon integration: Amazon Offer Matching"
    URL: https://deploy-preview-358--leafy-mooncake-7c2e5e.netlify.app/announcements/2023-07-04-amazon-integration-amazon-offer-matching
    ⏱️  Page load started
    ❌ Visit failed after 30142ms: Timed out after waiting 30000ms for your remote page to load

This will help us quickly identify which pages are problematic and how long they're actually taking to load, enabling faster debugging and resolution of the underlying issues.

- Reduce pageLoadTimeout from 120s to 30s for faster failures
- Add defaultCommandTimeout of 10s
- Update all cy.visit() calls to use 30s timeout with failOnStatusCode: false
- Add detailed timing logs for page loads in both test suites
- Add error logging for uncaught exceptions with context
- Log selected tutorial URL in copy-for-llm test for debugging
- Add visit timing information to identify slow/hanging pages

This will help tests fail fast (within 30s instead of 120s) and provide
better diagnostics about which resources are causing page load timeouts.
@netlify
Copy link

netlify bot commented Nov 8, 2025

Deploy Preview for leafy-mooncake-7c2e5e ready!

Name Link
🔨 Latest commit 107ad2f
🔍 Latest deploy log https://app.netlify.com/projects/leafy-mooncake-7c2e5e/deploys/690f65ad962670000835fb99
😎 Deploy Preview https://deploy-preview-359--leafy-mooncake-7c2e5e.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

This pull request does not contain a valid label. Please add one of the following labels: ['release-no', 'release-auto', 'release-patch', 'release-minor', 'release-major']

…only

The cypress-io/github-action was building the app locally and running tests
against localhost, which was slow and unnecessary since we want to test the
actual Netlify deploy preview.

This change skips the build step and runs tests directly against the Netlify
preview URL, making the workflow much faster and testing the actual deployed
artifact.
Added detailed diagnostics to identify why tests run locally but timeout in CI:

Network Diagnostics:
- DNS resolution test for deploy preview
- HTTP response time measurements (connect, transfer, total)
- Navigation API endpoint connectivity test
- All results logged to GitHub step summary

Cypress Debugging:
- Enabled DEBUG=cypress:server:* for detailed Cypress logs
- Added ELECTRON_ENABLE_LOGGING for browser debugging
- Added 'time' command prefix to measure test execution time
- Kept existing detailed logging in test files

This will help us understand:
- Network latency from GitHub Actions to Netlify
- DNS resolution issues
- Whether the deploy preview is actually accessible
- Timing breakdown of where delays occur
- Any Cypress-specific issues in the CI environment
- Add 2 retries for failed tests in CI (runMode)
- Reduce requestTimeout from 30s to 10s
- Reduce responseTimeout from 30s to 10s
- This will fail faster on network issues and retry intermittent failures
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