Running tests
Gradle¶
Tests can be run by just invoking the test
task (gradlew test
). Currently, there
is no way to run a specific test via Gradle.
IDE¶
To run tests in IntelliJ IDEA or Android Studio you need to install Spek Framework plugin (search for Spek Framework
).
Info
Running tests for Android projects in IntelliJ IDEA is not supported, please use Android Studio.
The plugin will allow you to:
- Run all tests in a package (there should be an option under
Run
->Spek(s): <package>
when right clicking a package in the explorer) - Run specific scope via the gutter icons.
- See at a glance failed tests from the reporting window.
- Navigate to the failing test via the test tree (Right click the failing entry then
Jump to Source
or pressF4
). Do note thatJump to Source
does not work if you run all tests within a package.
When using Gradle, please set Build Tools/Gradle/Run tests using:
to Intellij IDEA
. You can use Choose per test
to show
all possible options.