fix(e2e): stop hardcoding localhost:8128 for API resets
demo.spec.ts, ui-redesign.spec.ts and interactive-elements.spec.ts all hardcoded an absolute http://localhost:8128 base for their demo-reset helpers, which silently pointed at the local dev API even when the suite was pointed at a different target via MOBILITYOPS_PUBLIC_URL -- discovered while running the suite against the actual Unraid deployment, where the reset call kept hitting the local machine instead of the server and left BK-DEMO-RETURN in whatever state a prior run had left it. Use relative paths so the request fixture's configured baseURL is honoured everywhere.
This commit is contained in:
@@ -1,13 +1,11 @@
|
||||
import { expect, test, type APIRequestContext } from "@playwright/test";
|
||||
|
||||
const API_BASE = process.env.MOBILITYOPS_API_URL ?? "http://localhost:8128";
|
||||
|
||||
async function resetDemoData(request: APIRequestContext) {
|
||||
const login = await request.post(`${API_BASE}/api/v1/demo/login`, {
|
||||
const login = await request.post("/api/v1/demo/login", {
|
||||
data: { role: "operations_manager" },
|
||||
});
|
||||
expect(login.ok()).toBeTruthy();
|
||||
const reset = await request.post(`${API_BASE}/api/v1/demo/reset`);
|
||||
const reset = await request.post("/api/v1/demo/reset");
|
||||
expect(reset.ok()).toBeTruthy();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user