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
+8 -5
View File
@@ -1,5 +1,4 @@
import { test as setup } from '@playwright/test';
import { request } from '@playwright/test';
import { test as setup, request } from '@playwright/test';
setup('authenticate', async ({ page }) => {
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');
}
await page.context().addInitScript(() => {
window.localStorage.setItem('token', 'dummy-token');
});
await page.goto(url);
await page.evaluate((t) => {
localStorage.setItem('token', t);
}, token);
const context = page.context();
await context.storageState({ path: 'e2e/.auth/state.json' });
});