Skip to content

Commit

Permalink
Merge pull request #241 from cutiko/master
Browse files Browse the repository at this point in the history
UPDATE: gradle indications were outdated
  • Loading branch information
brettchabot authored Jan 18, 2019
2 parents 3bab7bc + 02b1026 commit 383bcbe
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
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
}

0 comments on commit 383bcbe

Please sign in to comment.