README.md 1.4 KB
Newer Older
1
# Flutter Web integration tests
2

3
To run the tests in this package [download][1] the chromedriver matching the
4 5 6
version of Chrome. To find out the version of your Chrome installation visit
chrome://version.

7
Start `chromedriver` using the following command:
8 9

```
10
chromedriver --port=4444
11 12
```

13 14 15 16 17 18
An integration test is run using the `flutter drive` command. Some tests are
written for a specific [web renderer][2] and/or specific [build mode][4].
Before running a test, check the `_runWebLongRunningTests` function defined in
[dev/bots/test.dart][3], and determine the right web renderer and the build
mode you'd like to run the test in.

19
Here's an example of running an integration test:
20 21

```
22 23 24 25 26
flutter drive --target=test_driver/text_editing_integration.dart \
  -d web-server \
  --browser-name=chrome \
  --profile \
  --web-renderer=html
27 28
```

29 30 31
This example runs the test in profile mode (`--profile`) using the HTML
renderer (`--web-renderer=html`).

32 33 34 35 36 37 38
More resources:

* chromedriver: https://chromedriver.chromium.org/getting-started
* FlutterDriver: https://github.com/flutter/flutter/wiki/Running-Flutter-Driver-tests-with-Web
* `package:integration_test`: https://pub.dev/packages/integration_test

[1]: https://chromedriver.chromium.org/downloads
39 40 41
[2]: https://flutter.dev/docs/development/tools/web-renderers
[3]: https://github.com/flutter/flutter/blob/master/dev/bots/test.dart
[4]: https://flutter.dev/docs/testing/build-modes