-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Michael Telatynski <[email protected]>
- Loading branch information
Showing
14 changed files
with
167 additions
and
75 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 |
---|---|---|
|
@@ -24,18 +24,23 @@ test.describe("OIDC Native", { tag: ["@no-firefox", "@no-webkit"] }, () => { | |
mailhogClient, | ||
mas, | ||
}, testInfo) => { | ||
await page.clock.install(); | ||
|
||
const tokenUri = `${mas.baseUrl}/oauth2/token`; | ||
const tokenApiPromise = page.waitForRequest( | ||
(request) => request.url() === tokenUri && request.postDataJSON()["grant_type"] === "authorization_code", | ||
); | ||
|
||
await page.goto("/#/login"); | ||
await page.getByRole("button", { name: "Continue" }).click(); | ||
await registerAccountMas(page, mailhogClient, `alice_${testInfo.testId}`, "[email protected]", "Pa$sW0rD!"); | ||
|
||
const userId = `alice_${testInfo.testId}`; | ||
await registerAccountMas(page, mailhogClient, userId, "[email protected]", "Pa$sW0rD!"); | ||
|
||
// Eventually, we should end up at the home screen. | ||
await expect(page).toHaveURL(/\/#\/home$/, { timeout: 10000 }); | ||
await expect(page.getByRole("heading", { name: "Welcome alice", exact: true })).toBeVisible(); | ||
await expect(page.getByRole("heading", { name: `Welcome ${userId}`, exact: true })).toBeVisible(); | ||
await page.clock.runFor(20000); // run the timer so we see the token request | ||
|
||
const tokenApiRequest = await tokenApiPromise; | ||
expect(tokenApiRequest.postDataJSON()["grant_type"]).toBe("authorization_code"); | ||
|
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
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
Oops, something went wrong.