From e4a48703d89ae6b9cc6010b5522a5bd576235c98 Mon Sep 17 00:00:00 2001 From: Piotr Maszota <37781044+piotruela@users.noreply.github.com> Date: Fri, 8 Nov 2024 17:18:03 +0100 Subject: [PATCH] Patrol log reset counter (#2399) * Reset step counter * Prepare changelog --------- Co-authored-by: piotruela --- packages/patrol_log/CHANGELOG.md | 4 ++++ packages/patrol_log/lib/src/patrol_log_reader.dart | 8 ++++---- packages/patrol_log/pubspec.yaml | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/packages/patrol_log/CHANGELOG.md b/packages/patrol_log/CHANGELOG.md index 931bb89d8..44fc4a69c 100644 --- a/packages/patrol_log/CHANGELOG.md +++ b/packages/patrol_log/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.0.1+1 + +- Reset step counter in develop. + ## 0.0.1 - Initial release as a standalone package. diff --git a/packages/patrol_log/lib/src/patrol_log_reader.dart b/packages/patrol_log/lib/src/patrol_log_reader.dart index 9e98e4c39..450eff2eb 100644 --- a/packages/patrol_log/lib/src/patrol_log_reader.dart +++ b/packages/patrol_log/lib/src/patrol_log_reader.dart @@ -163,6 +163,10 @@ class PatrolLogReader { // Print the test entry to the console. log(entry.pretty()); + + // Reset the counters needed for clearing the lines. + stepsCounter = 0; + logsCounter = 0; case TestEntry(): // Close the single test entry for the test that is finished. _singleEntries.last.closeTest(entry); @@ -175,10 +179,6 @@ class PatrolLogReader { final executionTime = _singleEntries.last.executionTime.inSeconds; // Print test entry summary to console. log('${entry.pretty()} ${AnsiCodes.gray}(${executionTime}s)${AnsiCodes.reset}'); - - // Reset the counters needed for clearing the lines. - stepsCounter = 0; - logsCounter = 0; case StepEntry(): _singleEntries.last.addEntry(entry); if (!hideTestSteps) { diff --git a/packages/patrol_log/pubspec.yaml b/packages/patrol_log/pubspec.yaml index f8ab787cc..086ba8827 100644 --- a/packages/patrol_log/pubspec.yaml +++ b/packages/patrol_log/pubspec.yaml @@ -1,7 +1,7 @@ name: patrol_log description: > Log package for Patrol, a powerful Flutter-native UI testing framework. -version: 0.0.1 +version: 0.0.1+1 homepage: https://patrol.leancode.co repository: https://github.com/leancodepl/patrol/tree/master/packages/patrol_log issue_tracker: https://github.com/leancodepl/patrol/issues