* web: Add InvalidationFlow to Radius Provider dialogues
## What
- Bugfix: adds the InvalidationFlow to the Radius Provider dialogues
- Repairs: `{"invalidation_flow":["This field is required."]}` message, which was *not* propagated
to the Notification.
- Nitpick: Pretties `?foo=${true}` expressions: `s/\?([^=]+)=\$\{true\}/\1/`
## Note
Yes, I know I'm going to have to do more magic when we harmonize the forms, and no, I didn't add the
Property Mappings to the wizard, and yes, I know I'm going to have pain with the *new* version of
the wizard. But this is a serious bug; you can't make Radius servers with *either* of the current
dialogues at the moment.
* web: fix selector warnings in WebdriverIO
Despite the [promises made](https://webdriver.io/docs/selectors#deep-selectors) by the WebdriverIO
team, we are still getting a lot of warnings and "falling back to pre-BIDI behavior" messages
when we attempt to access ShadowDOM contexts without the "pierce" (`>>>`) syntax. So I've put
it back wherever it occurred and the system now uses the BIDI controllers correctly.
* web: update to Chromedriver 131 breaks a lot of stuff
This annoying bit of janitorial work cleans up the failure messages and resolution bugs
that arose when updating to the latest version of Chrome. Keeping track of all the
weakness and breakage while the in-browser testing teams figure out how to live with
the ShadowDOM is just really time-consuming.
175 lines
7.7 KiB
TypeScript
175 lines
7.7 KiB
TypeScript
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
// @ts-nocheck
|
|
// ^^^^^^^^^^^ Because TSC cannot handle metaprogramming, and metaprogramming
|
|
// via `defineProperties` is how we installed the OUID finders for the various
|
|
// wizard types.
|
|
import { expect } from "@wdio/globals";
|
|
|
|
import ApplicationWizardView from "../pageobjects/application-wizard.page.js";
|
|
import ApplicationsListPage from "../pageobjects/applications-list.page.js";
|
|
import { randomId } from "../utils/index.js";
|
|
import { login } from "../utils/login.js";
|
|
|
|
async function reachTheProvider(title: string) {
|
|
const newPrefix = randomId();
|
|
|
|
await ApplicationsListPage.logout();
|
|
await login();
|
|
await ApplicationsListPage.open();
|
|
await ApplicationsListPage.pause();
|
|
await expect(await ApplicationsListPage.pageHeader()).toBeDisplayed();
|
|
await expect(await ApplicationsListPage.pageHeader()).toHaveText("Applications");
|
|
|
|
await (await ApplicationsListPage.startWizardButton()).click();
|
|
await (await ApplicationWizardView.wizardTitle()).waitForDisplayed();
|
|
await expect(await ApplicationWizardView.wizardTitle()).toHaveText("New application");
|
|
|
|
await (await ApplicationWizardView.app.name()).setValue(`${title} - ${newPrefix}`);
|
|
await (await ApplicationWizardView.app.uiSettings()).scrollIntoView();
|
|
await (await ApplicationWizardView.app.uiSettings()).click();
|
|
await (await ApplicationWizardView.app.launchUrl()).scrollIntoView();
|
|
await (await ApplicationWizardView.app.launchUrl()).setValue("http://example.goauthentik.io");
|
|
|
|
await (await ApplicationWizardView.nextButton()).click();
|
|
return await ApplicationWizardView.pause();
|
|
}
|
|
|
|
async function getCommitMessage() {
|
|
await (await ApplicationWizardView.successMessage()).waitForDisplayed();
|
|
return await ApplicationWizardView.successMessage();
|
|
}
|
|
|
|
const SUCCESS_MESSAGE = "Your application has been saved";
|
|
const EXPLICIT_CONSENT = "default-provider-authorization-explicit-consent";
|
|
|
|
describe("Configure Applications with the Application Wizard", () => {
|
|
it("Should configure a simple LDAP Application", async () => {
|
|
await reachTheProvider("New LDAP Application");
|
|
|
|
await (await ApplicationWizardView.providerList()).waitForDisplayed();
|
|
await (await ApplicationWizardView.ldapProvider).scrollIntoView();
|
|
await (await ApplicationWizardView.ldapProvider).click();
|
|
await (await ApplicationWizardView.nextButton()).click();
|
|
await ApplicationWizardView.pause();
|
|
|
|
await ApplicationWizardView.ldap.setBindFlow("default-authentication-flow");
|
|
await (await ApplicationWizardView.nextButton()).click();
|
|
await ApplicationWizardView.pause();
|
|
|
|
await expect(await getCommitMessage()).toHaveText(SUCCESS_MESSAGE);
|
|
});
|
|
|
|
it("Should configure a simple Oauth2 Application", async () => {
|
|
await reachTheProvider("New Oauth2 Application");
|
|
|
|
await (await ApplicationWizardView.providerList()).waitForDisplayed();
|
|
await (await ApplicationWizardView.oauth2Provider).scrollIntoView();
|
|
await (await ApplicationWizardView.oauth2Provider).click();
|
|
|
|
await (await ApplicationWizardView.nextButton()).click();
|
|
await ApplicationWizardView.pause();
|
|
|
|
await ApplicationWizardView.oauth.setAuthorizationFlow(EXPLICIT_CONSENT);
|
|
await (await ApplicationWizardView.nextButton()).click();
|
|
await ApplicationWizardView.pause();
|
|
|
|
await expect(await getCommitMessage()).toHaveText(SUCCESS_MESSAGE);
|
|
});
|
|
|
|
it("Should configure a simple SAML Application", async () => {
|
|
await reachTheProvider("New SAML Application");
|
|
|
|
await (await ApplicationWizardView.providerList()).waitForDisplayed();
|
|
await (await ApplicationWizardView.samlProvider).scrollIntoView();
|
|
await (await ApplicationWizardView.samlProvider).click();
|
|
|
|
await (await ApplicationWizardView.nextButton()).click();
|
|
await ApplicationWizardView.pause();
|
|
|
|
await ApplicationWizardView.saml.setAuthorizationFlow(EXPLICIT_CONSENT);
|
|
await ApplicationWizardView.saml.acsUrl.setValue("http://example.com:8000/");
|
|
await (await ApplicationWizardView.nextButton()).click();
|
|
await ApplicationWizardView.pause();
|
|
|
|
await expect(await getCommitMessage()).toHaveText(SUCCESS_MESSAGE);
|
|
});
|
|
|
|
it("Should configure a simple SCIM Application", async () => {
|
|
await reachTheProvider("New SCIM Application");
|
|
|
|
await (await ApplicationWizardView.providerList()).waitForDisplayed();
|
|
await (await ApplicationWizardView.scimProvider).scrollIntoView();
|
|
await (await ApplicationWizardView.scimProvider).click();
|
|
|
|
await (await ApplicationWizardView.nextButton()).click();
|
|
await ApplicationWizardView.pause();
|
|
|
|
await ApplicationWizardView.scim.url.setValue("http://example.com:8000/");
|
|
await ApplicationWizardView.scim.token.setValue("a-very-basic-token");
|
|
await (await ApplicationWizardView.nextButton()).click();
|
|
await ApplicationWizardView.pause();
|
|
|
|
await expect(await getCommitMessage()).toHaveText(SUCCESS_MESSAGE);
|
|
});
|
|
|
|
it("Should configure a simple Radius Application", async () => {
|
|
await reachTheProvider("New Radius Application");
|
|
|
|
await (await ApplicationWizardView.providerList()).waitForDisplayed();
|
|
await (await ApplicationWizardView.radiusProvider).scrollIntoView();
|
|
await (await ApplicationWizardView.radiusProvider).click();
|
|
|
|
await (await ApplicationWizardView.nextButton()).click();
|
|
await ApplicationWizardView.pause();
|
|
|
|
await ApplicationWizardView.radius.setAuthenticationFlow("default-authentication-flow");
|
|
await (await ApplicationWizardView.nextButton()).click();
|
|
await ApplicationWizardView.pause();
|
|
|
|
await expect(await getCommitMessage()).toHaveText(SUCCESS_MESSAGE);
|
|
});
|
|
|
|
it("Should configure a simple Transparent Proxy Application", async () => {
|
|
await reachTheProvider("New Transparent Proxy Application");
|
|
|
|
await (await ApplicationWizardView.providerList()).waitForDisplayed();
|
|
await (await ApplicationWizardView.proxyProviderProxy).scrollIntoView();
|
|
await (await ApplicationWizardView.proxyProviderProxy).click();
|
|
await (await ApplicationWizardView.nextButton()).click();
|
|
await ApplicationWizardView.pause();
|
|
|
|
await ApplicationWizardView.transparentProxy.setAuthorizationFlow(EXPLICIT_CONSENT);
|
|
await ApplicationWizardView.transparentProxy.externalHost.setValue(
|
|
"http://external.example.com",
|
|
);
|
|
await ApplicationWizardView.transparentProxy.internalHost.setValue(
|
|
"http://internal.example.com",
|
|
);
|
|
|
|
await (await ApplicationWizardView.nextButton()).click();
|
|
await ApplicationWizardView.pause();
|
|
|
|
await expect(await getCommitMessage()).toHaveText(SUCCESS_MESSAGE);
|
|
});
|
|
|
|
it("Should configure a simple Forward Proxy Application", async () => {
|
|
await reachTheProvider("New Forward Proxy Application");
|
|
|
|
await (await ApplicationWizardView.providerList()).waitForDisplayed();
|
|
await (await ApplicationWizardView.proxyProviderForwardsingle).scrollIntoView();
|
|
await (await ApplicationWizardView.proxyProviderForwardsingle).click();
|
|
await (await ApplicationWizardView.nextButton()).click();
|
|
await ApplicationWizardView.pause();
|
|
|
|
await ApplicationWizardView.forwardProxy.setAuthorizationFlow(EXPLICIT_CONSENT);
|
|
await ApplicationWizardView.forwardProxy.externalHost.setValue(
|
|
"http://external.example.com",
|
|
);
|
|
|
|
await (await ApplicationWizardView.nextButton()).click();
|
|
await ApplicationWizardView.pause();
|
|
|
|
await expect(await getCommitMessage()).toHaveText(SUCCESS_MESSAGE);
|
|
});
|
|
});
|