openreplay/frontend/tests/playwright/helpers.ts
Andrey Babushkin 09c98b5bde
E2e tests frontend (#3471)
* add playwright

* add e2e test

* add test

* add e2e test

* add e2e tests
2025-06-03 12:09:10 +02:00

18 lines
No EOL
509 B
TypeScript

import { mkdirSync } from "fs";
import { exists } from "i18next";
import { dirname } from "path";
import { test } from "@playwright/test";
export const authStateFile = 'tests/playwright/auth-state.json';
mkdirSync(dirname(authStateFile), { recursive: true });
export function testUseAuthState() {
if (exists(authStateFile)) {
test.use({ storageState: authStateFile });
}
test.afterEach(async ({ page }) => {
await page.context().storageState({ path: authStateFile });
})
}