We will cache the login token in the browser storage and reuse it between tests. This will speed up the tests and reduce the load on the server.
20 lines
528 B
TypeScript
20 lines
528 B
TypeScript
import { test as setup } from '@playwright/test';
|
|
|
|
import { keyCloakSignIn } from './common';
|
|
|
|
setup('authenticate-chromium', async ({ page }) => {
|
|
await page.goto('/');
|
|
await keyCloakSignIn(page, 'chromium');
|
|
await page
|
|
.context()
|
|
.storageState({ path: `playwright/.auth/user-chromium.json` });
|
|
});
|
|
|
|
setup('authenticate-webkit', async ({ page }) => {
|
|
await page.goto('/');
|
|
await keyCloakSignIn(page, 'webkit');
|
|
await page
|
|
.context()
|
|
.storageState({ path: `playwright/.auth/user-webkit.json` });
|
|
});
|