Git Product home page Git Product logo

android-screenshot-testing-playground's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

android-screenshot-testing-playground's Issues

Android-Testify: Create "copyScreenshots" gradle task to automatically copy GMD screenshots into androidTest/assets

Android-Testify works with GMD (Gradle Managed Devices) but requires the screenshots to be copied into androidTest/assets before verifying them.

The idea is to create a simple gradle task that does that automatically

def devices = project.hasProperty("devices") ? project.devices : "pixel3api30"

tasks.register('copyScreenshots', Copy) {
    from "build/outputs/managed_device_android_test_additional_output/debug/${devices}/images"
    into "src/androidTest/assets"
}

and then run it like this before verifying
./gradlew :lazycolumnscreen:android-testify:copyScreenshots -Pdevices=pixel3api30

Executing Android-Testify without GMD and useTestStorage = true fails with dev.testify.output.TestStorageNotFoundException

When I execute Android-Testify Tests with, e.g.
./gradlew :recyclerviewscreen:android-testify:screenshotRecord -PscreenshotAnnotation=com.example.road.to.effective.snapshot.testing.testannotations.ViewHolderTest

The test fails with

dev.testify.output.TestStorageNotFoundException: 
* TestStorage service not found.
* Please ensure that `testInstrumentationRunnerArguments useTestStorageService: "true"` is added to your build.gradle.

It seems that the problem is in the gradle plugin configuration:

testify {
   ...
    useTestStorage = true
}

if we remove it or set it to false, it works

So we should only set it to true when executing Android-Testify Screenshot Tests with Gradle Managed Devices

Code clean up

The code was adapted from a personal project and had therefore a lot of commented code and leftovers.

This task should clean up and structure the code a bit

Modularise app for better extensibility

Right now everything is in one module.
ideally we should create one module for each action e.g.
Every button in the main screen opens an activity -> module

  1. Module for snapshot testing a Dialog
  2. Module for snapshot testing a RecyclerView
    ...

`shot` Screenshot not generated even tho androidTest is passed.

I tried to run the shot test for both lazycolumn and recyclerview screen but there is no generated screenshot for both the record and the verification.
image
I checked the screenshot folder and it is empty too.
image

The report also shows 0 tests executed.
image
image

The test shows up and report from androidTest directory confirm that.
image

How to solve this or did i miss something?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.