test: initial end to end test with playwright

This commit is contained in:
Edouard Vanbelle
2026-05-04 15:28:44 +02:00
parent 52f4a865a9
commit 3c3d24ac72
28 changed files with 494 additions and 0 deletions
+18
View File
@@ -0,0 +1,18 @@
import { TEST_ADMIN } from './scenarios/helpers';
export default async function globalSetup() {
const res = await fetch('http://localhost:8087/api/setup', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
username: TEST_ADMIN.username,
email: TEST_ADMIN.email,
password: TEST_ADMIN.password,
}),
});
// 409 = admin already exists (idempotent across retries)
if (!res.ok && res.status !== 409) {
throw new Error(`Admin setup failed: ${res.status} ${await res.text()}`);
}
}