Relax checking of messages
Related to: #28873 Fixes: #28911 Signed-off-by: Hynek Mlnarik <hmlnarik@redhat.com>
This commit is contained in:
parent
2b8c895f71
commit
4f30400e07
2 changed files with 21 additions and 10 deletions
|
@ -94,16 +94,27 @@ export default class Masthead extends CommonElements {
|
||||||
cy.get("#manage-account").click();
|
cy.get("#manage-account").click();
|
||||||
}
|
}
|
||||||
|
|
||||||
checkNotificationMessage(message: string, closeNotification = true) {
|
checkNotificationMessage(message: string | RegExp, closeNotification = true) {
|
||||||
this.#getAlertsContainer()
|
if (typeof message === "string") {
|
||||||
.find(this.#alertMessage)
|
|
||||||
.should("contain.text", message);
|
|
||||||
|
|
||||||
if (closeNotification) {
|
|
||||||
this.#getAlertsContainer()
|
this.#getAlertsContainer()
|
||||||
.find(`button[title="` + message.replaceAll('"', '\\"') + `"]`)
|
.find(this.#alertMessage)
|
||||||
.last()
|
.should("contain.text", message);
|
||||||
.click({ force: true });
|
|
||||||
|
if (closeNotification) {
|
||||||
|
this.#getAlertsContainer()
|
||||||
|
.find(`button[title="` + message.replaceAll('"', '\\"') + `"]`)
|
||||||
|
.last()
|
||||||
|
.click({ force: true });
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.#getAlertsContainer()
|
||||||
|
.find(this.#alertMessage)
|
||||||
|
.invoke("text")
|
||||||
|
.should("match", message);
|
||||||
|
|
||||||
|
if (closeNotification) {
|
||||||
|
this.#getAlertsContainer().find("button").last().click({ force: true });
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
|
@ -223,7 +223,7 @@ export default class SettingsTab extends PageObject {
|
||||||
|
|
||||||
public assertAccessSettings() {
|
public assertAccessSettings() {
|
||||||
const redirectUriError =
|
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.#idpInitiatedSsoUrlName).click().type("a");
|
||||||
cy.findByTestId(this.#idpInitiatedSsoRelayState).click().type("b");
|
cy.findByTestId(this.#idpInitiatedSsoRelayState).click().type("b");
|
||||||
|
|
Loading…
Reference in a new issue