🐞 Bug Summary
Playwright test suite fails with "404 default backend" errors when running against path-prefixed deployments. APIRequestContext resolves absolute URL paths (starting with /) from domain root instead of from base_url, causing API calls to hit wrong endpoints.
🧩 Affected Component
Select the area of the project impacted:
Playwright test suite
🔁 Steps to Reproduce
- Deploy MCP Gateway to environment with path prefix set in APP_ROOT_PATH (e.g., /test)
- Configure Playwright tests with path-prefixed base_url
- Run Playwright tests, e.g: pytest tests/playwright/test_admin_ui.py
Observe test failures with "404 default backend" errors
🤔 Expected Behavior
APIRequestContext calls should resolve relative to the configured base_url, regardless of whether the deployment uses a path prefix. Tests using api_request_context.post("/teams/") should hit {base_url}/{app_root_path}/teams/, not {base_url}/teams/.
📓 Logs / Error Output
FAILED tests/playwright/test_rbac_permissions.py::TestRBACGatewayCreate::test_admin_create_gateway_all_teams_view[chromium]
AssertionError: Failed to create team: 404 default backend - 404
Error at line 208:
assert resp.ok, f"Failed to create team: {resp.status} {resp.status_text} - {resp.text()}"
🐞 Bug Summary
Playwright test suite fails with "404 default backend" errors when running against path-prefixed deployments. APIRequestContext resolves absolute URL paths (starting with /) from domain root instead of from base_url, causing API calls to hit wrong endpoints.
🧩 Affected Component
Select the area of the project impacted:
mcpgateway- APImcpgateway- UI (admin panel)mcpgateway.wrapper- stdio wrapperPlaywright test suite
🔁 Steps to Reproduce
Observe test failures with "404 default backend" errors
🤔 Expected Behavior
APIRequestContext calls should resolve relative to the configured base_url, regardless of whether the deployment uses a path prefix. Tests using api_request_context.post("/teams/") should hit {base_url}/{app_root_path}/teams/, not {base_url}/teams/.
📓 Logs / Error Output