Compare commits

...

3 Commits

Author SHA1 Message Date
Aswin V 59a5572c07 Refactor 2024-05-02 12:18:52 +05:30
Aswin V 495b0f3c7b Merge branch 'main' into 2600-extend-e2e 2024-05-02 11:22:06 +05:30
Deepak Prabhakara 5000983a36 Release 1.23.6 2024-04-30 22:32:49 +01:00
4 changed files with 35 additions and 33 deletions

View File

@ -0,0 +1,32 @@
import { test as baseTest, expect } from '@playwright/test';
import { SSOPage } from 'e2e/support/fixtures';
type MyFixtures = {
ssoPage: SSOPage;
};
export const test = baseTest.extend<MyFixtures>({
ssoPage: 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 + wrong redirectUrl', async ({ ssoPage, page, baseURL }, testInfo) => {
// check if the first added connection appears in the connection list
await expect(page.getByText(`saml-${testInfo.workerIndex}-1`)).toBeVisible();
await ssoPage.updateSSOConnection({
name: `saml-${testInfo.workerIndex}-1`,
url: 'https://invalid-url.com',
});
// Logout of magic link login
await ssoPage.logout();
await ssoPage.signInWithSSO();
// 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();
});

View File

@ -4,7 +4,6 @@ import { Portal, SSOPage } from 'e2e/support/fixtures';
type MyFixtures = {
ssoPage: SSOPage;
portal: Portal;
ssoPageWithoutDelete: SSOPage;
};
export const test = baseTest.extend<MyFixtures>({
@ -20,13 +19,6 @@ export const test = baseTest.extend<MyFixtures>({
const portal = new Portal(page);
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) => {
@ -43,28 +35,6 @@ test('OAuth2 wrapper + SAML provider', async ({ ssoPage, portal, page, baseURL }
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) => {
const ssoName = `saml-${testInfo.workerIndex}`;
// check if the first added connection appears in the connection list

4
package-lock.json generated
View File

@ -1,12 +1,12 @@
{
"name": "jackson",
"version": "1.23.5",
"version": "1.23.6",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "jackson",
"version": "1.23.5",
"version": "1.23.6",
"hasInstallScript": true,
"license": "Apache-2.0",
"dependencies": {

View File

@ -1,6 +1,6 @@
{
"name": "jackson",
"version": "1.23.5",
"version": "1.23.6",
"private": true,
"description": "SAML 2.0 service",
"keywords": [