test: saml - metadata load

This commit is contained in:
Pranav C
2025-04-24 23:09:09 +00:00
parent de3997aa7d
commit 2923e87236

View File

@@ -1,6 +1,6 @@
import BasePage from '../Base';
import { ProjectsPage } from '../ProjectsPage';
import { expect } from '@playwright/test';
import { expect, request } from '@playwright/test';
import { Domain } from './Domain';
import { OrgAdminPage } from './index';
@@ -105,7 +105,17 @@ export class CloudSSO extends BasePage {
await samlModal.locator('[data-test-id="nc-saml-title"]').fill(p.title);
if (p.url) {
await samlModal.locator('[data-test-id="nc-saml-metadata-url"]').fill(p.url);
// await samlModal.locator('[data-test-id="nc-saml-metadata-url"]').fill(p.url);
// if url then extract the xml data and fill it, since local urls are not supported
const requestContext = await request.newContext();
const response = await requestContext.get(p.url);
const text = await response.text(); // extract as plain text
p.xml = text;
await requestContext.dispose();
}
if (p.xml) {
await samlModal.locator('[data-test-id="nc-saml-xml"]').fill(p.xml);