📄️ Set up an Android application project to use Testify
Before building your screenshot test with Testify, make sure to set a dependency reference to the Testify plugin:
📄️ Configure your emulator to run Testify tests
The Sample application includes a baseline for an emulator that's compatible with GitHub Actions. To configure an AVD locally, create a new virtual device with the following settings in the Android Virtual Device (AVD) configuration:
📄️ Write a test
Testify is a subclass of Android's ActivityTestRule. The testing framework launches the activity under test before each test method annotated with @Test and before any method annotated with @Before.
📄️ Update your baseline
Testify works by referencing a PNG baseline found in your androidTest/assets directory for each test case that you write. As you write and run tests, an updated baseline image is maintained on your device or emulator. In order to update the baseline, you need to copy or pull the image from the device to your local development environment. Testify offers a variety of Gradle tasks to simplify the copying of your baseline images.
📄️ Verify the tests
Run all the screenshot tests in your app and fail if any differences from the baseline are detected.
📄️ Install and use the Android Studio Plugin
Testify screenshot tests are built on top of Android Instrumentation tests and so already integrate seamlessly with existing test suites. Screenshots can be captured directly from within Android Studio or using the Gradle command-line tools.