Skip to content
Snippets Groups Projects
Unverified Commit fa8ecf2f authored by Gustavo Saiani's avatar Gustavo Saiani Committed by GitHub
Browse files

Prevent flakes in GroupMappingsWidget e2e tests (#28984)

parent b549b291
No related branches found
No related tags found
No related merge requests found
......@@ -21,6 +21,8 @@ export function crudGroupMappingsWidget(authenticationMethod) {
cy.findByText(/remove all group members/i).click();
cy.button("Remove mapping and members").click();
cy.wait(["@clearGroup", "@clearGroup"]);
cy.visit("/admin/people/groups");
cy.findByText("data").should("not.exist");
cy.findByText("nosql").should("not.exist");
......@@ -81,7 +83,15 @@ const addGroupsToMapping = (mappingName, groups) => {
cy.findByText("Default").click();
});
groups.forEach(group => cy.findByText(group).click());
groups.forEach(group => {
cy.findByText(group).click();
cy.findByText(group)
.closest(".List-section")
.within(() => {
cy.icon("check");
});
});
};
const checkThatGroupHasNoMembers = name => {
......
......@@ -74,6 +74,9 @@ describeEE("scenarios > admin > settings > SSO > JWT", () => {
cy.intercept("GET", "/api/setting").as("getSettings");
cy.intercept("GET", "/api/session/properties").as("getSessionProperties");
cy.intercept("DELETE", "/api/permissions/group/*").as("deleteGroup");
cy.intercept("PUT", "/api/permissions/membership/*/clear").as(
"clearGroup",
);
});
it("should allow deleting mappings along with deleting, or clearing users of, mapped groups", () => {
......
......@@ -119,13 +119,16 @@ describe(
"getSessionProperties",
);
cy.intercept("DELETE", "/api/permissions/group/*").as("deleteGroup");
cy.intercept("PUT", "/api/permissions/membership/*/clear").as(
"clearGroup",
);
});
it.only("should allow deleting mappings along with deleting, or clearing users of, mapped groups", () => {
it("should allow deleting mappings along with deleting, or clearing users of, mapped groups", () => {
crudGroupMappingsWidget("ldap");
});
it.only("should allow deleting mappings with groups, while keeping remaining mappings consistent with their undeleted groups", () => {
it("should allow deleting mappings with groups, while keeping remaining mappings consistent with their undeleted groups", () => {
checkGroupConsistencyAfterDeletingMappings("ldap");
});
});
......
......@@ -76,6 +76,9 @@ describeEE("scenarios > admin > settings > SSO > SAML", () => {
cy.intercept("GET", "/api/setting").as("getSettings");
cy.intercept("GET", "/api/session/properties").as("getSessionProperties");
cy.intercept("DELETE", "/api/permissions/group/*").as("deleteGroup");
cy.intercept("PUT", "/api/permissions/membership/*/clear").as(
"clearGroup",
);
});
it("should allow deleting mappings along with deleting, or clearing users of, mapped groups", () => {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment