Skip to content

[Feature Request] Allow scenarios to start with When or Then #14

Description

@Kahoulam

Description

Currently, a scenario must start with Given. In real Gherkin scenarios, you can start with any keyword (Given, When, or Then), but the current DSL forces you to always use Given first:

// Current: Must start with Given
Bdd(feature)
    .scenario('Login')
    .given('user is registered')
    .when('user logs in')
    .then('access granted');

Trying to start with When or Then directly causes a compile error.

Proposed API

// Should allow starting with any keyword
Bdd(feature)
    .scenario('Login')
    .when('user logs in')
    .then('access granted');

Bdd(feature)
    .scenario('Test')
    .then('result happens');

Expected Behavior

Just like in Gherkin/Cucumber, a scenario should be able to start with any step keyword, not just Given.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions