~james/core

core/e2e/harness/auth.setup.ts -rw-r--r-- 514 bytes
452f17b7 — james chore(import): snapshot james.dad.town/core at f70c71c7696a 16 hours ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import { test as setup } from "@playwright/test";

import { authFile, seeded } from "./config";
import { recorded, watchBrowser } from "./record";
import { logIn } from "./signin";

for (const account of Object.values(seeded)) {
	setup(`log in ${account.name}`, async ({ page }) => {
		watchBrowser(page.context());
		await setup.step("log in", (info) =>
			recorded(
				info,
				() => logIn(page, account),
				() => page.url()
			)
		);
		await page.context().storageState({ path: authFile(account) });
	});
}