vitalets / playwright-bdd

BDD testing with Playwright runner
https://vitalets.github.io/playwright-bdd/
MIT License
302 stars 35 forks source link

Question: how to move "background" step out of "beforeHooks" #78

Closed alescinskis closed 6 months ago

alescinskis commented 10 months ago

Hello,

I want to be able to utilise background keyword in my scenarios, but I see that in html report, when such background section is present, it's listed under "beforeHooks", which hinders scenario readability.

report looks like this:

image

if we delve into "beforeEachHook" then we'll see the background step is there

image

I'd like the background step be on the scenario level in the reporter, like this

image

is it currently possible to move it on the scenario level? or this feature should be requested?

vitalets commented 10 months ago

Hi @alescinskis ! Currently it is not possible, but I suggest to wait for Cucumber HTML reporter in https://github.com/vitalets/playwright-bdd/issues/9 that I'm working on. In Cucumber reporter Background steps are shown in dedicated section that is the best option imho:

vitalets commented 6 months ago

Now playwright-bdd supports Cucumber reports, that show background step as in feature file. There is another idea to enhance Playwright html reporter, tracked here https://github.com/vitalets/playwright-bdd/issues/122