Skip to content

Generate fast deterministic screenshots during Android instrumentation tests

License

Notifications You must be signed in to change notification settings

usefulness/screenshot-tests-for-android

Repository files navigation

Screenshot Tests for Android

version Maven Central

Quick start

  1. build.gradle
plugins {
    id("io.github.usefulness.screenshot-testing-plugin") version "{{ version }}"
}
  1. androidTest/kotlin/SampleTest.kt
class SampleTest {

    @Test
    fun foo() {
        launchActivity<MainActivity>().onActivity(Screenshot::snap)
    }
}
  1. run ./gradlew recordDebugAndroidTestScreenshotTest
  2. modify the view, run ./gradlew verifyDebugAndroidTestScreenshotTest observe failure with a report

License

screenshot-tests-for-android is Apache-2-licensed.