Skip to content

XWIKI-20349: Add automated test for "Footer Space Copyright"#5348

Open
Sereza7 wants to merge 2 commits intoxwiki:masterfrom
Sereza7:XWIKI-20349
Open

XWIKI-20349: Add automated test for "Footer Space Copyright"#5348
Sereza7 wants to merge 2 commits intoxwiki:masterfrom
Sereza7:XWIKI-20349

Conversation

@Sereza7
Copy link
Copy Markdown
Contributor

@Sereza7 Sereza7 commented Mar 26, 2026

Jira URL

https://jira.xwiki.org/browse/XWIKI-20349

Changes

Description

  • Added a test

Clarifications

  • I adde the copyright method directly on the PresentationAdministrationSectionPage instead of on the ViewPage. I doubt any other test would need to check this specific feature and clicking the save button on this page reloads the page so we can check the copyright status from this administration page directly.
  • The copyright container is always in the DOM from the start (even when empty). The "find" will always find something, even if that's an empty div.

Screenshots & Video

None, test change only.

Executed Tests

Built the changes successfully with mvn clean install -f xwiki-platform-core/xwiki-platform-administration/xwiki-platform-administration-test/xwiki-platform-administration-test-pageobjects -Pquality.

Passed the docker tests with mvn clean install -f xwiki-platform-core/xwiki-platform-administration/xwiki-platform-administration-test/xwiki-platform-administration-test-docker -Dit.test=PresentationIT.

Expected merging strategy

  • Prefers squash: Yes
  • Backport on branches:
    • None.

@Sereza7 Sereza7 requested a review from michitux March 26, 2026 16:43
@Sereza7 Sereza7 marked this pull request as draft March 26, 2026 16:43
@Sereza7 Sereza7 marked this pull request as ready for review March 26, 2026 17:06
Copy link
Copy Markdown
Contributor

@michitux michitux left a comment

Choose a reason for hiding this comment

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

Thank you! Overall, the test looks good, just a few minor comments.


String defaultVersion = presentationSectionPage.getVersion();
// The default version should contain the xwiki-platform project version.
assertFalse(defaultVersion.isEmpty());
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could we maybe assert a bit more here? Like that it contains certain things, like the string XWiki or some numbers? Maybe we could also just get the version from the POM and assert the actual version?

/**
* @return return the content of the version section in the page footer
*/
public String getVersion()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I would prefer naming this method differently to make it clearer that this gets the version from the footer and not from the input element - which is what one might expect otherwise.

this.version.sendKeys(value);
}
/**
* @return return the content of the version section in the page footer
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Missing @since annotation. We currently don't treat this as an API, but it's still good to have version information (the same is basically true for any method or class you're adding except for tests/test classes themselves).

}

/**
* @param value the value to set for the "Version" option
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Missing @since annotation. We currently don't treat this as an API, but it's still good to have version information (the same is basically true for any method or class you're adding except for tests/test classes themselves).

/**
* @return the content of the copyright section in the page footer
*/
public String getCopyright()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I would prefer naming this method differently to make it clearer that this gets the copyright from the footer and not from the input element - which is what one might expect otherwise.

}

/**
* @param value the value to set for the "Copyright" option
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Missing @since annotation (see below).

this.copyright.sendKeys(value);
}
/**
* @return the content of the copyright section in the page footer
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Missing @since annotation (see below).

}

@Test
void customizeFooter(TestUtils setup, TestReference testReference) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I wonder if it wouldn't make sense to have two separate test methods, one for the copyright and one for the version as the two tests already seem pretty separate.

assertFalse(defaultVersion.isEmpty());
presentationSectionPage.setVersion("test-version");
presentationSectionPage.clickSave();
// The page is reloaded, we can see directly on this page if the copyright is correctly applied.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
// The page is reloaded, we can see directly on this page if the copyright is correctly applied.
// The page is reloaded, we can see directly on this page if the version is correctly applied.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants