Skip to content
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
@BriceKrispies

Description

@BriceKrispies

SSCCE

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    📖 documentationImprovements or additions to documentation⚡ enhancementRequest for new functionality

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions