XWIKI-20349: Add automated test for "Footer Space Copyright"#5348
XWIKI-20349: Add automated test for "Footer Space Copyright"#5348Sereza7 wants to merge 2 commits intoxwiki:masterfrom
Conversation
* Added the version test
michitux
left a comment
There was a problem hiding this comment.
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()); |
There was a problem hiding this comment.
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() |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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() |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Missing @since annotation (see below).
| this.copyright.sendKeys(value); | ||
| } | ||
| /** | ||
| * @return the content of the copyright section in the page footer |
There was a problem hiding this comment.
Missing @since annotation (see below).
| } | ||
|
|
||
| @Test | ||
| void customizeFooter(TestUtils setup, TestReference testReference) { |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
| // 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. |
Jira URL
https://jira.xwiki.org/browse/XWIKI-20349
Changes
Description
Clarifications
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