Skip to main content

Java+JS demo example

Please note that at the moment:
– This demo works only for Windows 10.
– Frontend JavaScript coverage collection for automated tests works only when running headful Chrome.

We are using a RealWorld app examples:

spring-logoBackend: Spring
plus
angular-logoFrontend: Angular

Step 1. Clone the example repository:#

git clone https://github.com/Drill4J/realworld-java-and-js-coverage

Step 2. Start Drill4J Admin#

2.1.
Start docker containers using the following command:
./demo-up.sh
2.2.

After the installation go to Drill4J Admin: http://localhost:8091

2.3.

Press “Continue as a Guest” and register agents (both Java and Node.js)

2.4.

Go through the first two steps of the registration wizard and make sure that Test2Code plugin is enabled at Step 3

There is no need to specify any parameters during the registration, just click through steps leaving everything as-is.

2.5.

Open sample application at: http://localhost:8080

2.6.

To collect coverage run tests:

./gradlew clean :build1:test

Tests will be started in a few seconds. Please wait untill the testing process finish.
See the testing results on Test2Code plugin’s page and finish active scope
to add collected coverage to your build.

Step 3. Deploy additional builds#

You have to deploy additional builds to discover Drill4J features:

  • Tests to run;
  • Risks Management;
  • Time Savings;
  • Baseline builds.
3.1.

Deploy the 2nd build of Realworld example app:

./demo-deploy-build2.sh

Wait for build notification to appear (click the icon in the top-right corner).

Now you are able to see the list of Risks (uncovered new and modified methods)
and suggested Tests to Run

3.2.

To collect coverage for the 2nd build run tests:

./gradlew clean :build2:test2run
3.3.

Deploy the 3rd build (optional):

./demo-deploy-build3.sh
3.4.

To collect coverage for the 3rd build run tests:

./gradlew clean :build3:test2run

Below you can find a command to remove RealWorld demo example:

./demo-down.sh

For manual testing use Chrome Extension#

Install the latest version of Chrome Extension