diff --git a/packages/patrol_finders/CHANGELOG.md b/packages/patrol_finders/CHANGELOG.md index 3f63b1805..f6a1ea691 100644 --- a/packages/patrol_finders/CHANGELOG.md +++ b/packages/patrol_finders/CHANGELOG.md @@ -1,3 +1,7 @@ +## 2.5.1 + +- Disable printing logs in nested `waitUntilVisible` and `waitUntilExists` calls. + ## 2.5.0 - Update `patrol_log`. diff --git a/packages/patrol_finders/lib/src/custom_finders/patrol_finder.dart b/packages/patrol_finders/lib/src/custom_finders/patrol_finder.dart index e335df835..c28689c7b 100644 --- a/packages/patrol_finders/lib/src/custom_finders/patrol_finder.dart +++ b/packages/patrol_finders/lib/src/custom_finders/patrol_finder.dart @@ -390,7 +390,11 @@ class PatrolFinder implements MatchFinder { wrapWithPatrolLog( action: 'waitUntilExists', color: AnsiCodes.cyan, - function: () => tester.waitUntilExists(this, timeout: timeout), + function: () => tester.waitUntilExists( + this, + timeout: timeout, + enablePatrolLog: false, + ), ); /// Waits until this finder finds at least one visible widget. @@ -400,11 +404,19 @@ class PatrolFinder implements MatchFinder { /// /// Timeout is globally set by [PatrolTester.config.visibleTimeout]. If you /// want to override this global setting, set [timeout]. - Future waitUntilVisible({Duration? timeout}) => + Future waitUntilVisible({ + Duration? timeout, + bool enablePatrolLog = true, + }) => wrapWithPatrolLog( action: 'waitUntilVisible', color: AnsiCodes.cyan, - function: () => tester.waitUntilVisible(this, timeout: timeout), + function: () => tester.waitUntilVisible( + this, + timeout: timeout, + enablePatrolLog: false, + ), + enablePatrolLog: enablePatrolLog, ); /// Returns a finder matching widget of type [T] which also fulfills diff --git a/packages/patrol_finders/lib/src/custom_finders/patrol_tester.dart b/packages/patrol_finders/lib/src/custom_finders/patrol_tester.dart index ddb8d56d4..4c99e9690 100644 --- a/packages/patrol_finders/lib/src/custom_finders/patrol_tester.dart +++ b/packages/patrol_finders/lib/src/custom_finders/patrol_tester.dart @@ -573,7 +573,7 @@ class PatrolTester { enablePatrolLog: enablePatrolLog, function: () async { var viewPatrolFinder = PatrolFinder(finder: view, tester: this); - await viewPatrolFinder.waitUntilVisible(); + await viewPatrolFinder.waitUntilVisible(enablePatrolLog: false); viewPatrolFinder = viewPatrolFinder.hitTestable().first; dragDuration ??= config.dragDuration; settleBetweenScrollsTimeout ??= config.settleBetweenScrollsTimeout; @@ -655,7 +655,7 @@ class PatrolTester { enablePatrolLog: enablePatrolLog, function: () async { var viewPatrolFinder = PatrolFinder(finder: view, tester: this); - await viewPatrolFinder.waitUntilVisible(); + await viewPatrolFinder.waitUntilVisible(enablePatrolLog: false); viewPatrolFinder = viewPatrolFinder.hitTestable().first; dragDuration ??= config.dragDuration; settleBetweenScrollsTimeout ??= config.settleBetweenScrollsTimeout; @@ -719,7 +719,7 @@ class PatrolTester { final scrollablePatrolFinder = await PatrolFinder( finder: finderView, tester: this, - ).waitUntilVisible(); + ).waitUntilVisible(enablePatrolLog: false); AxisDirection direction; if (scrollDirection == null) { @@ -790,7 +790,7 @@ class PatrolTester { final scrollablePatrolFinder = await PatrolFinder( finder: finderView, tester: this, - ).waitUntilVisible(); + ).waitUntilVisible(enablePatrolLog: false); AxisDirection direction; if (scrollDirection == null) { if (finderView.evaluate().first.widget is Scrollable) { diff --git a/packages/patrol_finders/pubspec.yaml b/packages/patrol_finders/pubspec.yaml index 59bd6ff92..77cc61f0b 100644 --- a/packages/patrol_finders/pubspec.yaml +++ b/packages/patrol_finders/pubspec.yaml @@ -1,6 +1,6 @@ name: patrol_finders description: Streamlined, high-level API on top of flutter_test. -version: 2.5.0 +version: 2.5.1 homepage: https://patrol.leancode.co repository: https://github.com/leancodepl/patrol/tree/master/packages/patrol_finders issue_tracker: https://github.com/leancodepl/patrol/issues?q=is%3Aopen+is%3Aissue+label%3Apackage%3Apatrol_finders @@ -20,7 +20,7 @@ dependencies: flutter_test: sdk: flutter meta: ^1.10.0 - patrol_log: ^0.2.0 + patrol_log: ^0.2.1 dev_dependencies: leancode_lint: ^14.2.0