⚡️(e2e) unique login between tests
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.
This commit is contained in:
@@ -2,9 +2,8 @@ import { expect, test } from '@playwright/test';
|
||||
|
||||
import { keyCloakSignIn } from './common';
|
||||
|
||||
test.beforeEach(async ({ page, browserName }) => {
|
||||
test.beforeEach(async ({ page }) => {
|
||||
await page.goto('/');
|
||||
await keyCloakSignIn(page, browserName);
|
||||
});
|
||||
|
||||
test.describe('Header', () => {
|
||||
@@ -64,8 +63,15 @@ test.describe('Header', () => {
|
||||
|
||||
await expect(page.getByRole('link', { name: 'Grist' })).toBeVisible();
|
||||
});
|
||||
});
|
||||
|
||||
test.describe('Header: Log out', () => {
|
||||
test.use({ storageState: { cookies: [], origins: [] } });
|
||||
|
||||
test('checks logout button', async ({ page, browserName }) => {
|
||||
await page.goto('/');
|
||||
await keyCloakSignIn(page, browserName);
|
||||
|
||||
test('checks logout button', async ({ page }) => {
|
||||
await page
|
||||
.getByRole('button', {
|
||||
name: 'My account',
|
||||
|
||||
Reference in New Issue
Block a user