Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0d7fcf7
commit 0d82561
Showing
6 changed files
with
97 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { expect, test } from "./test"; | ||
|
||
test.describe("User authentication", () => { | ||
test.beforeEach(async ({ bookPage }) => { | ||
await bookPage.gotoList(); | ||
}); | ||
|
||
test("I can sign out of Admin @login", async ({ userPage, page }) => { | ||
await page.getByLabel("Profile").click(); | ||
await page.getByRole("menu").getByText("Logout").waitFor({ state: "visible" }); | ||
await page.getByRole("menu").getByText("Logout").click(); | ||
|
||
await expect(page).toHaveURL(/\/$/); | ||
|
||
// I should be logged out from Keycloak also | ||
await page.goto("/admin"); | ||
await page.waitForURL(/\/oidc\/realms\/demo\/protocol\/openid-connect\/auth/); | ||
// @ts-ignore assert declared on test.ts | ||
await expect(page).toBeOnLoginPage(); | ||
await expect(page.locator("#kc-header-wrapper")).toContainText("API Platform - Demo"); | ||
await expect(page.locator("#kc-form-login")).toContainText("Login as user: john.doe@example.com"); | ||
await expect(page.locator("#kc-form-login")).toContainText("Login as admin: chuck.norris@example.com"); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import { AbstractPage } from "./AbstractPage"; | ||
|
||
export class UserPage extends AbstractPage { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters