Reputation: 23
I have a feature file with the following scenario
Given I launch the browser
Now I have the step def for the same as
Given("I launch the browser", () -> {
vu.launchBrowser();
});
Now I want to execute this scenario with before hook such that I runs before every other scenario
I tried doing this
Before("I launch the browser",() -> {
});
but there is a compile error Can someone help how we can implement this before hook using lambda expression and what are the changes that need to be done in stepdefs and feature file to achieve the same
Upvotes: 0
Views: 444
Reputation: 1191
Remove "I launch the browser" from your Before hook. Hooks don't accept an expression argument.
Upvotes: 2