From fff1a1340c6ae1158806a95c5c86b9603172fc6a Mon Sep 17 00:00:00 2001 From: Julia Borkowska Date: Wed, 4 Dec 2024 12:48:59 +0100 Subject: [PATCH] wip --- docs/documentation/index.mdx | 790 +++++++++++++++++------------- docs/overview/getting-started.mdx | 4 +- 2 files changed, 444 insertions(+), 350 deletions(-) diff --git a/docs/documentation/index.mdx b/docs/documentation/index.mdx index 083343cbd..15a1b820d 100644 --- a/docs/documentation/index.mdx +++ b/docs/documentation/index.mdx @@ -1,5 +1,5 @@ --- -title: Getting started +title: Install Patrol --- Check out our video version of this tutorial on YouTube! @@ -25,90 +25,100 @@ Check out our video version of this tutorial on YouTube! GitHub. -### Add dependency on `patrol` - -If you haven't already, add a dependency on the `patrol` package in the -`dev_dependencies` section of `pubspec.yaml`. `patrol` package requires -Android SDK version 21 or higher. - -``` -flutter pub add patrol --dev -``` - -### Configure Patrol in `pubspec.yaml` - -Create `patrol` section in your `pubspec.yaml`: - -```yaml title="pubspec.yaml" -dependencies: - # ... - -dev_dependencies: - # ... - -patrol: - app_name: My App - android: - package_name: com.example.myapp - ios: - bundle_id: com.example.MyApp - macos: - bundle_id: com.example.macos.MyApp -``` - -If you don't know where to get `package_name` and `bundle_id` from, see the [FAQ] section. - -### Install `patrol_cli` - -[Patrol CLI] (command-line interface) is a small program that enables running -Patrol UI tests. It is necessary to run UI tests (`flutter test` won't work! [Here's why]). - -1. Install `patrol_cli` executable: - - ``` - flutter pub global activate patrol_cli - ``` - - - Make sure to add `patrol` to your `PATH` environment variable. - It's explained how to do it in the [README](https://pub.dev/packages/patrol_cli#installation). - - -2. Verify that installation was successful and your environment is set up properly: - - ``` - patrol doctor - ``` - Example output: - ``` - Patrol CLI version: 2.3.1+1 - Android: - • Program adb found in /Users/username/Library/Android/sdk/platform-tools/adb - • Env var $ANDROID_HOME set to /Users/username/Library/Android/sdk - iOS / macOS: - • Program xcodebuild found in /usr/bin/xcodebuild - • Program ideviceinstaller found in /opt/homebrew/bin/ideviceinstaller - ``` - Be sure that for the platform you want to run the test on, all the checks are green. - -Patrol CLI invokes the Flutter CLI for certain commands. To override the command used, -pass the `--flutter-command` argument or set the `PATROL_FLUTTER_COMMAND` environment -variable. This supports FVM (by setting the value to `fvm flutter`), puro (`puro flutter`) -and potentially other version managers. - -### Integrate with native side - -The 3 first steps were common across platforms. The rest is platform-specific. + + + Install `patrol_cli`: + ``` + flutter pub global activate patrol_cli + ``` + + [Patrol CLI] (command-line interface) is a small program that enables running + Patrol UI tests. It is necessary to run UI tests (`flutter test` won't work! [Here's why]). + + Make sure to add `patrol` to your `PATH` environment variable. + It's explained in the [README](https://pub.dev/packages/patrol_cli#installation). + -Psst... Android is a bit easier to set up, so we recommend starting with it! - + + Verify that installation was successful and your environment is set up properly: - 1. Go to **android/app/src/androidTest/java/com/example/myapp/** in your project + ``` + patrol doctor + ``` + Example output: + ``` + Patrol CLI version: 2.3.1+1 + Android: + • Program adb found in /Users/username/Library/Android/sdk/platform-tools/adb + • Env var $ANDROID_HOME set to /Users/username/Library/Android/sdk + iOS / macOS: + • Program xcodebuild found in /usr/bin/xcodebuild + • Program ideviceinstaller found in /opt/homebrew/bin/ideviceinstaller + ``` + Be sure that for the platform you want to run the test on, all the checks are green. + + + + Patrol CLI invokes the Flutter CLI for certain commands. To override the command used, + pass the `--flutter-command` argument or set the `PATROL_FLUTTER_COMMAND` environment + variable. This supports FVM (by setting the value to `fvm flutter`), puro (`puro flutter`) + and potentially other version managers. + + + + Add a dependency on the `patrol` package in the + `dev_dependencies` section of `pubspec.yaml`. `patrol` package requires + Android SDK version 21 or higher. + + ``` + flutter pub add patrol --dev + ``` + + + + Create `patrol` section in your `pubspec.yaml`: + + ```yaml title="pubspec.yaml" + dependencies: + # ... + + dev_dependencies: + # ... + + patrol: + app_name: My App + android: + package_name: com.example.myapp + ios: + bundle_id: com.example.MyApp + macos: + bundle_id: com.example.macos.MyApp + ``` + + + If you don't know where to get `package_name` and `bundle_id` from, see the [FAQ] section. + + + + + + Integrate with native side + + The 3 first steps were common across platforms. The rest is platform-specific. + + Psst... Android is a bit easier to set up, so we recommend starting with it! + + + + + Go to **android/app/src/androidTest/java/com/example/myapp/** in your project directory. If there are no such folders, create them. **Remember to replace `/com/example/myapp/` with the path created by your app's package name.** - - 2. Create a file named `MainActivityTest.java` and copy there the code below. + + + + Create a file named `MainActivityTest.java` and copy there the code below. ```java title="MainActivityTest.java" package com.example.myapp; // replace "com.example.myapp" with your app's package @@ -146,308 +156,409 @@ Psst... Android is a bit easier to set up, so we recommend starting with it! } } ``` + - 3. Go to the **build.gradle** file, located in **android/app** folder in your + + Go to the **build.gradle** file, located in **android/app** folder in your project directory. + - 4. Add these 2 lines to the `defaultConfig` section: + + Add these 2 lines to the `defaultConfig` section: ```groovy testInstrumentationRunner "pl.leancode.patrol.PatrolJUnitRunner" testInstrumentationRunnerArguments clearPackageData: "true" ``` + - 5. Add this section to the `android` section: + + Add this section to the `android` section: ```groovy testOptions { execution "ANDROIDX_TEST_ORCHESTRATOR" } ``` + - 6. Add this line to `dependencies` section: + + Add this line to `dependencies` section: ```groovy androidTestUtil "androidx.test:orchestrator:1.4.2" ``` + + - - Bear in mind that ProGuard can lead to some problems if not well configured, potentially causing issues such as `ClassNotFoundException`s. - Keep all the Patrol packages or disable ProGuard in `android/app/build.gradle`: - ```groovy + + Bear in mind that ProGuard can lead to some problems if not well configured, potentially causing issues such as `ClassNotFoundException`s. + Keep all the Patrol packages or disable ProGuard in `android/app/build.gradle`: + ```groovy + ... + buildTypes { + release { ... - buildTypes { - release { - ... - } - debug { - minifyEnabled false - shrinkResources false - } - } - ``` - - - - - - - 1. Open `ios/Runner.xcworkspace` in Xcode. - - 2. Create a test target if you do not already have one (see the screenshot below - for the reference). Select `File > New > Target...` and select `UI Testing Bundle`. - Change the `Product Name` to `RunnerUITests`. Set the `Organization Identifier` - to be the same as for the `Runner` (no matter if you app has flavors or not). - For our example app, it's `com.example.MyApp` just as in the `pubspec.yaml` file. - Make sure `Target to be Tested` is set to `Runner` and language is set to `Objective-C`. - Select `Finish`. - - ![Xcode iOS test target](/assets/ios_test_target.png) - - 3. 2 files are created: `RunnerUITests.m` and `RunnerUITestsLaunchTests.m`. - Delete `RunnerUITestsLaunchTests.m` **through Xcode** by clicking on it and - selecting `Move to Trash`. - - 4. Make sure that the **iOS Deployment Target** of `RunnerUITests` within the - **Build Settings** section is the same as `Runner`. - The minimum supported **iOS Deployment Target** is `11.0`. For the - [example app](https://github.com/leancodepl/patrol/tree/master/packages/patrol/example), - we set it to `13.0` because it's required by the app dependencies. - - ![Xcode iOS deployment target](/assets/ios_deployment_target.png) - - ![Xcode iOS deployment target 2](/assets/ios_deployment_target_2.png) - - 5. Replace contents of `RunnerUITests.m` file with the following: - - ```objective-c title="ios/RunnerUITests/RunnerUITests.m" - @import XCTest; - @import patrol; - @import ObjectiveC.runtime; - - PATROL_INTEGRATION_TEST_IOS_RUNNER(RunnerUITests) - ``` - - Add the newly created target to `ios/Podfile` by embedding in the existing - `Runner` target. - - ```ruby title="ios/Podfile" - target 'Runner' do - # Do not change existing lines. - ... - - target 'RunnerUITests' do - inherit! :complete - end - end - ``` - - 6. Create an empty file `integration_test/example_test.dart` in the root of your Flutter project. From the command line, run - the following command and make sure it completes with no errors: - - ``` - $ flutter build ios --config-only integration_test/example_test.dart - ``` - - 7. Go to your `ios` directory and run: - - ``` - $ pod install --repo-update - ``` - - 8. Open your Xcode project and Make sure that for each build configuration, - the `RunnerUITests` have the same Configuration Set selected as the `Runner`: - - ![Xcode config setup](/assets/ios_runner_configs.png) - - 9. Go to **RunnerUITests** -> **Build Phases** and add 2 new "Run Script Phase" Build Phases. - Name them `xcode_backend build` and `xcode_backend embed_and_thin`. - - ![Xcode config setup](/assets/ios_runner_build_phases_create.png) - - 10. Arrange the newly created Build Phases in the order shown in the screenshot below. - - ![Xcode config setup](/assets/ios_runner_build_phases.png) - - 11. Paste this code into the `xcode_backend build` Build Phase: - - ``` - /bin/sh "$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh" build - ``` - - 12. Paste this code into the `xcode_backend embed_and_thin` Build Phase: - - ``` - /bin/sh "$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh" embed_and_thin - ``` - - 13. Xcode by default also enables a "parallel execution" setting, which - breaks Patrol. Disable it **for all schemes** (if you have more than one): - - - - 14. Go to **RunnerUITests** -> **Build Settings**, search for **User Script Sandboxing** - and make sure it's set to **No**. + } + debug { + minifyEnabled false + shrinkResources false + } + } + ``` + - - - 1. Open `macos/Runner.xcworkspace` in Xcode. - - 2. Create a test target if you do not already have one via `File > New > Target...` - and select `UI Testing Bundle`. Change the `Product Name` to `RunnerUITests`. Make - sure `Target to be Tested` is set to `Runner` and language is set to `Objective-C`. - Select `Finish`. - - 3. 2 files are created: `RunnerUITests.m` and `RunnerUITestsLaunchTests.m`. - Delete `RunnerUITestsLaunchTests.m` **through Xcode**. - - 4. Make sure that the **macOS Deployment Target** of `RunnerUITests` within the - **Build Settings** section is the same as `Runner`. - The minimum supported **macOS Deployment Target** is `10.14`. - - ![Xcode macOS deployment target](/assets/macos_deployment_target.png) + + + + Open `ios/Runner.xcworkspace` in Xcode. + + + + Create a test target if you do not already have one (see the screenshot below + for the reference). Select `File > New > Target...` and select `UI Testing Bundle`. + Change the `Product Name` to `RunnerUITests`. Set the `Organization Identifier` + to be the same as for the `Runner` (no matter if you app has flavors or not). + For our example app, it's `com.example.MyApp` just as in the `pubspec.yaml` file. + Make sure `Target to be Tested` is set to `Runner` and language is set to `Objective-C`. + Select `Finish`. + + ![Xcode iOS test target](/assets/ios_test_target.png) + + + + 2 files are created: `RunnerUITests.m` and `RunnerUITestsLaunchTests.m`. + Delete `RunnerUITestsLaunchTests.m` **through Xcode** by clicking on it and + selecting `Move to Trash`. + + + + Make sure that the **iOS Deployment Target** of `RunnerUITests` within the + **Build Settings** section is the same as `Runner`. + The minimum supported **iOS Deployment Target** is `11.0`. For the + [example app](https://github.com/leancodepl/patrol/tree/master/packages/patrol/example), + we set it to `13.0` because it's required by the app dependencies. + + ![Xcode iOS deployment target](/assets/ios_deployment_target.png) + + ![Xcode iOS deployment target 2](/assets/ios_deployment_target_2.png) + + + + Replace contents of `RunnerUITests.m` file with the following: + + ```objective-c title="ios/RunnerUITests/RunnerUITests.m" + @import XCTest; + @import patrol; + @import ObjectiveC.runtime; + + PATROL_INTEGRATION_TEST_IOS_RUNNER(RunnerUITests) + ``` + + Add the newly created target to `ios/Podfile` by embedding in the existing + `Runner` target. + + ```ruby title="ios/Podfile" + target 'Runner' do + # Do not change existing lines. + ... + + target 'RunnerUITests' do + inherit! :complete + end + end + ``` + + + + Create an empty file `integration_test/example_test.dart` in the root of your Flutter project. From the command line, run + the following command and make sure it completes with no errors: + + ``` + $ flutter build ios --config-only integration_test/example_test.dart + ``` + + + + Go to your `ios` directory and run: + + ``` + $ pod install --repo-update + ``` + + + + Open your Xcode project and Make sure that for each build configuration, + the `RunnerUITests` have the same Configuration Set selected as the `Runner`: + + ![Xcode config setup](/assets/ios_runner_configs.png) + + + + Go to **RunnerUITests** -> **Build Phases** and add 2 new "Run Script Phase" Build Phases. + Name them `xcode_backend build` and `xcode_backend embed_and_thin`. + + ![Xcode config setup](/assets/ios_runner_build_phases_create.png) + + + + Arrange the newly created Build Phases in the order shown in the screenshot below. + + ![Xcode config setup](/assets/ios_runner_build_phases.png) + + + + Paste this code into the `xcode_backend build` Build Phase: + + ``` + /bin/sh "$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh" build + ``` + + + + Paste this code into the `xcode_backend embed_and_thin` Build Phase: + + ``` + /bin/sh "$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh" embed_and_thin + ``` + - ![Xcode macOS deployment target 2](/assets/macos_deployment_target_2.png) + + Xcode by default also enables a "parallel execution" setting, which + breaks Patrol. Disable it **for all schemes** (if you have more than one): - 5. Replace contents of `RunnerUITests.m` file with the following: + + - ```objective-c title="macos/RunnerUITests/RunnerUITests.m" - @import XCTest; - @import patrol; - @import ObjectiveC.runtime; + + Go to **RunnerUITests** -> **Build Settings**, search for **User Script Sandboxing** + and make sure it's set to **No**. + + - PATROL_INTEGRATION_TEST_MACOS_RUNNER(RunnerUITests) - ``` + - Add the newly created target to `macos/Podfile` by embedding in the existing - `Runner` target. + - ```ruby title="macos/Podfile" - target 'Runner' do - # Do not change existing lines. - ... + + + Open `macos/Runner.xcworkspace` in Xcode. - target 'RunnerUITests' do - inherit! :complete - end - end - ``` + + Create a test target if you do not already have one via `File > New > Target...` + and select `UI Testing Bundle`. Change the `Product Name` to `RunnerUITests`. Make + sure `Target to be Tested` is set to `Runner` and language is set to `Objective-C`. + Select `Finish`. + - 6. Create an empty file `integration_test/example_test.dart` in the root of your Flutter project. From the command line, run: + + 2 files are created: `RunnerUITests.m` and `RunnerUITestsLaunchTests.m`. + Delete `RunnerUITestsLaunchTests.m` **through Xcode**. + - ``` - $ flutter build macos --config-only integration_test/example_test.dart - ``` + + Make sure that the **macOS Deployment Target** of `RunnerUITests` within the + **Build Settings** section is the same as `Runner`. + The minimum supported **macOS Deployment Target** is `10.14`. - 7. Go to your `macos` directory and run: + ![Xcode macOS deployment target](/assets/macos_deployment_target.png) - ``` - $ pod install --repo-update - ``` + ![Xcode macOS deployment target 2](/assets/macos_deployment_target_2.png) + - 8. Go to **RunnerUITests** -> **Build Phases** and add 2 new "Run Script Phase" Build Phases. - Rename them to `xcode_backend build` and `xcode_backend embed_and_thin` by double clicking - on their names. + + Replace contents of `RunnerUITests.m` file with the following: - ![Xcode config setup](/assets/macos_runner_build_phases_create.png) + ```objective-c title="macos/RunnerUITests/RunnerUITests.m" + @import XCTest; + @import patrol; + @import ObjectiveC.runtime; - 9. Arrange the newly created Build Phases in the order shown in the screenshot below. + PATROL_INTEGRATION_TEST_MACOS_RUNNER(RunnerUITests) + ``` - ![Xcode config setup](/assets/macos_runner_build_phases.png) + Add the newly created target to `macos/Podfile` by embedding in the existing + `Runner` target. - 10. Paste this code into the first `macos_assemble build` Build Phase: + ```ruby title="macos/Podfile" + target 'Runner' do + # Do not change existing lines. + ... - ``` - /bin/sh "$FLUTTER_ROOT/packages/flutter_tools/bin/macos_assemble.sh" build - ``` + target 'RunnerUITests' do + inherit! :complete + end + end + ``` + - 11. Paste this code into the second `macos_assemble embed` Build Phase: + + Create an empty file `integration_test/example_test.dart` in the root of your Flutter project. From the command line, run: - ``` - /bin/sh "$FLUTTER_ROOT/packages/flutter_tools/bin/macos_assemble.sh" embed - ``` - - 12. Xcode by default also enables a "parallel execution" setting, which - breaks Patrol. Disable it **for all schemes** (if you have more than one): - - - - 13. Go to **RunnerUITests** -> **Build Settings**, search for **User Script Sandboxing** - and make sure it's set to **No**. - - 14. Go to **Runner** -> **Signing & Capabilities**. Make sure that in all **App Sandbox** - sections, **Incoming Connections (Server)** and **Outgoing Connections (Client)** checkboxes - are checked. - - ![Xcode entitlements setup](/assets/macos_entitlements.png) - - 15. **Copy** `DebugProfile.entitlements` and `Release.entitlements` files from `macos/Runner` - to `macos/RunnerUITests` directory. - - 16. Go to **RunnerUITests** -> **Build Settings** and set **Code Signing Entitlements** to - `RunnerUITests/DebugProfile.entitlements` for **Debug** and **Profile** configuration and to - `RunnerUITests/Release.entitlements` for **Release** configuration. - - ![Xcode RunnerUITests entitlements setup](/assets/macos_ui_entitlements.png) + ``` + $ flutter build macos --config-only integration_test/example_test.dart + ``` + + + + Go to your `macos` directory and run: + + ``` + $ pod install --repo-update + ``` + + + + Go to **RunnerUITests** -> **Build Phases** and add 2 new "Run Script Phase" Build Phases. + Rename them to `xcode_backend build` and `xcode_backend embed_and_thin` by double clicking + on their names. + + ![Xcode config setup](/assets/macos_runner_build_phases_create.png) + + + + Arrange the newly created Build Phases in the order shown in the screenshot below. + + ![Xcode config setup](/assets/macos_runner_build_phases.png) + + + + Paste this code into the first `macos_assemble build` Build Phase: + + ``` + /bin/sh "$FLUTTER_ROOT/packages/flutter_tools/bin/macos_assemble.sh" build + ``` + + + + Paste this code into the second `macos_assemble embed` Build Phase: + + ``` + /bin/sh "$FLUTTER_ROOT/packages/flutter_tools/bin/macos_assemble.sh" embed + ``` + + + + Xcode by default also enables a "parallel execution" setting, which + breaks Patrol. Disable it **for all schemes** (if you have more than one): + + + + + + Go to **RunnerUITests** -> **Build Settings**, search for **User Script Sandboxing** + and make sure it's set to **No**. + + + + Go to **Runner** -> **Signing & Capabilities**. Make sure that in all **App Sandbox** + sections, **Incoming Connections (Server)** and **Outgoing Connections (Client)** checkboxes + are checked. + + ![Xcode entitlements setup](/assets/macos_entitlements.png) + + + + **Copy** `DebugProfile.entitlements` and `Release.entitlements` files from `macos/Runner` + to `macos/RunnerUITests` directory. + + + + Go to **RunnerUITests** -> **Build Settings** and set **Code Signing Entitlements** to + `RunnerUITests/DebugProfile.entitlements` for **Debug** and **Profile** configuration and to + `RunnerUITests/Release.entitlements` for **Release** configuration. + + ![Xcode RunnerUITests entitlements setup](/assets/macos_ui_entitlements.png) + + + + + + + Create a simple integration test + + Let's create a dummy Flutter integration test that you'll use to verify + that Patrol is correctly set up. + + Paste the following code into `integration_test/example_test.dart`: + + ```dart title="integration_test/example_test.dart" + import 'dart:io'; + + import 'package:flutter/material.dart'; + import 'package:flutter_test/flutter_test.dart'; + import 'package:patrol/patrol.dart'; + + void main() { + patrolTest( + 'counter state is the same after going to home and switching apps', + ($) async { + // Replace later with your app's main widget + await $.pumpWidgetAndSettle( + MaterialApp( + home: Scaffold( + appBar: AppBar(title: const Text('app')), + backgroundColor: Colors.blue, + ), + ), + ); + + expect($('app'), findsOneWidget); + if (!Platform.isMacOS) { + await $.native.pressHome(); + } + }, + ); + } + ``` - + It does only 2 things: -### Create a simple integration test - -Let's create a dummy Flutter integration test that you'll use to verify -that Patrol is correctly set up. - -Paste the following code into `integration_test/example_test.dart`: - -```dart title="integration_test/example_test.dart" -import 'dart:io'; - -import 'package:flutter/material.dart'; -import 'package:flutter_test/flutter_test.dart'; -import 'package:patrol/patrol.dart'; - -void main() { - patrolTest( - 'counter state is the same after going to home and switching apps', - ($) async { - // Replace later with your app's main widget - await $.pumpWidgetAndSettle( - MaterialApp( - home: Scaffold( - appBar: AppBar(title: const Text('app')), - backgroundColor: Colors.blue, - ), - ), - ); - - expect($('app'), findsOneWidget); - if (!Platform.isMacOS) { - await $.native.pressHome(); - } - }, - ); -} -``` + - first, it finds a text `app` + - then (on mobile platforms), it exits to home screen -It does only 2 things: + It's a very simple test, but it's enough to verify that Patrol is correctly set + up. To run `integration_test/example_test.dart` on a connected Android, iOS or macOS device: -- first, it finds a text `app` -- then (on mobile platforms), it exits to home screen + ``` + patrol test -t integration_test/example_test.dart + ``` -It's a very simple test, but it's enough to verify that Patrol is correctly set -up. To run `integration_test/example_test.dart` on a connected Android, iOS or macOS device: + If the setup is successful, you should see a summary like one below. + ``` + Test summary: + 📝 Total: 1 + ✅ Successful: 1 + ❌ Failed: 0 + ⏩ Skipped: 0 + 📊 Report: + ⏱️ Duration: 4s + ``` + If something went wrong, please proceed to the [FAQ] section which might + contain an answer to your issue. + + - ``` - patrol test -t integration_test/example_test.dart - ``` + + To prevent issues during Patrol tests, please follow these guidelines: - If the setup is successful, you should see a **TEST PASSED** message. - If something went wrong, please proceed to the [FAQ] section which might - contain an answer to your issue. + 1. Do not call `IntegrationTestWidgetsFlutterBinding.ensureInitialized`. + Patrol automatically initializes its own test binding. + 2. Do not modify the global `FlutterError.onError` callback. Patrol's + internals depend on it. Keep in mind that this callback can also + be modified by popular packages such as Sentry or Crashlytics. + In such cases, you can disable them for Patrol tests. + + If you are looking for a working example of a Flutter app with Patrol tests, + check out the [example app](https://github.com/leancodepl/patrol/tree/master/packages/patrol/example) + in the patrol repository. + + + ### Setup with app flavors If your app is using flavors, then you can pass them like so: ``` @@ -468,24 +579,6 @@ up. To run `integration_test/example_test.dart` on a connected Android, iOS or m macos: bundle_id: com.example.macos.MyApp ``` - - - - To prevent issues during Patrol tests, please follow these guidelines: - - 1. Do not call `IntegrationTestWidgetsFlutterBinding.ensureInitialized`. - Patrol automatically initializes its own test binding. - 2. Do not modify the global `FlutterError.onError` callback. Patrol's - internals depend on it. Keep in mind that this callback can also - be modified by popular packages such as Sentry or Crashlytics. - In such cases, you can disable them for Patrol tests. - - - - If you are looking for a working example of a Flutter app with Patrol tests, - check out the [example app](https://github.com/leancodepl/patrol/tree/master/packages/patrol/example) - in the patrol repository. - ### FAQ @@ -494,8 +587,7 @@ up. To run `integration_test/example_test.dart` on a connected Android, iOS or m and make sure that the versions of `patrol` and `patrol_cli` you are using are compatible. - + To run your application within the patrol test, you need to call `$.pumpWidgetAndSettle()`, and pass your application's main widget to it. Be sure that you registered all the necessary services before calling `$.pumpWidgetAndSettle()`. diff --git a/docs/overview/getting-started.mdx b/docs/overview/getting-started.mdx index f3b90177b..28094aec0 100644 --- a/docs/overview/getting-started.mdx +++ b/docs/overview/getting-started.mdx @@ -1,4 +1,6 @@ -# Getting started +--- +title: Getting started +--- Try out Patrol's capabilities with few clicks! Follow this tutorial and get to know our framework.