Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions e2e/tests/keycloak/tests.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,10 +213,10 @@ http:

expect(response.status()).toBe(200);

const authHeaderExists = await page.locator(`text=Authorization: Bearer: ey`).isVisible();
const authHeaderExists = await page.getByText("Authorization: Bearer: ey").isVisible();
expect(authHeaderExists).toBeTruthy();

const staticHeaderExists = await page.locator(`text=X-Static-Header: 42`).isVisible();
const staticHeaderExists = await page.getByText("X-Static-Header: 42").isVisible();
expect(staticHeaderExists).toBeTruthy();

// Authorization cookie should not be present in the rendered contents
Expand Down Expand Up @@ -760,12 +760,12 @@ http:
//-----------------------------------------------------------------------------

async function login(page: Page, username: string, password: string, waitForUrl: string): Promise<Response> {
await page.locator("#username").fill(username);
await page.locator("#password").fill(password);
await page.getByRole("textbox", { name: 'Username or email' }).fill(username);
await page.getByRole("textbox", { name: "Password" }).fill(password);

const responsePromise = page.waitForResponse(waitForUrl);

await page.locator('#kc-login').click();
await page.getByRole("button", { name: "Sign In" }).click();

const response = await responsePromise;

Expand Down
3 changes: 2 additions & 1 deletion e2e/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export async function configureTraefik(yaml: string) {
fs.writeFileSync(filePath, yaml);

// Wait some time for traefik to reload the config
await new Promise(r => setTimeout(r, 2000));
// Note: Traefik has a throttle duration of 2s.
await new Promise(r => setTimeout(r, 2500));
}
}