From fc6a37c3f4119eb38515d43f51794990f9f0f85c Mon Sep 17 00:00:00 2001 From: Christoph Deppisch Date: Wed, 20 Sep 2023 21:11:25 +0200 Subject: [PATCH] fix(#948): Log proper test step index on incremental Citrus tests Avoid all test steps to be reported as "TEST STEP 0" for incremental tests (cherry picked from commit 21aeb4385587cae7a35911a517f41b372189d53d) --- .../main/java/com/consol/citrus/report/LoggingReporter.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/citrus-base/src/main/java/com/consol/citrus/report/LoggingReporter.java b/core/citrus-base/src/main/java/com/consol/citrus/report/LoggingReporter.java index 55c93d2214..9407d24dcf 100644 --- a/core/citrus-base/src/main/java/com/consol/citrus/report/LoggingReporter.java +++ b/core/citrus-base/src/main/java/com/consol/citrus/report/LoggingReporter.java @@ -183,7 +183,7 @@ public void onTestActionStart(TestCase testCase, TestAction testAction) { if (isDebugEnabled()) { newLine(); if (testCase.isIncremental()) { - debug("TEST STEP " + (testCase.getActionIndex(testAction) + 1) + ": " + (testAction.getName() != null ? testAction.getName() : testAction.getClass().getName())); + debug("TEST STEP " + (testCase.getExecutedActions().size() + 1) + ": " + (testAction.getName() != null ? testAction.getName() : testAction.getClass().getName())); } else { debug("TEST STEP " + (testCase.getActionIndex(testAction) + 1) + "/" + testCase.getActionCount() + ": " + (testAction.getName() != null ? testAction.getName() : testAction.getClass().getName())); } @@ -206,7 +206,7 @@ public void onTestActionFinish(TestCase testCase, TestAction testAction) { if (isDebugEnabled()) { newLine(); if (testCase.isIncremental()) { - debug("TEST STEP " + (testCase.getActionIndex(testAction) + 1) + " SUCCESS"); + debug("TEST STEP " + (testCase.getExecutedActions().size() + 1) + " SUCCESS"); } else { debug("TEST STEP " + (testCase.getActionIndex(testAction) + 1) + "/" + testCase.getActionCount() + " SUCCESS"); } @@ -218,7 +218,7 @@ public void onTestActionSkipped(TestCase testCase, TestAction testAction) { if (isDebugEnabled()) { newLine(); if (testCase.isIncremental()) { - debug("SKIPPING TEST STEP " + (testCase.getActionIndex(testAction) + 1)); + debug("SKIPPING TEST STEP " + (testCase.getExecutedActions().size() + 1)); } else { debug("SKIPPING TEST STEP " + (testCase.getActionIndex(testAction) + 1) + "/" + testCase.getActionCount()); }