Skip to content

Commit a6a251e

Browse files
committed
Add Patrol docs to integration test
1 parent 47ff756 commit a6a251e

5 files changed

Lines changed: 451 additions & 21 deletions

File tree

src/content/cookbook/testing/integration/introduction.md

Lines changed: 41 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,38 @@ To perform these tasks, use *integration tests*.
1616
Integration tests verify the behavior of the complete app.
1717
This test can also be called end-to-end testing or GUI testing.
1818

19-
The Flutter SDK includes the [integration_test][] package.
19+
## Testing frameworks
20+
21+
Flutter supports two main approaches for integration testing:
22+
23+
### `integration_test` package
24+
25+
The Flutter SDK includes the [`integration_test`][integration_test] package.
26+
Tests written with `integration_test` can perform the following tasks:
27+
28+
* Run on the target device.
29+
To test multiple Android or iOS devices, use Firebase Test Lab.
30+
* Run from the host machine with `flutter test integration_test`.
31+
* Use `flutter_test` APIs. This makes integration tests
32+
similar to writing [widget tests][].
33+
34+
However, `integration_test` can't interact with native platform UI,
35+
such as permission dialogs, notifications, or the contents of
36+
platform views.
37+
38+
### `patrol` package
39+
40+
[Patrol][] is an open-source testing framework that builds on top
41+
of Flutter's testing capabilities. It extends `integration_test`
42+
with native interaction support. Patrol lets you:
43+
44+
* Interact with native platform UI, such as permission dialogs,
45+
notifications, and WebViews.
46+
* Access device-level features like toggling Wi-Fi
47+
or adjusting system settings.
48+
* Write more concise tests using [patrol finders][].
49+
50+
To learn more, visit the [Patrol documentation][].
2051

2152
## Terminology
2253

@@ -30,30 +61,27 @@ The Flutter SDK includes the [integration_test][] package.
3061
If you run your app in a web browser or as a desktop application,
3162
the host machine and the target device are the same.
3263

33-
## Dependent package
64+
## Getting started
3465

35-
To run integration tests, add the `integration_test` package
36-
as a dependency for your Flutter app test file.
66+
To use `integration_test`, add it as a dependency for your
67+
Flutter app test file.
3768

3869
To migrate existing projects that use `flutter_driver`,
3970
consult the [Migrating from flutter_driver][] guide.
4071

41-
Tests written with the `integration_test` package
42-
can perform the following tasks.
43-
44-
* Run on the target device.
45-
To test multiple Android or iOS devices, use Firebase Test Lab.
46-
* Run from the host machine with `flutter test integration_test`.
47-
* Use `flutter_test` APIs. This makes integration tests
48-
similar to writing [widget tests][].
72+
To use Patrol, follow the [Patrol setup guide][].
4973

5074
## Use cases for integration testing
5175

5276
The other guides in this section explain how to use integration tests to validate
5377
[functionality][] and [performance][].
5478

79+
[patrol finders]: {{site.pub-pkg}}/patrol_finders
5580
[functionality]: /testing/integration-tests/
56-
[performance]: /cookbook/testing/integration/profiling/
5781
[integration_test]: {{site.repo.flutter}}/tree/main/packages/integration_test
5882
[Migrating from flutter_driver]: /release/breaking-changes/flutter-driver-migration
83+
[Patrol]: {{site.pub-pkg}}/patrol
84+
[Patrol documentation]: https://patrol.leancode.co/
85+
[Patrol setup guide]: https://patrol.leancode.co/getting-started
86+
[performance]: /cookbook/testing/integration/profiling/
5987
[widget tests]: /testing/overview#widget-tests

src/content/testing/overview.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,24 @@ such as iOS Simulator or Android Emulator.
9696
The app under test is typically isolated
9797
from the test driver code to avoid skewing the results.
9898

99+
The Flutter SDK includes the [`integration_test`][] package.
100+
However, this package can't interact with native platform UI,
101+
such as permission dialogs, notifications, or platform views.
102+
For apps that need native interactions, you can use [Patrol][],
103+
an open-source framework that extends Flutter's testing
104+
capabilities with native platform support.
105+
99106
For more information on how to write integration tests, see the [integration
100107
testing page][].
101108

109+
[`integration_test`]: {{site.repo.flutter}}/tree/main/packages/integration_test
110+
[Patrol]: {{site.pub-pkg}}/patrol
111+
102112
### Recipes {:.no_toc}
103113

104114
- [Integration testing concepts](/cookbook/testing/integration/introduction)
115+
- [Write and run an integration test](/testing/integration-tests)
116+
- [Write and run a Patrol test](/testing/patrol-tests)
105117
- [Measure performance with an integration test](/cookbook/testing/integration/profiling)
106118

107119
## Continuous integration services
@@ -119,13 +131,15 @@ integration services, see the following:
119131
* [Test Flutter apps on Travis][]
120132
* [Test Flutter apps on Cirrus][]
121133
* [Codemagic CI/CD for Flutter][]
134+
* [Codemagic CI/CD for Patrol][]
122135
* [Flutter CI/CD with Bitrise][]
123136

124137
[code coverage]: https://en.wikipedia.org/wiki/Code_coverage
125138
[Codemagic CI/CD for Flutter]: https://blog.codemagic.io/getting-started-with-codemagic/
139+
[Codemagic CI/CD for Patrol]: https://docs.codemagic.io/integrations/patrol-integration/
126140
[Continuous delivery using fastlane with Flutter]: /deployment/cd#fastlane
127141
[Flutter CI/CD with Bitrise]: https://devcenter.bitrise.io/en/getting-started/quick-start-guides/getting-started-with-flutter-apps
128142
[Test Flutter apps on Appcircle]: https://blog.appcircle.io/article/flutter-ci-cd-github-ios-android-web#
129143
[Test Flutter apps on Cirrus]: https://cirrus-ci.org/examples/#flutter
130144
[Test Flutter apps on Travis]: {{site.flutter-blog}}/test-flutter-apps-on-travis-3fd5142ecd8c
131-
[integration testing page]: /testing/integration-tests
145+
[integration testing page]: /cookbook/testing/integration/introduction

0 commit comments

Comments
 (0)