Skip to content

Implement End-to-End Frontend Tests for Data Donation Flows #1

@andreifoldes

Description

@andreifoldes

Description

We need comprehensive end-to-end (E2E) frontend tests to ensure the data donation flows work correctly across different scenarios.

Test Scenarios to Cover

1. Successful Data Donation Flow

  • User uploads valid PlayStation data file (.xlsx)
  • User navigates through consent → upload → filter → donation
  • User can review and delete specific rows from data tables
  • User successfully donates data and receives JSON export
  • Backend accepts the donation successfully
  • User reaches thank you page with submission ID

2. Failed Data Donation Flow (Backend Rejection)

  • User completes the frontend flow successfully
  • User attempts to donate data
  • Backend rejects the donation (server error, validation failure, etc.)
  • Application handles backend rejection gracefully
  • User receives appropriate error messages about donation failure
  • User can retry the donation process

3. Warning Data Donation Flow

  • User uploads file with missing/incomplete PlayStation data sheets
  • Application displays warning about potentially incorrect file
  • User sees detailed information about missing sheets
  • User can choose to 'Try Again' or 'Proceed Anyway'
  • If proceeding, user can still complete donation with available data

Technical Requirements

Testing Framework

  • Consider Cypress, Playwright, or similar E2E testing framework
  • Tests should run in CI/CD pipeline
  • Tests should be reproducible and reliable
  • Ability to mock backend responses for testing failure scenarios

Test Data

  • Create sample PlayStation data files for testing:
    • Valid complete file
    • File with missing sheets (for warning scenario)
  • Mock backend responses for success/failure scenarios
  • Ensure test data covers all supported data categories

Test Coverage

  • All user interactions (file upload, row deletion, navigation)
  • Data validation and parsing
  • Export functionality and JSON structure
  • Backend communication and error handling
  • User feedback for backend failures
  • Responsive design across different screen sizes

Acceptance Criteria

  • E2E tests cover all three main flow scenarios
  • Tests validate JSON export structure and content
  • Tests verify user can delete rows and track deletion counts
  • Tests confirm proper backend error handling and user feedback
  • Tests mock backend responses for failure scenarios
  • Tests run successfully in CI/CD pipeline
  • Test documentation is provided

Priority

High - This will ensure the application works reliably for research participants

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions