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
Using Serenity with Cucumber, and debugging I've seen this order of execution:
First all methods of plain classes with Before annotation are executed
Then all methods on Stepdefs with Before annotation are executed
If you've defined a fixture service class in META-INF/services/net.thucydides.core.fixtureservices.FixtureService, then his setup method is called
Finally, the method "apply" of any class that implements BeforeAWebdriverScenario, is called.
The last two are used to add capabilities to browser and driver. I suggest or think personally that "Before" annotation, as it's used from steps definitions, is something that needs to be executed after driver has already configured, not before.
For example, if we want to do the login for all our scenarios (Before), and a logoff when scenario is finished (After), we need to start with an already configured driver and capabilities.
Thanks in advance.
The text was updated successfully, but these errors were encountered:
We can't modify the order of the Cucumber step execution. However, if you invoke a step that uses WebDriver at any point, the creation methods will be called. E.g.
Using Serenity with Cucumber, and debugging I've seen this order of execution:
The last two are used to add capabilities to browser and driver. I suggest or think personally that "Before" annotation, as it's used from steps definitions, is something that needs to be executed after driver has already configured, not before.
For example, if we want to do the login for all our scenarios (Before), and a logoff when scenario is finished (After), we need to start with an already configured driver and capabilities.
Thanks in advance.
The text was updated successfully, but these errors were encountered: