This repository was archived by the owner on Dec 21, 2024. It is now read-only.
This repository was archived by the owner on Dec 21, 2024. It is now read-only.
Updating Scenario hooks examples to be more like a SSCCE #424
Open
Description
The examples given in the API documentation are a bit too minimal, and they had me digging around for examples elsewhere, i.e. in the Scenario hooks page:
Before
Before hooks run before the first step of each scenario.
Annotated method style:
@Before
public void doSomethingBefore() {
}
Lambda style:
Before(() -> {
});`
These are the examples given but the actual implementation requires a bit more, at least in the lambda case:
import io.cucumber.java8.En;
public class HooksExample implements En{
public HooksExample() {
Before(() -> {
System.out.println("In before hook.");
});
}
}
It doesn't mention anywhere on the page about implementing "En", or that a class constructor is needed for a working example. I would make a change request, but I am not sure on the styling, should there be a full example in each case? or just one at the top.
Thanks for reading.