Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document testApkTarget #13

Closed
jonfinerty opened this issue Nov 3, 2015 · 8 comments
Closed

Document testApkTarget #13

jonfinerty opened this issue Nov 3, 2015 · 8 comments

Comments

@jonfinerty
Copy link

I added the plugin to my build, with the instructions found in http://facebook.github.io/screenshot-tests-for-android/#getting-started and then tried running gradle tasks. I got the error:

Execution failed for task ':tasks'.
> Could not determine the dependencies of task ':app:pullScreenshots'.

Through looking through the stacktrace and googling I found #1 and the fact I need to do the following to inform screenshots about the name of the test task:

screenshots {
    testApkTarget = 'connectedAndroidTestDebug'
}

Which will be different for a lot of users. It would be good if either the docs mentioned this or there was a more helpful error message when it's not configured properly.

@Kusand
Copy link

Kusand commented Dec 3, 2015

I was having similar problems, so I'm glad this issue was opened. The documentation is definitely sparse right now.

@tdrhq
Copy link
Contributor

tdrhq commented Dec 3, 2015

TBH, I'm not a gradle expert so I might have got this wrong.

testApkTarget should be the target that generates the APK, and connectedAndroidTestTarget should be the target that runs it. At least that's how it's meant to be, and I hope I can get rid of testApkTarget and somehow discover it from connectedAndroidTestTarget.

Can you show me a typical gradle configuration where the default setup won't work? I'll try to optimize the error messages for that configuration if possible.

@Kusand
Copy link

Kusand commented Dec 3, 2015

Pretty much any time that there are build flavors is the issue, I think. I can try to set up a demo on github later.

@michael-mohemian
Copy link

I have the same issue with build flavors, tried it with version 0.4.

./gradlew screenshotTests --stacktrace"
results in
* Exception is: org.gradle.api.GradleException: Could not determine the dependencies of task ':example:pullScreenshots'.

@mulhollandaf
Copy link

I have been having the same problem with pullScreenshots. Is this being worked on or is this project dead?

@tdrhq
Copy link
Contributor

tdrhq commented Sep 28, 2016

hmm, I'm able to repro if use productFlavors {} to the example app. Looking into it, I can probably make the output better, but the workaround is to use

  screenshots {
    testApkTarget = 'connected<Flavor>DebugAndroidTest',
  }

@russhwolf
Copy link

I couldn't get my tests working using testApkTarget = 'connected<Flavor>DebugAndroidTest', but it did work when I switched to testApkTarget = 'package<Flavor>DebugAndroidTest' as was suggested here.

@xiphirx
Copy link
Contributor

xiphirx commented Oct 12, 2017

@xiphirx xiphirx closed this as completed Oct 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants