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

[multiple_web] Update web plugin testing instructions. #4167

Merged
merged 2 commits into from
Jul 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
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
22 changes: 5 additions & 17 deletions packages/connectivity/connectivity_for_web/example/README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,9 @@
# Testing

This package utilizes the `integration_test` package to run its tests in a web browser.
This package uses `package:integration_test` to run its tests in a web browser.

See [flutter.dev > Integration testing](https://flutter.dev/docs/testing/integration-tests) for more info.
See [Plugin Tests > Web Tests](https://github.com/flutter/flutter/wiki/Plugin-Tests#web-tests)
in the Flutter wiki for instructions to setup and run the tests in this package.

## Running the tests

Make sure you have updated to the latest Flutter master.

1. Check what version of Chrome is running on the machine you're running tests on.

2. Download and install driver for that version from here:
* <https://chromedriver.chromium.org/downloads>

3. Start the driver using `chromedriver --port=4444`

4. Run tests: `flutter drive -d web-server --browser-name=chrome --driver=test_driver/integration_driver.dart --target=integration_test/TEST_NAME.dart`, or (in Linux):

* Single: `./run_test.sh integration_test/TEST_NAME.dart`
* All: `./run_test.sh`
Check [flutter.dev > Integration testing](https://flutter.dev/docs/testing/integration-tests)
for more info.
22 changes: 5 additions & 17 deletions packages/file_selector/file_selector_web/example/README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,9 @@
# Testing

This package utilizes the `integration_test` package to run its tests in a web browser.
This package uses `package:integration_test` to run its tests in a web browser.

See [flutter.dev > Integration testing](https://flutter.dev/docs/testing/integration-tests) for more info.
See [Plugin Tests > Web Tests](https://github.com/flutter/flutter/wiki/Plugin-Tests#web-tests)
in the Flutter wiki for instructions to setup and run the tests in this package.

## Running the tests

Make sure you have updated to the latest Flutter master.

1. Check what version of Chrome is running on the machine you're running tests on.

2. Download and install driver for that version from here:
* <https://chromedriver.chromium.org/downloads>

3. Start the driver using `chromedriver --port=4444`

4. Run tests: `flutter drive -d web-server --browser-name=chrome --driver=test_driver/integration_test.dart --target=integration_test/TEST_NAME.dart`, or (in Linux):

* Single: `./run_test.sh integration_test/TEST_NAME.dart`
* All: `./run_test.sh`
Check [flutter.dev > Integration testing](https://flutter.dev/docs/testing/integration-tests)
for more info.
Original file line number Diff line number Diff line change
@@ -1,31 +1,12 @@
# Testing

This package utilizes the `integration_test` package to run its tests in a web browser.
This package uses `package:integration_test` to run its tests in a web browser.

See [flutter.dev > Integration testing](https://flutter.dev/docs/testing/integration-tests) for more info.
See [Plugin Tests > Web Tests](https://github.com/flutter/flutter/wiki/Plugin-Tests#web-tests)
in the Flutter wiki for instructions to setup and run the tests in this package.

## Running the tests
Check [flutter.dev > Integration testing](https://flutter.dev/docs/testing/integration-tests)
for more info.

Make sure you have updated to the latest Flutter master.

1. Check what version of Chrome is running on the machine you're running tests on.

2. Download and install driver for that version from here:
* <https://chromedriver.chromium.org/downloads>

3. Start the driver using `chromedriver --port=4444`

4. Run tests: `flutter drive -d web-server --browser-name=chrome --driver=test_driver/integration_driver.dart --target=integration_test/TEST_NAME.dart`, or (in Linux):

* Single: `./run_test.sh integration_test/TEST_NAME.dart`
* All: `./run_test.sh`

## Mocks

There's new `.mocks.dart` files next to the test files that use them.

Mock files are [generated by `package:mockito`](https://github.com/dart-lang/mockito/blob/master/NULL_SAFETY_README.md#code-generation). The contents of these files can change with how the mocks are used within the tests, in addition to actual changes in the APIs they're mocking.

Mock files can be updated either manually by running the following command: `flutter pub run build_runner build` (or the `regen_mocks.sh` script), or automatically on each call to the `run_test.sh` script.

Please, add whatever changes show up in mock files to your PRs, or CI will fail.
See [Plugin Tests > Web Tests > Mocks](https://github.com/flutter/flutter/wiki/Plugin-Tests#mocks)
in the Flutter wiki for more information about the `.mocks.dart` files in this package.
22 changes: 5 additions & 17 deletions packages/google_sign_in/google_sign_in_web/example/README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,9 @@
# Testing

This package utilizes the `integration_test` package to run its tests in a web browser.
This package uses `package:integration_test` to run its tests in a web browser.

See [flutter.dev > Integration testing](https://flutter.dev/docs/testing/integration-tests) for more info.
See [Plugin Tests > Web Tests](https://github.com/flutter/flutter/wiki/Plugin-Tests#web-tests)
in the Flutter wiki for instructions to setup and run the tests in this package.

## Running the tests

Make sure you have updated to the latest Flutter master.

1. Check what version of Chrome is running on the machine you're running tests on.

2. Download and install driver for that version from here:
* <https://chromedriver.chromium.org/downloads>

3. Start the driver using `chromedriver --port=4444`

4. Run tests: `flutter drive -d web-server --browser-name=chrome --driver=test_driver/integration_driver.dart --target=integration_test/TEST_NAME.dart`, or (in Linux):

* Single: `./run_test.sh integration_test/TEST_NAME.dart`
* All: `./run_test.sh`
Check [flutter.dev > Integration testing](https://flutter.dev/docs/testing/integration-tests)
for more info.
33 changes: 7 additions & 26 deletions packages/url_launcher/url_launcher_web/example/README.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,12 @@
# Testing

This package utilizes the `integration_test` package to run its tests in a web browser.
This package uses `package:integration_test` to run its tests in a web browser.

See [flutter.dev > Integration testing](https://flutter.dev/docs/testing/integration-tests) for more info.
See [Plugin Tests > Web Tests](https://github.com/flutter/flutter/wiki/Plugin-Tests#web-tests)
in the Flutter wiki for instructions to setup and run the tests in this package.

## Running the tests
Check [flutter.dev > Integration testing](https://flutter.dev/docs/testing/integration-tests)
for more info.

Make sure you have updated to the latest Flutter master.

1. Check what version of Chrome is running on the machine you're running tests on.

2. Download and install driver for that version from here:
* <https://chromedriver.chromium.org/downloads>

3. Start the driver using `chromedriver --port=4444`

4. Run tests: `flutter drive -d web-server --browser-name=chrome --driver=test_driver/integration_test_driver.dart --target=integration_test/TEST_NAME.dart`, or (in Linux):

* Single: `./run_test.sh integration_test/TEST_NAME.dart`
* All: `./run_test.sh`

## Mocks

There's `.mocks.dart` files next to the test files that use them.

They're [generated by Mockito](https://github.com/dart-lang/mockito/blob/master/NULL_SAFETY_README.md#code-generation).

Mocks might be manually re-generated with the following command: `flutter pub run build_runner build`. If there are any changes in the mocks, feel free to commit them.

(Mocks will be auto-generated by the `run_test.sh` script as well.)
See [Plugin Tests > Web Tests > Mocks](https://github.com/flutter/flutter/wiki/Plugin-Tests#mocks)
in the Flutter wiki for more information about the `.mocks.dart` files in this package.
22 changes: 5 additions & 17 deletions packages/video_player/video_player_web/example/README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,9 @@
# Testing

This package utilizes the `integration_test` package to run its tests in a web browser.
This package uses `package:integration_test` to run its tests in a web browser.

See [flutter.dev > Integration testing](https://flutter.dev/docs/testing/integration-tests) for more info.
See [Plugin Tests > Web Tests](https://github.com/flutter/flutter/wiki/Plugin-Tests#web-tests)
in the Flutter wiki for instructions to setup and run the tests in this package.

## Running the tests

Make sure you have updated to the latest Flutter master.

1. Check what version of Chrome is running on the machine you're running tests on.

2. Download and install driver for that version from here:
* <https://chromedriver.chromium.org/downloads>

3. Start the driver using `chromedriver --port=4444`

4. Run tests: `flutter drive -d web-server --browser-name=chrome --driver=test_driver/integration_driver.dart --target=integration_test/TEST_NAME.dart`, or (in Linux):

* Single: `./run_test.sh integration_test/TEST_NAME.dart`
* All: `./run_test.sh`
Check [flutter.dev > Integration testing](https://flutter.dev/docs/testing/integration-tests)
for more info.