mirror of
https://github.com/PhotonVision/photonvision
synced 2026-07-05 03:21:40 +00:00
Add playwright E2E tests (#2174)
This commit is contained in:
16
photon-client/tests/fixtures.ts
Normal file
16
photon-client/tests/fixtures.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import { test as base } from "@playwright/test";
|
||||
import axios from "axios";
|
||||
|
||||
export const test = base.extend({
|
||||
page: async ({ page }, use) => {
|
||||
// Use the page in the test (no per-test backend reset here)
|
||||
axios.defaults.baseURL = "http://localhost:5800/api/test";
|
||||
await use(page);
|
||||
}
|
||||
});
|
||||
|
||||
test.beforeAll(async () => {
|
||||
console.log("Running before all tests: Resetting backend state...");
|
||||
await axios.post("http://localhost:5800/api/test/resetBackend");
|
||||
await axios.post("http://localhost:5800/api/test/activateTestMode");
|
||||
});
|
||||
Reference in New Issue
Block a user