test) fixing tests
All checks were successful
PR Checks / lint-test-and-docker-build (pull_request) Successful in 2m15s
All checks were successful
PR Checks / lint-test-and-docker-build (pull_request) Successful in 2m15s
This commit is contained in:
@@ -13,15 +13,6 @@ async function loginAsLocalUser(page: Page, username: string, password: string):
|
||||
await page.waitForURL(`**${DASHBOARD_URL}`, { timeout: 15_000 });
|
||||
}
|
||||
|
||||
async function clearSessionState(page: Page): Promise<void> {
|
||||
await page.context().clearCookies();
|
||||
await page.goto('about:blank');
|
||||
await page.evaluate(() => {
|
||||
localStorage.clear();
|
||||
sessionStorage.clear();
|
||||
});
|
||||
}
|
||||
|
||||
test.beforeEach(async ({ context }) => {
|
||||
await context.clearCookies();
|
||||
});
|
||||
@@ -47,9 +38,9 @@ test('admin can create a local user who can sign in', async ({ page }) => {
|
||||
await addDialog.locator('input[type="password"]').nth(1).fill(password);
|
||||
await addDialog.getByRole('button', { name: 'Create user' }).click();
|
||||
|
||||
await expect(page.getByRole('cell', { name: username })).toBeVisible();
|
||||
await expect(page.getByRole('cell', { name: username, exact: true })).toBeVisible();
|
||||
|
||||
await clearSessionState(page);
|
||||
await page.context().clearCookies();
|
||||
await loginAsLocalUser(page, username, password);
|
||||
await expect(page).toHaveURL(/\/trips\/dashboard/);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user