first commit

This commit is contained in:
Matt Kane
2026-04-01 10:44:22 +01:00
commit 43fcb9a131
1789 changed files with 395041 additions and 0 deletions

54
e2e/fixtures/index.ts Normal file
View File

@@ -0,0 +1,54 @@
/**
* E2E Test Fixtures
*
* Extends Playwright's test with custom fixtures for EmDash admin testing.
* The server is started by global-setup.ts — these fixtures just provide
* the AdminPage helper and server context to each test.
*/
import { readFileSync } from "node:fs";
import { tmpdir } from "node:os";
import { join } from "node:path";
import { test as base } from "@playwright/test";
import { AdminPage } from "./admin";
export { AdminPage } from "./admin";
const SERVER_INFO_PATH = join(tmpdir(), "emdash-pw-server.json");
interface ServerInfo {
pid: number;
workDir: string;
baseUrl: string;
marketplaceUrl: string;
token: string;
sessionCookie: string;
collections: string[];
contentIds: Record<string, string[]>;
mediaIds: Record<string, string>;
}
function getServerInfo(): ServerInfo {
return JSON.parse(readFileSync(SERVER_INFO_PATH, "utf-8"));
}
/**
* Extended test with admin page fixture and server context
*/
export const test = base.extend<{
admin: AdminPage;
serverInfo: ServerInfo;
}>({
// eslint-disable-next-line no-empty-pattern
serverInfo: async ({}, use) => {
await use(getServerInfo());
},
admin: async ({ page }, use) => {
const admin = new AdminPage(page);
await use(admin);
},
});
export { expect } from "@playwright/test";