07bbdddbee
- Add @playwright/test and playwright as devDependencies - Add e2e and e2e:headed scripts - Add playwright.config.ts - Add basic e2e test and auth.setup.ts This fixes the E2E workflow which was failing at the Playwright install step because the project lacked Playwright dependencies. Co-Authored-By: Paperclip <noreply@paperclip.ing>
16 lines
430 B
TypeScript
16 lines
430 B
TypeScript
import { test as setup } from '@playwright/test';
|
|
import { request } from '@playwright/test';
|
|
|
|
setup('authenticate', async ({ page }) => {
|
|
const token = process.env.HEADLAMP_TOKEN;
|
|
const url = process.env.HEADLAMP_URL;
|
|
|
|
if (!token || !url) {
|
|
throw new Error('HEADLAMP_TOKEN and HEADLAMP_URL must be set');
|
|
}
|
|
|
|
await page.goto(url);
|
|
await page.evaluate((t) => {
|
|
localStorage.setItem('token', t);
|
|
}, token);
|
|
}); |