-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Description
Similar to issue #193, it would be good if users had a straightforward way of running arbitrary code before and after the test run, but while the emulator is running and in a healthy state.
Additional feature considerations
- Exposing adb binary location or command execution helpers
Example
This is not a proposal for implementation but suggests one way this could look to consumers
androidEmulator {
onBeforeTestRun {
// adb is a function defined in the scope of these
adb("push", file(project.projectDir, "scripts/instrumentation-test-setup.sh"), "/sdcard/setup.sh")
adb "shell", "bash /sdcard/setup.sh"
}
onAfterTestRun {
// Any arbitrary code could be run
// Retrieve files generated by the tests
adb "pull", "/sdcard/test_output.json", file(project.buildDir, "test_output.json")
result = adb "logcat", "-d"
project.logger.debug("logcat stdout: " + result.stdout)
project.logger.debug("logcat stderr: " + result.stderr)
}
}StefanOltmann and artems-reed
Metadata
Metadata
Assignees
Labels
No labels