Skip to content

Commit 72b3ce5

Browse files
committed
chore: add-logout-to-test
1 parent 632d6c5 commit 72b3ce5

File tree

4 files changed

+21
-4
lines changed

4 files changed

+21
-4
lines changed

.github/workflows/ci.yml

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
name: ForgeRock Pull Request CI
22
on:
3-
pull_request_target:
43
pull_request:
54

65
env:

.husky/install.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ if (process.env.NODE_ENV === 'production' || process.env.CI === 'true') {
33
process.exit(0)
44
}
55
const husky = (await import('husky')).default
6-
console.log(husky())
6+
console.log(husky.install())

e2e/davinci-app/main.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ const config = {
3232
clientId,
3333
redirectUri: `${window.location.origin}/`,
3434
scope: 'openid profile email name revoke',
35+
timeout: 3000,
3536
serverConfig: {
3637
wellknown:
3738
'https://auth.pingone.ca/02fb4743-189a-4bc7-9d6c-a919edfe6447/as/.well-known/openid-configuration',
@@ -96,9 +97,9 @@ const config = {
9697

9798
const loginBtn = document.getElementById('logoutButton') as HTMLButtonElement;
9899
loginBtn.addEventListener('click', async () => {
99-
await FRUser.logout({ logoutRedirectUri: window.location.origin });
100+
await FRUser.logout({ logoutRedirectUri: `${window.location.origin}/` });
100101

101-
window.location.reload();
102+
//window.location.reload();
102103
});
103104
}
104105

e2e/davinci-suites/src/basic.test.ts

+17
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,23 @@ test('Test happy paths on test page', async ({ page }) => {
2525

2626
const accessToken = await page.locator('#accessTokenValue').innerText();
2727
await expect(accessToken).toBeTruthy();
28+
29+
const logoutButton = page.getByRole('button', { name: 'Logout' });
30+
await expect(logoutButton).toBeVisible();
31+
const revokeCall = page.waitForResponse((response) => {
32+
if (response.url().includes('/revoke') && response.status() === 200) {
33+
return true;
34+
}
35+
});
36+
const signoff = page.waitForResponse((response) => {
37+
if (response.url().includes('/signoff') && response.status() === 302) {
38+
return true;
39+
}
40+
});
41+
await logoutButton.click();
42+
await revokeCall;
43+
await signoff;
44+
await expect(page.getByText('Username/Password Form')).toBeVisible();
2845
});
2946
test('ensure query params passed to start are sent off in authorize call', async ({ page }) => {
3047
const { navigate } = asyncEvents(page);

0 commit comments

Comments
 (0)