mirror of https://github.com/boxyhq/jackson.git
Test case for wrong redirect url
This commit is contained in:
parent
279563bf16
commit
04731b2c66
|
@ -4,6 +4,7 @@ import { Portal, SSOPage } from 'e2e/support/fixtures';
|
||||||
type MyFixtures = {
|
type MyFixtures = {
|
||||||
ssoPage: SSOPage;
|
ssoPage: SSOPage;
|
||||||
portal: Portal;
|
portal: Portal;
|
||||||
|
ssoPageWithoutDelete: SSOPage;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const test = baseTest.extend<MyFixtures>({
|
export const test = baseTest.extend<MyFixtures>({
|
||||||
|
@ -19,6 +20,13 @@ export const test = baseTest.extend<MyFixtures>({
|
||||||
const portal = new Portal(page);
|
const portal = new Portal(page);
|
||||||
await use(portal);
|
await use(portal);
|
||||||
},
|
},
|
||||||
|
ssoPageWithoutDelete: async ({ page, baseURL }, use, testInfo) => {
|
||||||
|
const ssoPage = new SSOPage(page);
|
||||||
|
const ssoName = `saml-${testInfo.workerIndex}`;
|
||||||
|
await ssoPage.goto();
|
||||||
|
await ssoPage.addSSOConnection({ name: ssoName, type: 'saml', baseURL: baseURL! });
|
||||||
|
await use(ssoPage);
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
test('OAuth2 wrapper + SAML provider', async ({ ssoPage, portal, page, baseURL }, testInfo) => {
|
test('OAuth2 wrapper + SAML provider', async ({ ssoPage, portal, page, baseURL }, testInfo) => {
|
||||||
|
@ -35,6 +43,28 @@ test('OAuth2 wrapper + SAML provider', async ({ ssoPage, portal, page, baseURL }
|
||||||
await portal.isLoggedIn();
|
await portal.isLoggedIn();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('OAuth2 wrapper + SAML provider + wrong redirectUrl', async ({
|
||||||
|
ssoPageWithoutDelete,
|
||||||
|
page,
|
||||||
|
baseURL,
|
||||||
|
}, testInfo) => {
|
||||||
|
// check if the first added connection appears in the connection list
|
||||||
|
await expect(page.getByText(`saml-${testInfo.workerIndex}-1`)).toBeVisible();
|
||||||
|
await ssoPageWithoutDelete.updateSSOConnection({
|
||||||
|
name: `saml-${testInfo.workerIndex}-1`,
|
||||||
|
url: 'https://invalid-url.com',
|
||||||
|
});
|
||||||
|
// Logout of magic link login
|
||||||
|
await ssoPageWithoutDelete.logout();
|
||||||
|
await ssoPageWithoutDelete.signInWithSSO();
|
||||||
|
// // Login using MockSAML
|
||||||
|
// await ssoPage.signInWithMockSAML();
|
||||||
|
// Wait for browser to redirect to error page
|
||||||
|
await page.waitForURL((url) => url.origin === baseURL && url.pathname === '/error');
|
||||||
|
// Assert error text
|
||||||
|
await expect(page.getByText(`SSO error: Redirect URL is not allowed.`)).toBeVisible();
|
||||||
|
});
|
||||||
|
|
||||||
test('OAuth2 wrapper + 2 SAML providers', async ({ ssoPage, portal, page, baseURL }, testInfo) => {
|
test('OAuth2 wrapper + 2 SAML providers', async ({ ssoPage, portal, page, baseURL }, testInfo) => {
|
||||||
const ssoName = `saml-${testInfo.workerIndex}`;
|
const ssoName = `saml-${testInfo.workerIndex}`;
|
||||||
// check if the first added connection appears in the connection list
|
// check if the first added connection appears in the connection list
|
||||||
|
|
Loading…
Reference in New Issue