patrol_cli 0.6.1 copy "patrol_cli: ^0.6.1" to clipboard
patrol_cli: ^0.6.1 copied to clipboard

outdated

Command-line tool for Patrol, a powerful Flutter-native UI testing framework.

patrol_cli #

patrol_cli on pub.dev codestyle

Command-line tool to make working with patrol easier.

Installation #

From pub.dev #

$ dart pub global activate patrol_cli

From git #

  1. Make sure that you have Dart >= 2.16 installed.

    $ dart --version
    
  2. Clone the repo.

  3. Go to packages/patrol_cli.

  4. Run dart pub global activate --source path .

Troubleshooting #

If you can't run patrol from the terminal and the error is something along the lines of "command not found", make sure that you've added appropriate directories to PATH:

  • on Unix-like systems, add $HOME/.pub-cache/bin
  • on Windows, add %USERPROFILE%\AppData\Local\Pub\Cache\bin

Usage #

First run #

On first run, patrol will download artifacts it needs to the artifact path. By default it is $HOME/.patrol, but you can change it by setting PATROL_CACHE environment variable.

To learn about commands, run:

$ patrol --help

Bootstrap #

To use Patrol in your Flutter project, you need 4 things:

  1. have patrol.toml file in the root of the project (i.e next to pubspec.yaml)
  2. have patrol added as a dev_dependency in pubspec.yaml
  3. have integration_test added as a dev_dependency in pubspec.yaml
  4. have test_driver/integration_test.dart
  5. have integration_test/app_test.dart

Run patrol bootstrap to automatically do 1, 2, 3, 4, and most of 5.

First drive #

Make sure that you have at least one device attached:

$ patrol devices

To run the simple integration test generated by patrol bootstrap:

$ patrol drive