Skip to content

Demo project for article written for the Java Magazine of the NLJUG

License

Notifications You must be signed in to change notification settings

dashorst/nljug-article-2017

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Generating screenshots and a manual using your tests

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.

License

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.

Building and running the application

This application requires Java 8 and Maven 3 (3.5.0 recommended).

The following steps are done during processing.

build process

IDE

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)

Commandline

Using mvn package will build the project and craft the application including the manual and screenshots.

Using mvn jetty:run when you have built the project will launch a server and you can then use the application from localhost (port 8080).

Technologies

This is a Maven project, and it uses Arquillian, WebDriver, Graphene, aShot and AsciiDoctor to test the application and generate the article and manual.

Arquillian setup

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.

Additional notes

  • 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 to target/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

About

Demo project for article written for the Java Magazine of the NLJUG

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published