The Tauk Espresso Package allows you to easily report and monitor your Espresso automation tests on the Tauk platform.
Add the following dependency to your app level gradle file:
dependencies {
// ...
androidTestImplementation 'com.tauk:tauk-espresso-library:0.1.2'
}
Add the following rule to your test class:
@get:Rule
val watcher = TaukWatcher(API_TOKEN, PROJECT_ID)
Invoking tests via adb
API Token and Project ID can be specified as arguments while initializing TaukWatcher()
or they can also be specified as instrumentation arguments using e taukApiToken YOUR_TOKEN -e taukProjectId YOUR_PROJECT_ID
Example:
adb shell am instrument -m -w -e taukApiToken <API_TOKEN> -e taukProjectId <PROJECT_ID> <APP_PACKAGE>/androidx.test.runner.AndroidJUnitRunner
Invoking test via Gradle
You can also invoke the test from gradle using gradle connectedAndroidTest
task
Example:
./gradlew cAT -Pandroid.testInstrumentationRunnerArguments.taukProjectId=<PROJECT_ID> -Pandroid.testInstrumentationRunnerArguments.taukApiToken=<API_TOKEN>