Hi,
I've just pushed quite some commits to, amongst other things replace the
selenium-based tests -which where done for 210 template-, with
Selenide-based ones.
Selenide is a java wrapper on top of Selenium, which greatly simplifies its
use (see [#1] for details, browser transparent set up being the most
prominent one for me). Together with the Page Object pattern ([#2]) makes
the tests looks like this:
@Test
void loginAndLogout() throws Exception {
ReadWikiPage main = Page.withUrl( Page.baseUrl() +
"/Wiki.jsp?page=Main" ).openAs( new ReadWikiPage() );
Assertions.assertEquals( "JSPWiki: Main", main.title() );
Assertions.assertEquals( "Main", main.wikiTitle() );
Assertions.assertEquals( "G’day (anonymous guest)",
main.hoverLoginArea().authenticatedText() );
final LoginPage login = main.hoverLoginArea().clickOnLogin();
Assertions.assertEquals( "JSPWiki: Login", login.title() );
Assertions.assertEquals( "Login", login.wikiTitle() );
main = login.performLogin();
Assertions.assertEquals( "JSPWiki: Main", main.title() );
Assertions.assertEquals( "G’day, Janne Jalkanen (authenticated)",
main.hoverLoginArea().authenticatedText() );
main.hoverLoginArea().logout();
Assertions.assertEquals( "G’day (anonymous guest)",
main.hoverLoginArea().authenticatedText() );
}
with, f.ex., hoverLoginArea looking like this:
public ReadWikiPage hoverLoginArea() {
Selenide.$( By.className( "icon-user" ) ).hover();
return this;
}
Right now there are only tests for Login and Logout (on the
jspwiki-selenide-tests submodule), but it should be pretty easy to add some
more. Although the configuration for functional tests has changed quite a
bit, functional tests are still run the same way as before:
mvn clean install -Pintegration-tests
Perhaps the fastest way to run them is to run that command on
jspwiki-it-tests, after having compiled the main war module. There are some
customizations that can be done to the tests execution (f.ex., run the
tests on a headless chrome browser), but I'll write them down at
jspwiki-wiki.a.o later this week. The only prerequisite is to have Chrome
executable on $PATH (it's Selenide's default - for now should be enough).
The tests can also be executed inside the IDE, as normal unit tests, and
they'll be launched against https://jspwiki-wiki.apache.org. In that case,
please note that tests may fail depending on your browser's locale, and
that login details should be changed too, see Env class on
jspwiki-selenide-tests submodule.
I'd like to ask for updating your current master and try out this new
feature, as it should be a great way to test RCs, once there's enough
functional tests.
Speaking of RCs, I'd like to run a new release vote for 2.11.0.M1, most
probably next weekend, so there's enough time to try current master. I'll
be updating JIRA so we can have a decent JIRA changelog for the release and
documenting the functional tests execution, but I don'texpect doing much
more until then. If anyone wants to add some more commits or more
functional tests O:-) please feel free to do so.
best regards,
juan pablo
[#1]: https://selenide.org/documentation/selenide-vs-selenium.html
[#2]: https://selenide.org/documentation/page-objects.html