Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 20 additions & 9 deletions js/apps/admin-ui/cypress/support/pages/admin-ui/Masthead.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,16 +94,27 @@ export default class Masthead extends CommonElements {
cy.get("#manage-account").click();
}

checkNotificationMessage(message: string, closeNotification = true) {
this.#getAlertsContainer()
.find(this.#alertMessage)
.should("contain.text", message);

if (closeNotification) {
checkNotificationMessage(message: string | RegExp, closeNotification = true) {
if (typeof message === "string") {
this.#getAlertsContainer()
.find(this.#alertMessage)
.should("contain.text", message);

if (closeNotification) {
this.#getAlertsContainer()
.find(`button[title="` + message.replaceAll('"', '\\"') + `"]`)
.last()
.click({ force: true });
}
} else {
this.#getAlertsContainer()
.find(`button[title="` + message.replaceAll('"', '\\"') + `"]`)
.last()
.click({ force: true });
.find(this.#alertMessage)
.invoke("text")
.should("match", message);

if (closeNotification) {
this.#getAlertsContainer().find("button").last().click({ force: true });

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like it might close an unrelated alert, but probably fine,

}
}
return this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ export default class SettingsTab extends PageObject {

public assertAccessSettings() {
const redirectUriError =
"Client could not be updated: A redirect URI is not a valid URI";
/Client could not be updated:.*(Master SAML Processing URL is not a valid URL|A redirect URI is not a valid URI).*/i;

cy.findByTestId(this.#idpInitiatedSsoUrlName).click().type("a");
cy.findByTestId(this.#idpInitiatedSsoRelayState).click().type("b");
Expand Down