From 3ec96921adef84ab2cb7a9f43dde160ffc09e5d0 Mon Sep 17 00:00:00 2001 From: Bartek Pacia Date: Wed, 28 Jun 2023 18:15:53 +0200 Subject: [PATCH] Update advanced.mdx (#1418) Removed info about `tearDown()` and `setUp()` callbacks when using native automation. These callbacks must not be used in Patrol 2.0. See #1341 for more details. --- docs/native/advanced.mdx | 35 ----------------------------------- 1 file changed, 35 deletions(-) diff --git a/docs/native/advanced.mdx b/docs/native/advanced.mdx index 52fa6a30d..ae31197fc 100644 --- a/docs/native/advanced.mdx +++ b/docs/native/advanced.mdx @@ -34,40 +34,5 @@ Future main() async { } ``` -### setUp() and tearDown() callbacks - -Sometimes, you might want to perform additional clean up after the test, no -matter if it failed or passed. - -```dart title="integration_test/app_test.dart" -Future main() async { - tearDown(() async { - final automator = NativeAutomator( - config: NativeAutomatorConfig( - packageName: 'your.app.id.on.android', - bundleId: 'your.app.id.on.ios', - ), - ); - await automator.configure(); - await automator.disableCellular(); - }); - - patrolTest( - 'test description', - nativeAutomation: true, - ($) async { - await createApp($); - - await $.native.enableCellular(); - await $.pumpAndSettle(duration: Duration(seconds: 3)); - - // ... - - throw Exception('test failed'); - }, - ); -} -``` - [test_widgets]: https://api.flutter.dev/flutter/flutter_test/testWidgets.html [patrol_test]: https://pub.dev/documentation/patrol/latest/patrol/patrolTest.html