This project was crafted as an example for generating a user manual with screenshots from your tests. It was conceived as an article for the magazine of the Dutch Java User Group NLJUG.
The article file(s) listed below are licensed CC BY-SA 4.0
-
src/main/asciidoc/artikel.adoc
-
src/main/asciidoc/artikel2.adoc
Everything else of this project is MIT licensed.
This application requires Java 8 and Maven 3 (3.5.0 recommended).
The following steps are done during processing.
You can import the project into your IDE and build it there.
You can run the tests inside your IDE (see src/test/java/nl/topicus/nljug/tests
)
This is a Maven project, and it uses Arquillian, WebDriver, Graphene, aShot and AsciiDoctor to test the application and generate the article and manual.
You set up Arquillian by including the necessary libraries as dependencies in the Maven POM.
To change from phantom.js as the browser, you have to modify the src/test/resources/arquillian.xml
file.
You can add additional configuration in that file.
Note
|
phantom.js is a deprecated project because Chrome and Firefox are working hard to build headless support into their browsers. |
-
in order to capture partial screenshots, aShot requires JQuery to be in the HTML of the page. Because of this, the IndexPage and CheckoutPage include a JQuery reference as a header item.
-
the pipeline for files is:
-
tests generate screenshots in
target/screenshots
-
Maven resource plugin copies image files from
src/main/asciidoc/images
totarget/screenshots
because AsciiDoctor can’t handle multiple image folders -
AsciiDoctor assembles the manuals into the
target/generated-docs
folder -
Maven war plugin copies the
target/generated-docs
folder into the war under/manual
-
-
-
Graphene is not required, but makes writing tests a much better experience