Files
flights_web_raw/e2e/CYPRESS_TEST_REPORT.md
T

7.1 KiB

Cypress E2E Test Execution Report

Date: April 5, 2026 Test Environment: React App (localhost:3001) vs Angular Reference (localhost:3000) Test Duration: 46 seconds Status: FAILED - Critical Application Stability Issue

Executive Summary

The Cypress e2e test suite experienced complete failure due to a critical issue: the React application crashes during the test run after processing only the first few test files. All 40 test files were discovered and attempted, but the React server becomes unresponsive (ECONNREFUSED errors) after approximately 8-10 minutes into execution.

Test Execution Results

Overall Statistics

  • Total Test Files: 40
  • Total Tests (Potential): 897
  • Tests Executed: 56 (before app crash)
  • Tests Passing: 0
  • Tests Failing: 56
  • Tests Skipped: 841
  • Success Rate: 0%

Critical Failure Pattern

All failures are identical: CypressError: cy.visit() failed - Error: connect ECONNREFUSED 127.0.0.1:3001

This indicates the React development server crashes or becomes unresponsive when Cypress attempts to run multiple tests in succession.

Test File Breakdown

Successfully Started (Before App Crash)

  1. components/button.cy.ts - 1 failure (beforeEach hook), 4 skipped
  2. components/datepicker.cy.ts - 1 failure (beforeEach hook), 36 skipped
  3. components/input.cy.ts - 1 failure (beforeEach hook), 47 skipped
  4. components/modal.cy.ts - 1 failure (beforeEach hook), 38 skipped
  5. components/tabs.cy.ts - 1 failure (beforeEach hook), 34 skipped
  6. error-handling/form-validation.cy.ts - 1 failure, 7 skipped
  7. error-handling/network-errors.cy.ts - 1 failure, 7 skipped
  8. error-handling/performance.cy.ts - 1 failure, 5 skipped
  9. error-handling/session-timeout.cy.ts - 4 failures (3 seconds duration)
  10. flight-details/fares.cy.ts - 1 failure, 56 skipped
  11. flight-details/flight-info.cy.ts - 1 failure, 57 skipped
  12. flight-details/passenger-info.cy.ts - 1 failure, 50 skipped
  13. flight-details/seat-selection.cy.ts - 1 failure, 49 skipped
  14. flight-details/services.cy.ts - 1 failure, 23 skipped
  15. i18n/currency.cy.ts - 1 failure, 4 skipped
  16. i18n/date-localization.cy.ts - 1 failure, 6 skipped
  17. i18n/language-switching.cy.ts - 1 failure, 7 skipped
  18. i18n/locale-persistence.cy.ts - 6 failures (4 seconds duration)
  19. i18n/text-direction.cy.ts - 1 failure, 4 skipped
  20. navigation/404.cy.ts - 5 failures (3 seconds duration)
  21. navigation/back-forward.cy.ts onwards - ALL FAILED with ECONNREFUSED

Files Never Executed

  • navigation/breadcrumb.cy.ts
  • navigation/links.cy.ts
  • navigation/routes.cy.ts
  • online-board/** (all 5 files)
  • responsive/** (all 5 files)
  • schedule/** (all 5 files)
  • base.spec.ts

Root Cause Analysis

Primary Issue: React App Instability

The React development server at localhost:3001 crashes or becomes unresponsive when:

  1. Cypress rapidly loads the application multiple times (beforeEach hooks)
  2. Tests execute in quick succession with no delays
  3. The app is under sustained network load from test automation

Evidence

  • Manual curl http://localhost:3001/ works fine outside of test execution
  • The app becomes unresponsive exactly when Cypress reaches tests 8-10
  • Error pattern is consistent: ECONNREFUSED 127.0.0.1:3001
  • No beforeEach hook ever completes successfully

Secondary Issues (Cannot Be Verified Due to Primary Crash)

Since no tests ran successfully, the following cannot be validated:

  • UI component rendering
  • data-testid attribute presence
  • Route functionality
  • Navigation between pages
  • Component functionality matching Angular

Detailed Test Results Summary

Test File Tests Duration Status Notes
components/button.cy.ts 5 868ms FAILED BeforeEach hook failure
components/datepicker.cy.ts 37 843ms FAILED BeforeEach hook failure
components/input.cy.ts 48 854ms FAILED BeforeEach hook failure
components/modal.cy.ts 39 862ms FAILED BeforeEach hook failure
components/tabs.cy.ts 35 847ms FAILED BeforeEach hook failure
error-handling/* 22 ~800ms ea FAILED BeforeEach hook failures
flight-details/* 240 ~850ms ea FAILED BeforeEach hook failures
i18n/* 31 ~800ms ea FAILED BeforeEach hook failures
navigation/* 19 844ms-3sec FAILED App crash at 404.cy.ts
online-board/* 188 N/A SKIPPED App crashed before execution
responsive/* 31 N/A SKIPPED App crashed before execution
schedule/* 162 N/A SKIPPED App crashed before execution
base.spec.ts 1 826ms FAILED App crash confirmed

Critical Failures Identified

Failure Type 1: Server Connection Refused (ALL)

Error: connect ECONNREFUSED 127.0.0.1:3001
  • Occurs: During cy.visit() in beforeEach hooks
  • Impact: Prevents all test execution
  • Severity: CRITICAL

Failure Type 2: Test Skipping (Cascading)

  • When beforeEach fails, all subsequent tests in that file are automatically skipped
  • 841 tests skipped due to 56 failures

Recommendations

Immediate Actions Required

  1. Investigate React App Stability

    • Check for memory leaks in React dev server
    • Review Vite configuration for resource limits
    • Enable verbose logging in React app during test runs
    • Check for unhandled exceptions in React code
  2. Check for Port Conflicts

    • Verify localhost:3001 is exclusively available
    • Check for port reuse or TIME_WAIT issues
    • Monitor network connections during test run: netstat -an | grep 3001
  3. Review React Component Rendering

    • Some component may cause infinite loops or hangs on mount
    • Check for race conditions in async component initialization
    • Review hooks for effects that might crash
  4. Examine Test Infrastructure

    • Add delays between tests (cy.wait, cy.pause)
    • Run tests serially instead of in batch
    • Add health checks between test files
    • Consider running fewer tests per Cypress session

Investigation Steps

# Monitor React app during test run
npm run dev -- --clearScreen false 2>&1 | tee react-dev.log

# Run Cypress with detailed debugging
DEBUG=cypress:* npm run cypress:run

# Monitor port status
lsof -i :3001

# Check system resources
top -l1 | head -20

Next Steps

  1. Identify which component or React code causes the crash
  2. Stabilize React dev server under load
  3. Implement test retry logic and backoff
  4. Consider running tests with separated browser instances
  5. Add server health checks in test suite
  6. Consider using a production build instead of dev server for testing

Screenshots

Failure screenshots have been captured in /Users/gnezim/_projects/tims/flights_web_raw/Aeroflot.Flights.Web/e2e/cypress/screenshots/

Conclusion

The React application requires critical stability fixes before meaningful e2e testing can proceed. The current test suite cannot validate any functionality because the development server becomes unresponsive after the first 8-10 tests. This indicates a fundamental problem with how the React app handles rapid page loads or multiple concurrent connections from the test automation framework.