|
1 | 1 | # Flutter Web integration tests
|
2 | 2 |
|
3 | 3 | To run the tests in this package [download][1] the chromedriver matching the
|
4 |
| -version of Chrome. To find out the version of your Chrome installation visit chrome://version. |
| 4 | +version of Chrome. To find out the version of your Chrome installation visit |
| 5 | +chrome://version. |
| 6 | + |
5 | 7 | Start `chromedriver` using the following command:
|
6 | 8 |
|
7 | 9 | ```
|
8 | 10 | chromedriver --port=4444
|
9 | 11 | ```
|
10 | 12 |
|
| 13 | +An integration test is run using the `flutter drive` command. Some tests are |
| 14 | +written for a specific [web renderer][2] and/or specific [build mode][4]. |
| 15 | +Before running a test, check the `_runWebLongRunningTests` function defined in |
| 16 | +[dev/bots/test.dart][3], and determine the right web renderer and the build |
| 17 | +mode you'd like to run the test in. |
| 18 | + |
11 | 19 | Here's an example of running an integration test:
|
12 | 20 |
|
13 | 21 | ```
|
14 |
| -flutter drive --target=test_driver/text_editing_integration.dart -d web-server --browser-name=chrome |
| 22 | +flutter drive --target=test_driver/text_editing_integration.dart \ |
| 23 | + -d web-server \ |
| 24 | + --browser-name=chrome \ |
| 25 | + --profile \ |
| 26 | + --web-renderer=html |
15 | 27 | ```
|
16 | 28 |
|
| 29 | +This example runs the test in profile mode (`--profile`) using the HTML |
| 30 | +renderer (`--web-renderer=html`). |
| 31 | + |
17 | 32 | More resources:
|
18 | 33 |
|
19 | 34 | * chromedriver: https://chromedriver.chromium.org/getting-started
|
20 | 35 | * FlutterDriver: https://github.com/flutter/flutter/wiki/Running-Flutter-Driver-tests-with-Web
|
21 | 36 | * `package:integration_test`: https://pub.dev/packages/integration_test
|
22 | 37 |
|
23 | 38 | [1]: https://chromedriver.chromium.org/downloads
|
| 39 | +[2]: https://flutter.dev/docs/development/tools/web-renderers |
| 40 | +[3]: https://github.com/flutter/flutter/blob/master/dev/bots/test.dart |
| 41 | +[4]: https://flutter.dev/docs/testing/build-modes |
0 commit comments