Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XWIKI-12629: Page Right is shown when administering inexistent WebHome page #3603

Merged
merged 3 commits into from
Oct 28, 2024
Merged
Changes from 2 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
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import org.junit.jupiter.api.Test;
import org.xwiki.administration.test.po.AdministrablePage;
import org.xwiki.administration.test.po.AdministrationPage;
import org.xwiki.test.docker.junit5.TestReference;
import org.xwiki.test.docker.junit5.UITest;
import org.xwiki.test.ui.TestUtils;

Expand All @@ -43,12 +44,12 @@ class AdministrationIT
* Validate presence of default sections for Administration UIs (Global, Page).
*/
@Test
void verifyAdministrationSections(TestUtils setup)
void verifyAdministrationSections(TestUtils setup, TestReference testReference)
{
setup.loginAsSuperAdmin();

// Navigate to a (non existent for test performance reasons) page in view mode.
setup.gotoPage("NonExistentSpace", "NonExistentPage");
// Navigate to a page in view mode.
setup.createPage(testReference, "");

// Verify that pages have an Admin menu and navigate to the wiki admin UI (which happens to be the global
// admin UI too since we're on the main wiki).
Expand All @@ -71,11 +72,12 @@ void verifyAdministrationSections(TestUtils setup)
assertTrue(wikiAdministrationPage.hasNotSection("PageRights"));

// Select XWiki page administration.
setup.gotoPage("NonExistentSpace", "WebHome");
setup.gotoPage(testReference);
page = new AdministrablePage();
AdministrationPage pageAdministrationPage = page.clickAdministerPage();

assertEquals("Page Administration: NonExistentSpace", pageAdministrationPage.getDocumentTitle());
String fullName = setup.serializeReference(testReference.getParent()).split(":")[1];
Copy link
Member

@tmortagne tmortagne Oct 28, 2024

Choose a reason for hiding this comment

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

I think what you were searching for is TestUtils#serializeLocalReference (which does not contain the wiki part).

Copy link
Member

Choose a reason for hiding this comment

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

Hmmm I didn't paid enough attention: that one is not available in 15.10.x / 16.4.x. Backporting it.

assertEquals("Page Administration: " + fullName,
pageAdministrationPage.getDocumentTitle());
assertTrue(pageAdministrationPage.getBreadcrumbContent().endsWith("/Page Administration"));

assertTrue(pageAdministrationPage.hasSection("Themes"));
Expand Down