Skip to content

[Task] Expand CI/CD pipeline with Playwright End-to-End frontend tests #426

@tejassinghbhati

Description

@tejassinghbhati

What needs work?

Following the recent establishment of the comprehensive backend pytest suite and CI pipeline, the backend API is now continuously verified. However, the WebAPP frontend, which handles critical user workflows such as case creation, parameter editing, solver execution, and CSV extraction—currently lacks automated testing.

Running the application successfully requires the UI and API to coordinate smoothly, but without a frontend testing suite, we cannot automatically catch breakages in the user interface or regressions in how the UI consumes the backend API.

Possible approach (optional)

Tooling

  • Introduce Playwright for headless browser End-to-End (E2E) testing.
  • Playwright is preferred because:
    • Excellent Python/JavaScript interoperability
    • Built-in trace viewers for debugging
    • Strong support for complex DOM interaction testing

Infrastructure

  • Add pytest-playwright to:

    • Keep the testing ecosystem purely in Python
    • Maintain tight coupling with the backend test suite
  • Configure a conftest.py fixture to:

    • Spin up the Flask API locally before executing browser tests

Core Test Coverage (Smoke Tests)

  • Load App: Verify index.html loads successfully
  • Case Management:
    • Create a mock case
    • Verify it appears in the active session
    • Delete the case
  • Navigation & Diagnostics:
    • Ensure major tabs render properly
    • Verify equations in the ModelFile diagnostic UI load without console errors

CI Integration

  • Expand .github/workflows/ci.yml to include:
    • A dedicated UI/Playwright job
    • Run tests on every PR to main

What good looks like (optional)

  • The frontend has automated verification for:

    • UI rendering
    • Basic user workflows
  • A new CI pipeline job (UI Tests):

    • Runs on pull requests
    • Blocks merges if the frontend is broken or out-of-sync with the API
  • Existing behavior remains unchanged

  • Clear documentation in README.md explaining:

    • How to run UI tests locally

Anything to keep in mind? (optional)

Workflow State

  • E2E tests can be flaky if not isolated
  • Tests should:
    • Dynamically create and destroy dummy cases
    • Avoid reliance on pre-existing data

Port Conflicts

  • Flask server used in tests should:
    • Run on a different port (e.g., 5003)
    • Avoid conflicts with local development environments

DOM Stability

  • Current frontend lacks strong data-test attributes
  • Initial selectors may rely on:
    • IDs
    • Text content

Related issue, PR, or discussion (optional)

This initiative builds on the recent Backend Testing & CI foundation and will test the newly added diagnostic UIs:

Proposed track

{"Track" => "Stability"}

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    Status

    In progress

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions