Skip to content

Commit

Permalink
Update espresso dependencies (flutter#7048)
Browse files Browse the repository at this point in the history
- **Update espresso dependencies**
fixes flutter#151188
  • Loading branch information
reidbaker authored Jul 10, 2024
1 parent 0152717 commit 007ec66
Show file tree
Hide file tree
Showing 10 changed files with 37 additions and 42 deletions.
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()
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'

// 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

0 comments on commit 007ec66

Please sign in to comment.