[go: nahoru, domu]

Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

Updates to espresso docs #2461

Merged
merged 4 commits into from
Jan 11, 2020
Merged
Changes from 1 commit
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
Next Next commit
updates to espresso docs
  • Loading branch information
collinjackson committed Jan 11, 2020
commit 280f1295b22bd43f92f074f074862264f5a59cf2
35 changes: 6 additions & 29 deletions packages/espresso/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,40 +10,15 @@ Add ```android:usesCleartextTraffic="true"``` in the ```<application>``` in the
of the Android app used for testing. It's best to put this in a debug or androidTest
AndroidManifest.xml so that you don't ship it to end users. (See the example app of this package.)

Add dependencies to your build.gradle:
Add the following dependencies in android/app/build.gradle:

```groovy
dependencies {
testImplementation 'junit:junit:4.12'
testImplementation "com.google.truth:truth:1.0"
testImplementation "com.google.truth:truth:1.0" // new
collinjackson marked this conversation as resolved.
Show resolved Hide resolved
androidTestImplementation 'androidx.test:runner:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'

// Core library
api 'androidx.test:core:1.2.0'

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

// Assertions
androidTestImplementation 'androidx.test.ext:junit:1.0.0'
androidTestImplementation 'androidx.test.ext:truth:1.0.0'
androidTestImplementation 'com.google.truth:truth:0.42'

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

// 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'
api 'androidx.test:core:1.2.0' // new
collinjackson marked this conversation as resolved.
Show resolved Hide resolved
}
```

Expand Down Expand Up @@ -91,10 +66,12 @@ public class MainActivityTest {

You'll need to create a test app that enables the Flutter driver extension.
You can put this in your test_driver/ folder, e.g. test_driver/example.dart.
Replace `<app_package_name>` with the package name of your app. If you're
developing a plugin, this will be the package name of the example app.

```dart
import 'package:flutter_driver/driver_extension.dart';
import '../lib/main.dart' as app;
import 'package:<app_package_name>/main.dart' as app;

void main() {
enableFlutterDriverExtension();
Expand Down