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
}
2 changes: 1 addition & 1 deletion ui/espresso/IdlingResourceSample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,5 @@ ext {
coreVersion = "1.1.0-beta01"
extJUnitVersion = "1.1.0-beta01"
runnerVersion = "1.1.1-beta01"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

odd. these versions should all be stable, not beta01. Is this branch synced with latest master?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assumed master would be the latest, and since the change shouldn't be breaking, just keep my self on master as well.

I feel an example shouldn't have not stable libraries cause it could confuse developer in their learning process.

I'm gonna take look at what you point and will see if I can change the other dependencies while on it.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, in my local master branch these are stable. I'll look into it

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please merge in master, I've merged a PR that updated versions to stable

espressoVersion = "3.1.1-beta01"
espressoVersion = "3.1.1"
}