Updated README
This commit is contained in:
parent
f42a15d482
commit
2ac54f0f31
50
README.md
50
README.md
|
@ -48,7 +48,9 @@ targets:
|
||||||
# Allows the code generator to target files outside of the lib folder
|
# Allows the code generator to target files outside of the lib folder
|
||||||
- integration_test/**.dart
|
- integration_test/**.dart
|
||||||
```
|
```
|
||||||
3. Add the following file (and folder) `\test_driver\integration_test_driver.dart`. This file is the entry point to run your tests. See `https://flutter.dev/docs/testing/integration-tests` for more information.
|
3. Add the following file (and folder) `\test_driver\integration_test_driver.dart`. This file is the entry point to run your tests.
|
||||||
|
If you want ot use the flutter test command approach, you will not need this file (and be unused when it is created).
|
||||||
|
See `https://flutter.dev/docs/testing/integration-tests` for more information.
|
||||||
```dart
|
```dart
|
||||||
import 'package:integration_test/integration_test_driver.dart' as integration_test_driver;
|
import 'package:integration_test/integration_test_driver.dart' as integration_test_driver;
|
||||||
|
|
||||||
|
@ -83,25 +85,25 @@ import 'package:example_with_integration_test/main.dart' as app;
|
||||||
|
|
||||||
part 'gherkin_suite_test.g.dart';
|
part 'gherkin_suite_test.g.dart';
|
||||||
|
|
||||||
@GherkinTestSuite()
|
@GherkinTestSuite(
|
||||||
void main() {
|
featurePaths: <String>['integration_test/features/**.feature'],
|
||||||
executeTestSuite(
|
executionOrder: ExecutionOrder.sequential)
|
||||||
FlutterTestConfiguration.DEFAULT([])
|
Future<void> main() async {
|
||||||
..reporters = [
|
if (Config().restoreDatabase) {
|
||||||
StdoutReporter(MessageLevel.error)
|
await MakeSnapshotCommand().action(null);
|
||||||
..setWriteLineFn(print)
|
}
|
||||||
..setWriteFn(print),
|
var configuration = FlutterTestConfiguration(
|
||||||
ProgressReporter()
|
reporters: [
|
||||||
..setWriteLineFn(print)
|
TestRunSummaryReporter(),
|
||||||
..setWriteFn(print),
|
JsonReporter(
|
||||||
TestRunSummaryReporter()
|
writeReport: (_, __) => Future<void>.value(),
|
||||||
..setWriteLineFn(print)
|
),
|
||||||
..setWriteFn(print),
|
],
|
||||||
JsonReporter(
|
);
|
||||||
writeReport: (_, __) => Future<void>.value(),
|
|
||||||
),
|
await executeTestSuite(
|
||||||
],
|
configuration: configuration,
|
||||||
(World world) => app.main(),
|
appMainFunction: (World world) async => app.main(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
@ -114,6 +116,14 @@ flutter pub run build_runner build
|
||||||
```
|
```
|
||||||
flutter drive --driver=test_driver/integration_test_driver.dart --target=integration_test/gherkin_suite_test.dart
|
flutter drive --driver=test_driver/integration_test_driver.dart --target=integration_test/gherkin_suite_test.dart
|
||||||
```
|
```
|
||||||
|
|
||||||
|
If you do not want to use the flutter drive command, but the flutter test command you need to change some aspects.
|
||||||
|
It is REQUIRED that in `integration_test\gherkin_suite_test.dart` the executeTestSuite is awaited.
|
||||||
|
And then you can run your test command:
|
||||||
|
```
|
||||||
|
flutter test integration_test/gherkin_suite_test.dart
|
||||||
|
```
|
||||||
|
|
||||||
10. You can debug the tests by adding a breakpoint to line 12 in `integration_test\gherkin_suite_test.dart` and adding the below to your `.vscode\launch.json` file:
|
10. You can debug the tests by adding a breakpoint to line 12 in `integration_test\gherkin_suite_test.dart` and adding the below to your `.vscode\launch.json` file:
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue