You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
we're using ConcurrentEventListener to access Step text via TestStepStarted event listener. These steps can later be logged to a file and attached to the failed test in the Allure report. Unfortunately, it does not work as expected.
👓 What did you see?
All steps for given scenario are being logged, even the ones that occur after the scenario failure.
##[SECTION] Starting scenario d950c44e-1029-40ae-8896-91c1c72414ec
##[STEP] 02/29/2024 09:53:11 --- action ---
##[STEP] 02/29/2024 09:53:11 --- check result ---
##[ERROR] 02/29/2024 09:53:11 --- Step above is failing! ---
##[STEP] 02/29/2024 09:53:11 --- rest ---
##[STEP] 02/29/2024 09:53:11 --- of ---
##[STEP] 02/29/2024 09:53:11 --- the ---
##[STEP] 02/29/2024 09:53:11 --- scenario ---
##[SECTION] Scenario ended with status: FAILED
java.lang.AssertionError:
Expecting value to be true but was false
at org.steps.CommonSteps.checkResult(CommonSteps.java:163)
at ✽.check result(file:///C:/Projects/ConcurrentEventListenerBug/src/test/java/org/features/ConcurrentEventListener.feature:440)
Failed scenarios:
file:///C:/Projects/ConcurrentEventListenerBug/src/test/java/org/features/ConcurrentEventListener.feature:438 # ConcurrentEventListener bug
✅ What did you expect to see?
I expect, that steps after the failed step are not logged, because as name suggests for "TestStepStarted" event - these steps have not yet started because of the failure.
As part of the execution model, every step is always executed. But every step after a failing step is executed in dry-run mode and will not invoke the glue code. I.e. it is skipped.
The reasons for this are pretty much historic now. They have their origins in the original Ruby implementation. The test step event docs could probably be updated to include that information.
For now you may want to use the TestStepFinished event instead and filter on it's result status.
Hi,
we're using ConcurrentEventListener to access Step text via TestStepStarted event listener. These steps can later be logged to a file and attached to the failed test in the Allure report. Unfortunately, it does not work as expected.
👓 What did you see?
All steps for given scenario are being logged, even the ones that occur after the scenario failure.
✅ What did you expect to see?
I expect, that steps after the failed step are not logged, because as name suggests for "TestStepStarted" event - these steps have not yet started because of the failure.
📦 Which tool/library version are you using?
🔬 How could we reproduce it?
Given scenario:
ConcurrentEventListener implementation:
cucumber.properties:
The text was updated successfully, but these errors were encountered: