serenity-bdd / serenity-cucumber

Cucumber integration for the Serenity BDD Reporting library
Other
78 stars 74 forks source link

Is there a way to get all Tags of the currently running scenario in Before step? #251

Open skurlow opened 3 years ago

skurlow commented 3 years ago

I have a method annotated with @Before and what I do in that method is manipulate the web driver. Some of our feature scenarios interact with a browser and some do not and only via REST APIs. I do not want the browser to open for scenarios that do not require it so I thought if I could get access to the tags of a scenario and I define a reusable scenario called NO_BROWSER then for those scenarios I will not open a browser.

I looked at https://github.com/serenity-bdd/serenity-cucumber/issues/199 but the base listener is not set during a Before method.

Any ideas?