Skip to content

Commit b2d5c2c

Browse files
jiahaogEgor
authored andcommitted
[integration_test] Fix channel name for iOS, docs (flutter#2972)
1 parent 7285fdd commit b2d5c2c

File tree

4 files changed

+23
-22
lines changed

4 files changed

+23
-22
lines changed

packages/integration_test/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
## 0.8.1
22

33
* Show stack trace of widget test errors on the platform side
4+
* Fix method channel name for iOS
45

56
## 0.8.0
67

packages/integration_test/README.md

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,15 @@ and native Android instrumentation testing.
66

77
## Usage
88

9-
Add a dependency on the `integration_test` package in the
9+
Add a dependency on the `integration_test` and `flutter_test` package in the
1010
`dev_dependencies` section of pubspec.yaml. For plugins, do this in the
1111
pubspec.yaml of the example app.
1212

1313
Invoke `IntegrationTestWidgetsFlutterBinding.ensureInitialized()` at the start
1414
of a test file, e.g.
1515

1616
```dart
17+
import 'package:flutter_test/flutter_test.dart';
1718
import 'package:integration_test/integration_test.dart';
1819
1920
void main() {
@@ -32,7 +33,7 @@ app code, it should go in `example/test/`. It is also acceptable to put
3233
integration_test tests in `test_driver/` folder so that they're alongside the
3334
runner app (see below).
3435

35-
## Using Flutter driver to run tests
36+
## Using Flutter Driver to Run Tests
3637

3738
`IntegrationTestWidgetsTestBinding` supports launching the on-device tests with
3839
`flutter drive`. Note that the tests don't use the `FlutterDriver` API, they
@@ -47,28 +48,27 @@ import 'dart:async';
4748
import 'package:integration_test/integration_test_driver.dart';
4849
4950
Future<void> main() async => integrationDriver();
50-
5151
```
5252

5353
To run a example app test with Flutter driver:
5454

55-
```
55+
```sh
5656
cd example
5757
flutter drive test/<package_name>_integration.dart
5858
```
5959

6060
To test plugin APIs using Flutter driver:
6161

62-
```
62+
```sh
6363
cd example
64-
flutter drive --driver=test_driver/<package_name>_test.dart test/<package_name>_e2e.dart
64+
flutter drive --driver=test_driver/<package_name>_test.dart test/<package_name>_integration_test.dart
6565
```
6666

6767
You can run tests on web in release or profile mode.
6868

6969
First you need to make sure you have downloaded the driver for the browser.
7070

71-
```
71+
```sh
7272
cd example
7373
flutter drive -v --target=test_driver/<package_name>dart -d web-server --release --browser-name=chrome
7474
```
@@ -84,7 +84,7 @@ this test file MainActivityTest.java or another name of your choice.
8484
package com.example.myapp;
8585

8686
import androidx.test.rule.ActivityTestRule;
87-
import dev.flutter.plugins.e2e.FlutterTestRunner;
87+
import dev.flutter.plugins.integration_test.FlutterTestRunner;
8888
import org.junit.Rule;
8989
import org.junit.runner.RunWith;
9090

@@ -99,7 +99,7 @@ Update your application's **myapp/android/app/build.gradle** to make sure it
9999
uses androidx's version of AndroidJUnitRunner and has androidx libraries as a
100100
dependency.
101101

102-
```
102+
```gradle
103103
android {
104104
...
105105
defaultConfig {
@@ -117,10 +117,10 @@ dependencies {
117117
}
118118
```
119119

120-
To e2e test on a local Android device (emulated or physical):
120+
To run a test on a local Android device (emulated or physical):
121121

122-
```
123-
./gradlew app:connectedAndroidTest -Ptarget=`pwd`/../test_driver/<package_name>_e2e.dart
122+
```sh
123+
./gradlew app:connectedAndroidTest -Ptarget=`pwd`/../test_driver/<package_name>_integration_test.dart
124124
```
125125

126126
## Firebase Test Lab
@@ -130,7 +130,7 @@ the guides in the [Firebase test lab
130130
documentation](https://firebase.google.com/docs/test-lab/?gclid=EAIaIQobChMIs5qVwqW25QIV8iCtBh3DrwyUEAAYASAAEgLFU_D_BwE)
131131
to set up a project.
132132

133-
To run an e2e test on Android devices using Firebase Test Lab, use gradle commands to build an
133+
To run a test on Android devices using Firebase Test Lab, use gradle commands to build an
134134
instrumentation test for Android, after creating `androidTest` as suggested in the last section.
135135

136136
```bash
@@ -172,10 +172,10 @@ target 'Runner' do
172172
end
173173
```
174174

175-
To e2e test on your iOS device (simulator or real), rebuild your iOS targets with Flutter tool.
175+
To run a test on your iOS device (simulator or real), rebuild your iOS targets with Flutter tool.
176176

177-
```
178-
flutter build ios -t test_driver/<package_name>_e2e.dart (--simulator)
177+
```sh
178+
flutter build ios -t test_driver/<package_name>_integration_test.dart (--simulator)
179179
```
180180

181181
Open Xcode project (by default, it's `ios/Runner.xcodeproj`). Create a test target
@@ -184,9 +184,9 @@ change the code. You can change `RunnerTests.m` to the name of your choice.
184184

185185
```objective-c
186186
#import <XCTest/XCTest.h>
187-
#import <e2e/E2EIosTest.h>
187+
#import <integration_test/IntegrationTestIosTest.h>
188188

189-
E2E_IOS_RUNNER(RunnerTests)
189+
INTEGRATION_TEST_IOS_RUNNER(RunnerTests)
190190
```
191191
192-
Now you can start RunnerTests to kick out e2e tests!
192+
Now you can start RunnerTests to kick out integration tests!

packages/integration_test/example/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# e2e_example
1+
# integration_test_example
22

3-
Demonstrates how to use the e2e plugin.
3+
Demonstrates how to use the `package:integration_test`.
44

55
## Getting Started
66

packages/integration_test/ios/Classes/IntegrationTestPlugin.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#import "IntegrationTestPlugin.h"
22

3-
static NSString *const kIntegrationTestPluginChannel = @"plugins.flutter.io/integratoin_test";
3+
static NSString *const kIntegrationTestPluginChannel = @"plugins.flutter.io/integration_test";
44
static NSString *const kMethodTestFinished = @"allTestsFinished";
55

66
@interface IntegrationTestPlugin ()

0 commit comments

Comments
 (0)