pytest-bdd icon indicating copy to clipboard operation
pytest-bdd copied to clipboard

JSON Report not generating if first step is not implemented

Open Suladis opened this issue 1 year ago • 4 comments

I’ve been trying to figure out why the report JSON doesn’t generate if the first step of a scenario is not implemented. The issue doesn’t happen when any other step is not implemented but the first one and it generates a report if the second step or so on is not implemented. The error is correct for the step definition not being implemented. I tried tracing the error to see when the report is being generated and intercepting it in the call phase of testing but to no luck. I also tried utilizing the step error and before step hook but that didn’t help out. Any information on how I can approach?

Suladis avatar Oct 15 '24 23:10 Suladis

I'll take a look this week and see if I can see what's happening

jsa34 avatar Oct 22 '24 18:10 jsa34

Looking forward to it, are there any recommended workarounds that you’d recommend?

Suladis avatar Oct 25 '24 00:10 Suladis

Apologies for the delay!

The simple workaround, I guess, is to implement the step.

I've not touched the json output before yet - what do you see when steps other than the first are not implemented? What are you expecting to see?

jsa34 avatar Nov 28 '24 13:11 jsa34

No worries at all. I appreciate you trying to help!!

That is a great workaround but I'm trying to figure out how to best figure this issue out for future scenarios.

Currently I have implemented hooks to take care of steps that are not implemented. I'm still getting familiar with hooks, but I was wondering if the first step not being implemented prevents the test from starting execution and is exiting with a code 3 in the collection phase.

I was wondering if that was the issue that resulted in a report not being made and how to best approach it...

I hope that makes some sense and thanks again!

Suladis avatar Dec 01 '24 00:12 Suladis