Skip to content

test: establish Playwright E2E UI testing foundation (#426)#427

Closed
tejassinghbhati wants to merge 8 commits intoEAPD-DRB:mainfrom
tejassinghbhati:feature/playwright-e2e-tests
Closed

test: establish Playwright E2E UI testing foundation (#426)#427
tejassinghbhati wants to merge 8 commits intoEAPD-DRB:mainfrom
tejassinghbhati:feature/playwright-e2e-tests

Conversation

@tejassinghbhati
Copy link
Copy Markdown
Contributor

Linked Issue

Closes #426
Related #58, #14


Existing Related Work Reviewed

Issues/PRs reviewed: #426, #58, #14


Overlap Assessment

  • Classification: Structural Testing Addition / CI Expansion
  • Overlapping items: None

Why this is not duplicate/superseded:
This PR introduces an End-to-End (E2E) headless browser testing framework. It builds sequentially on the recent API unit-testing foundations but targets the previously untested Vanilla JS WebAPP frontend.


Why this PR Should Proceed

Automated E2E tests are essential for ensuring that future UI modifications—especially complex CSS/HTML updates from upstream OSeMOSYS/MUIO merges—do not silently break critical WebAPP behaviors and workflows.

This establishes a strict frontend quality gate before any PR is merged into main.


Summary

What Changed

  • Established pyproject.toml to manage pytest-playwright dependencies without bloating production requirements.
  • Engineered a robust live_server fixture in conftest.py:
    • Spins up Flask backend on an isolated port (5003)
    • Runs on a background thread
  • Replaced arbitrary timeout guesses with a dynamic health-check polling loop:
    • Uses requests
    • Max timeout: 15 seconds
    • Prevents flaky CI failures on slow runners
  • Added Playwright-based UI smoke tests (test_ui_smoke.py):
    • Uses getByText and getByRole
    • Verifies:
      • DOM boot
      • Base layout rendering
      • SPA routes (#/Parameters, #/ModelFile)
  • Added GitHub Actions workflow (ui-tests.yml):
    • Installs headless Chromium
    • Runs E2E tests automatically on PRs to main

Why

The frontend previously relied entirely on manual verification.

E2E tests with Playwright simulate real user workflows, validating:

  • UI rendering (DOM)
  • Client-side logic
  • Flask API integration

This ensures structural issues are caught immediately.


Validation

  • Tests added/updated (or not applicable)
  • Validation steps documented
  • Evidence attached (logs/screenshots/output as relevant)

    Note: Tests run directly in the GitHub Actions pipeline


Documentation

  • Docs updated in this PR (or not applicable)
  • Setup/workflow changes reflected in repository documentation

Scope Check

  • No unrelated refactors
  • Implemented from a feature branch
  • Change is deliverable without upstream OSeMOSYS/MUIO dependency
  • Base repo/branch: EAPD-DRB/MUIOGO:main (not upstream)

@github-actions github-actions bot added the needs-intake-fix PR intake structure needs maintainer follow-up label Apr 10, 2026
@tejassinghbhati tejassinghbhati changed the title test: establish Playwright E2E UI testing foundation via conftest and… test: establish Playwright E2E UI testing foundation (#426) Apr 10, 2026
@tejassinghbhati
Copy link
Copy Markdown
Contributor Author

@m13v again a lot of thanks for your guidance. I just formally opened the PR linked to that issue.

I made sure to tightly integrate the 15-second cold-start polling limits, the strict 5003 isolation mapping, and the exact Text/Role Playwright locators we were discussing. Would love to get your eyes on it when you have a moment to see if the testing structure feels right to you.

Without your suggestions this would have been way more rough around the edges and prone to CI flakiness.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-intake-fix PR intake structure needs maintainer follow-up

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant