Testing

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

See flutter.dev > Integration testing for more info.

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:

  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. 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.