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

UPDATE: gradle indications were outdated #241

Merged
merged 10 commits into from
Jan 18, 2019
16 changes: 13 additions & 3 deletions ui/espresso/IdlingResourceSample/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,23 @@ This sample showcases how to implement a very simple IdlingResource interface an

Consider using the CountingIdlingResource class from the espresso-contrib package. It's a very easy to use Idling Resource implementation that can handle multiple parallel operations keeping track of the number of pending operations.

Note that the `espresso-idling-resource` dependency is added into the `compile` scope:
Note that the `espresso-idling-resource` dependency is added into the `implementation` scope.

This sample use AndroidX:

```
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
implementation 'androidx.test.espresso:espresso-idling-resource:3.1.1'
```

If you haven't yet migrated to AndroidX:

```
androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.2'
compile 'com.android.support.test.espresso:espresso-idling-resource:2.2.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.android.support.test.espresso:espresso-idling-resource:3.0.2'
```


This dependency and its implementation are added to the app under test but are not needed in production. This bloats the released app but it's kept this way to simplify the sample. You can:
* ProGuard/shrink your release build to minimize impact
* Use a build type or product flavor for tests and remove the Idling Resource classes in the production/release variant.
Expand Down
4 changes: 2 additions & 2 deletions ui/espresso/IdlingResourceSample/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ dependencies {
androidTestImplementation 'androidx.test:core:' + rootProject.coreVersion
androidTestImplementation 'androidx.test.ext:junit:' + rootProject.extJUnitVersion
androidTestImplementation 'androidx.test:runner:' + rootProject.runnerVersion
androidTestImplementation 'androidx.test.espresso:espresso-core:' + rootProject.espressoVersion;
androidTestImplementation 'androidx.test.espresso:espresso-core:' + rootProject.espressoVersion
// Note that espresso-idling-resource is used in the code under test.
implementation 'androidx.test.espresso:espresso-idling-resource:' + rootProject.espressoVersion;
implementation 'androidx.test.espresso:espresso-idling-resource:' + rootProject.espressoVersion
}