Fixed broken tests (#2225)

This commit is contained in:
Erik Jan de Wit 2022-03-15 10:45:02 +01:00 committed by GitHub
parent ceffcba321
commit 3a1cd3e5b3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 26 additions and 17 deletions

View file

@ -38,7 +38,7 @@ describe("Client authentication subtab", () => {
it("Should update the resource server settings", () => {
authenticationTab.setPolicy("DISABLED").saveSettings();
masthead.checkNotificationMessage("Resource successfully updated");
masthead.checkNotificationMessage("Resource successfully updated", true);
});
it("Should create a resource", () => {
@ -55,7 +55,7 @@ describe("Client authentication subtab", () => {
})
.save();
masthead.checkNotificationMessage("Resource created successfully");
masthead.checkNotificationMessage("Resource created successfully", true);
authenticationTab.cancel();
});
@ -71,13 +71,14 @@ describe("Client authentication subtab", () => {
.save();
masthead.checkNotificationMessage(
"Authorization scope created successfully"
"Authorization scope created successfully",
true
);
authenticationTab.goToScopeSubTab();
listingPage.itemExist("The scope");
});
it.skip("Should create a policy", () => {
it("Should create a policy", () => {
authenticationTab.goToPolicySubTab();
cy.intercept(
"GET",
@ -94,19 +95,19 @@ describe("Client authentication subtab", () => {
.save();
cy.wait(["@get"]);
masthead.checkNotificationMessage("Successfully created the policy");
masthead.checkNotificationMessage("Successfully created the policy", true);
authenticationTab.cancel();
});
it.skip("Should delete a policy", () => {
it("Should delete a policy", () => {
authenticationTab.goToPolicySubTab();
listingPage.deleteItem("Regex policy");
new ModalUtils().confirmModal();
masthead.checkNotificationMessage("The Policy successfully deleted");
masthead.checkNotificationMessage("The Policy successfully deleted", true);
});
it.skip("Should create a client policy", () => {
it("Should create a client policy", () => {
authenticationTab.goToPolicySubTab();
cy.intercept(
"GET",
@ -122,11 +123,11 @@ describe("Client authentication subtab", () => {
.save();
cy.wait(["@get"]);
masthead.checkNotificationMessage("Successfully created the policy");
masthead.checkNotificationMessage("Successfully created the policy", true);
authenticationTab.cancel();
});
it.skip("Should create a permission", () => {
it("Should create a permission", () => {
authenticationTab.goToPermissionsSubTab();
authenticationTab
.goToCreatePermission("resource")
@ -134,26 +135,34 @@ describe("Client authentication subtab", () => {
name: "Permission name",
description: "Something describing this permission",
})
.selectResource("Resource")
.selectResource("Default Resource")
.save();
masthead.checkNotificationMessage("Successfully created the permission");
cy.intercept(
"/admin/realms/master/clients/*/authz/resource-server/resource?first=0&max=10"
).as("load");
masthead.checkNotificationMessage(
"Successfully created the permission",
true
);
cy.wait(["@load"]);
authenticationTab.cancel();
});
it.skip("Should copy auth details", () => {
it("Should copy auth details", () => {
authenticationTab.goToExportSubTab();
authenticationTab.copy();
masthead.checkNotificationMessage("Authorization details copied.");
masthead.checkNotificationMessage("Authorization details copied.", true);
});
it.skip("Should export auth details", () => {
it("Should export auth details", () => {
authenticationTab.goToExportSubTab();
authenticationTab.export();
masthead.checkNotificationMessage(
"Successfully exported authorization details."
"Successfully exported authorization details.",
true
);
});
});

View file

@ -58,7 +58,7 @@ export default class Masthead {
.parent()
.within(() => {
if (closeNotification) {
cy.get(".pf-c-alert__action").click();
cy.get(".pf-c-alert__action").click({ multiple: true });
}
});
return this;