-
Notifications
You must be signed in to change notification settings - Fork 614
[BUG][PLAYWRIGHT]: Test ordering contamination causes 6 Playwright tests to fail in full suite #2867
Description
Description
6 Playwright E2E tests pass when run individually but fail when run as part of the full test suite. This is caused by test ordering contamination — state from earlier tests leaks into subsequent tests.
Affected Tests
MCP Registry tests (5 tests)
test_registry_panel_loadstest_registry_server_cards_displaytest_registry_search_functionalitytest_registry_refresh_buttontest_registry_server_card_details
All fail with #server-grid not being visible. The #server-grid element is loaded via HTMX partial from /admin/mcp-registry/partial and depends on the MCP Registry tab being properly initialized. When previous tests leave the page in an unexpected state, the HTMX partial load doesn't complete before the assertion timeout.
Server delete test (1 test)
test_delete_server_ui_button
Fails at page.reload() because the server creation JS handler triggers window.location.href = redirectUrl which races with the reload.
Team edit settings test (1 test)
test_edit_settings_button
Passes individually, fails when run with other TestTeams tests. Test ordering contamination from prior team CRUD operations.
Steps to Reproduce
# Full suite - tests fail
make test-ui-headless
# Individual test - passes
pytest tests/playwright/test_mcp_registry.py::TestMCPRegistry::test_registry_panel_loads -v
pytest tests/playwright/test_organization.py::TestTeams::test_edit_settings_button -vRoot Cause
Test isolation is insufficient — tests share browser state (page, cookies, DOM) and prior test execution leaves the application in a state that breaks subsequent test assumptions. Possible causes:
- HTMX partials not fully loaded/settled before next test starts
- Navigation state (active tab, sidebar) carried over between tests
- Stale DOM elements from prior HTMX swaps
Expected Behavior
All tests should pass regardless of execution order.
Environment
- Playwright with Chromium
- HTMX + Alpine.js admin UI
- FastAPI backend