fix: align deploy-e2e-headlamp.sh to argocd plugin #37

Closed
privilegedescalation-engineer[bot] wants to merge 9 commits from hugh/argocd-e2e-final into main
Showing only changes of commit 2df7bcd57e - Show all commits
+9 -6
View File
@@ -1,5 +1,4 @@
import { test as setup } from '@playwright/test'; import { test as setup, request } from '@playwright/test';
import { request } from '@playwright/test';
setup('authenticate', async ({ page }) => { setup('authenticate', async ({ page }) => {
const token = process.env.HEADLAMP_TOKEN; const token = process.env.HEADLAMP_TOKEN;
@@ -9,8 +8,12 @@ setup('authenticate', async ({ page }) => {
throw new Error('HEADLAMP_TOKEN and HEADLAMP_URL must be set'); throw new Error('HEADLAMP_TOKEN and HEADLAMP_URL must be set');
} }
await page.goto(url); await page.context().addInitScript(() => {
await page.evaluate((t) => { window.localStorage.setItem('token', 'dummy-token');
localStorage.setItem('token', t); });
}, token);
await page.goto(url);
const context = page.context();
await context.storageState({ path: 'e2e/.auth/state.json' });
}); });