Skip to content
Snippets Groups Projects
Commit b6556a84 authored by Vincent Massol's avatar Vincent Massol
Browse files

[Misc] Avoid locking the XWikiPreferences page during the test (otherwise a...

[Misc] Avoid locking the XWikiPreferences page during the test (otherwise a lock will be displayed when using the admin action afterwards) + remove now unecessary setGlobalRights() call
parent 80225193
No related branches found
No related tags found
No related merge requests found
......@@ -53,15 +53,12 @@ class LoginIT
@BeforeAll
static void beforeAll(TestUtils setup)
{
// By default the minimal distribution used for the tests doesn't have any rights setup. For this test class
// By default, the minimal distribution used for the tests doesn't have any rights set up. For this test class
// we'll need:
// - Make sure that only authenticated users can edit/save content (for test dataIsPreservedAfterLogin below).
// - Create an Admin user part of the Admin Group and make sure that this Admin Group has admin rights in the
// wiki. We could also have given that Admin user the admin right directly but the solution we chose is closer
// to the XS distribution.
// - Create an Admin user.
setup.loginAsSuperAdmin();
setup.setGlobalRights("XWiki.XWikiAllGroup", "", "edit", true);
setup.setGlobalRights("XWiki.XWikiAdminGroup", "", "admin", true);
setup.createAdminUser();
}
......
......@@ -662,6 +662,9 @@ private void setRights(EntityReference entityReference, String rightClassName, S
String normalizedGroups = groups == null ? "" : groups;
addObject(entityReference, rightClassName, "groups", normalizedGroups, "levels", rights,
"users", normalizedUsers, "allow", enabled ? "1" : "0");
// Click Cancel to avoid locking the page (the xobject has been saved automatically when it was added).
ObjectEditPage oep = new ObjectEditPage();
oep.clickCancel();
}
public ViewPage gotoPage(String space, String page)
......
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