There are three ways to run tests.
|The most reliable way to run tests is the 3rd one. The first two methods might fail some GUI tests due to platform/resolution-specific idiosyncrasies.|
Method 1: Using IntelliJ JUnit test runner
To run all tests, right-click on the
src/test/javafolder and choose
Run 'All Tests'
To run a subset of tests, you can right-click on a test package, test class, or a test and choose
Method 2: Using Gradle
Open a console and run the command
gradlew clean allTests(Mac/Linux:
./gradlew clean allTests)
|See UsingGradle.adoc for more info on how to run tests using Gradle.|
Method 3: Using Gradle (headless)
Thanks to the TestFX library we use, our GUI tests can be run in the headless mode. In the headless mode, GUI tests do not show up on the screen. That means the developer can do other things on the Computer while the tests are running.
To run tests in headless mode, open a console and run the command
gradlew clean headless allTests (Mac/Linux:
./gradlew clean headless allTests)
We have two types of tests:
GUI Tests - These are tests involving the GUI. They include,
System Tests that test the entire App by simulating user actions on the GUI. These are in the
Unit tests that test the individual components. These are in
Non-GUI Tests - These are tests not involving the GUI. They include,
Unit tests targeting the lowest level methods/classes.
Integration tests that are checking the integration of multiple code units (those code units are assumed to be working).
Hybrids of unit and integration tests. These test are checking multiple code units as well as how the are connected together.
HelpWindowTest fails with a
Reason: One of its dependencies,
Solution: Execute Gradle task
Problem: Keyboard and mouse movements are not simulated on macOS Mojave, resulting in GUI Tests failure.
Reason: From macOS Mojave onwards, applications without
Accessibilitypermission cannot simulate certain keyboard and mouse movements.
System Preferences, click
Security and Privacy→
Accessibility, and check the box beside
Accessibilitypermission is granted to