Skip to content

Update espresso dependencies #7048

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

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions packages/espresso/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 0.4.0

* Updates androidx.test.espresso version to 3.6.1.
* Updates androidx.test to 1.6.1.
* Removes androidx.test.annotation.ExperimentalTestApi.

## 0.3.0+10

* Removes additional references to v1 Android embedding.
Expand Down
6 changes: 3 additions & 3 deletions packages/espresso/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ Add the following dependencies in android/app/build.gradle:
```groovy
dependencies {
testImplementation 'junit:junit:4.13.2'
testImplementation "com.google.truth:truth:1.0"
androidTestImplementation 'androidx.test:runner:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
testImplementation "com.google.truth:truth:1.1.3"
androidTestImplementation 'androidx.test:runner:1.6.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1'
api 'androidx.test:core:1.2.0'
}
```
Expand Down
27 changes: 13 additions & 14 deletions packages/espresso/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -67,34 +67,33 @@ dependencies {

testImplementation 'junit:junit:4.13.2'
testImplementation "com.google.truth:truth:1.1.3"
api 'androidx.test:runner:1.1.1'
api 'androidx.test.espresso:espresso-core:3.5.1'
api 'androidx.test.espresso:espresso-core:3.6.1'

// Core library
api 'androidx.test:core:1.0.0'
api 'androidx.test:core:1.6.1'

// AndroidJUnitRunner and JUnit Rules
api 'androidx.test:runner:1.1.0'
api 'androidx.test:rules:1.1.0'
api 'androidx.test:runner:1.6.1'
api 'androidx.test:rules:1.6.1'

// Assertions
api 'androidx.test.ext:junit:1.1.5'
api 'androidx.test.ext:truth:1.5.0'
api 'androidx.test.ext:junit:1.2.1'
api 'androidx.test.ext:truth:1.6.0'
api 'com.google.truth:truth:1.1.3'

// Espresso dependencies
api 'androidx.test.espresso:espresso-core:3.5.1'
api 'androidx.test.espresso:espresso-contrib:3.5.1'
api 'androidx.test.espresso:espresso-intents:3.5.1'
api 'androidx.test.espresso:espresso-accessibility:3.5.1'
api 'androidx.test.espresso:espresso-web:3.5.1'
api 'androidx.test.espresso.idling:idling-concurrent:3.5.1'
api 'androidx.test.espresso:espresso-core:3.6.1'
api 'androidx.test.espresso:espresso-contrib:3.6.1'
api 'androidx.test.espresso:espresso-intents:3.6.1'
api 'androidx.test.espresso:espresso-accessibility:3.6.1'
api 'androidx.test.espresso:espresso-web:3.6.1'
api 'androidx.test.espresso.idling:idling-concurrent:3.6.1'

// The following Espresso dependency can be either "implementation"
// or "androidTestImplementation", depending on whether you want the
// dependency to appear on your APK's compile classpath or the test APK
// classpath.
api 'androidx.test.espresso:espresso-idling-resource:3.5.1'
api 'androidx.test.espresso:espresso-idling-resource:3.6.1'
}


Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

import android.util.Log;
import android.view.View;
import androidx.test.annotation.ExperimentalTestApi;
import androidx.test.espresso.UiController;
import androidx.test.espresso.ViewAction;
import androidx.test.espresso.flutter.action.FlutterViewAction;
Expand Down Expand Up @@ -100,7 +99,6 @@ private WidgetInteraction(
* @param widgetActions one or more actions that shall be performed. Cannot be {@code null}.
* @return this interaction for further perform/verification calls.
*/
@ExperimentalTestApi()
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 am struggling to find the original documentation for this annotation. There is an identically named class in compose that is exposed but I think it is for compose related apis.

This annotation either is marking something experimental from us which we dont need anymore or it was required as an opt in feature and all the features have graduated.

public WidgetInteraction perform(@Nonnull final WidgetAction... widgetActions) {
checkNotNull(widgetActions);
for (WidgetAction widgetAction : widgetActions) {
Expand All @@ -117,7 +115,6 @@ public WidgetInteraction perform(@Nonnull final WidgetAction... widgetActions) {
* @param assertion a widget assertion that shall be made on the matched Flutter widget. Cannot
* be {@code null}.
*/
@ExperimentalTestApi()
public WidgetInteraction check(@Nonnull WidgetAssertion assertion) {
checkNotNull(
assertion,
Expand All @@ -133,7 +130,6 @@ public WidgetInteraction check(@Nonnull WidgetAssertion assertion) {
return this;
}

@ExperimentalTestApi()
@SuppressWarnings("unchecked")
private <T> T performInternal(FlutterAction<T> flutterAction) {
checkNotNull(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

package androidx.test.espresso.flutter.action;

import androidx.test.annotation.ExperimentalTestApi;
import androidx.test.espresso.flutter.api.WidgetAction;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
Expand Down Expand Up @@ -44,7 +43,6 @@ public static WidgetAction click() {
* by directly injecting key events to the Android system. Uses this {@link #syntheticClick()}
* only when there are special cases that {@link #click()} cannot handle properly.
*/
@ExperimentalTestApi()
public static WidgetAction syntheticClick() {
return new SyntheticClickAction();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

import android.os.Looper;
import android.view.View;
import androidx.test.annotation.ExperimentalTestApi;
import androidx.test.espresso.IdlingRegistry;
import androidx.test.espresso.IdlingResource;
import androidx.test.espresso.UiController;
Expand Down Expand Up @@ -96,7 +95,6 @@ public String getDescription() {
"Perform a %s action on the Flutter widget matched %s.", widgetAction, widgetMatcher);
}

@ExperimentalTestApi
@Override
public void perform(UiController uiController, View view) {
checkNotNull(view, "The Flutter View instance cannot be null.");
Expand Down Expand Up @@ -143,7 +141,6 @@ public ListenableFuture<Void> apply(Void readyResult) {
}
}

@ExperimentalTestApi
@VisibleForTesting
void perform(
View flutterView, FlutterTestingProtocol flutterTestingProtocol, UiController uiController) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
package androidx.test.espresso.flutter.action;

import android.view.View;
import androidx.test.annotation.ExperimentalTestApi;
import androidx.test.espresso.UiController;
import androidx.test.espresso.flutter.api.FlutterTestingProtocol;
import androidx.test.espresso.flutter.api.SyntheticAction;
Expand All @@ -23,7 +22,6 @@
*/
public final class SyntheticClickAction implements WidgetAction {

@ExperimentalTestApi
@Override
public Future<Void> perform(
@Nullable WidgetMatcher targetWidget,
Expand Down
26 changes: 13 additions & 13 deletions packages/espresso/example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ android {

defaultConfig {
minSdkVersion flutter.minSdkVersion
targetSdkVersion 29
targetSdkVersion 34
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
Expand Down Expand Up @@ -62,28 +62,28 @@ dependencies {
implementation "androidx.multidex:multidex:2.0.1"

// Core library
api 'androidx.test:core:1.2.0'
api 'androidx.test:core:1.6.1'
Copy link
Contributor

Choose a reason for hiding this comment

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

IIRC this is api because it's actually re-exposed as part of the public (native) API surface, so if anything here is breaking we'd want to version accordingly (although since it's a minor version change, maybe it's not breaking?)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This value has not change in 5 years since the creation of this plugin.
I am going to assume it is the most breaking change we can make.

I will update this to have more obviously breaking version number once I get the tests passing.
dcace54#diff-af20d9c2b386a0c999752ae955c2295514c30f75e7aa6255a47e2c6114340ef9


// AndroidJUnitRunner and JUnit Rules
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test:rules:1.1.0'
androidTestImplementation 'androidx.test:runner:1.6.1'
androidTestImplementation 'androidx.test:rules:1.6.1'

// Assertions
androidTestImplementation 'androidx.test.ext:junit:1.0.0'
androidTestImplementation 'androidx.test.ext:truth:1.0.0'
androidTestImplementation 'androidx.test.ext:junit:1.2.1'
androidTestImplementation 'androidx.test.ext:truth:1.6.0'
androidTestImplementation 'com.google.truth:truth:1.1.3'

// Espresso dependencies
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'
androidTestImplementation 'androidx.test.espresso:espresso-contrib:3.1.0'
androidTestImplementation 'androidx.test.espresso:espresso-intents:3.1.0'
androidTestImplementation 'androidx.test.espresso:espresso-accessibility:3.1.0'
androidTestImplementation 'androidx.test.espresso:espresso-web:3.1.0'
androidTestImplementation 'androidx.test.espresso.idling:idling-concurrent:3.1.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1'
androidTestImplementation 'androidx.test.espresso:espresso-contrib:3.6.1'
androidTestImplementation 'androidx.test.espresso:espresso-intents:3.6.1'
androidTestImplementation 'androidx.test.espresso:espresso-accessibility:3.6.1'
androidTestImplementation 'androidx.test.espresso:espresso-web:3.6.1'
androidTestImplementation 'androidx.test.espresso.idling:idling-concurrent:3.6.1'

// The following Espresso dependency can be either "implementation"
// or "androidTestImplementation", depending on whether you want the
// dependency to appear on your APK's compile classpath or the test APK
// classpath.
androidTestImplementation 'androidx.test.espresso:espresso-idling-resource:3.1.0'
androidTestImplementation 'androidx.test.espresso:espresso-idling-resource:3.6.1'
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
android:icon="@mipmap/ic_launcher">
<activity
android:name=".MainActivity"
android:exported="true"
android:launchMode="singleTop"
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
Expand Down
2 changes: 1 addition & 1 deletion packages/espresso/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: Java classes for testing Flutter apps using Espresso.
Allows driving Flutter widgets from a native Espresso test.
repository: https://github.com/flutter/packages/tree/main/packages/espresso
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+espresso%22
version: 0.3.0+10
version: 0.4.0

environment:
sdk: ^3.4.0
Expand Down