test: reorganise tests/ui/ into feature subdirectories

This commit is contained in:
2026-06-21 16:22:17 +02:00
parent fec536ef16
commit 2ab0b13eb6
13 changed files with 2 additions and 2 deletions
+22
View File
@@ -0,0 +1,22 @@
// @ts-check
const { test: setup } = require('@playwright/test');
const path = require('path');
const fs = require('fs');
const USER = process.env.GRAV_TEST_USER;
const PASS = process.env.GRAV_TEST_PASS;
const AUTH_FILE = path.join(__dirname, '../.auth/user.json');
setup('authenticate', async ({ page }) => {
if (!USER || !PASS) throw new Error('GRAV_TEST_USER and GRAV_TEST_PASS must be set in .env');
fs.mkdirSync(path.dirname(AUTH_FILE), { recursive: true });
await page.goto('/login');
await page.fill('input[name="username"]', USER);
await page.fill('input[name="password"]', PASS);
await page.click('button[type="submit"]');
await page.waitForSelector('text=successfully logged in', { timeout: 10_000 });
await page.context().storageState({ path: AUTH_FILE });
});