Description
Currently, bdd_framework does not provide a way to define or export the Background keyword in Gherkin. When multiple scenarios share the same initial steps, they have to be repeated in every scenario, which leads to bloated .feature files.
Current Behavior
Even if I repeat the same Given steps in every Bdd instance, the GherkinExporter prints them inside each Scenario.
Requested Feature
I would like a way to explicitly define common steps for a BddFeature so that the exporter can group them under a Background: section.
Example of how it might look in code:
var feature = BddFeature('User Login');
// New proposed method to define background
Bdd.background(feature)
.given('the app is open')
.and('the user is on the login page');
Bdd(feature)
.scenario('Success')
.when('...')
.then('...');
Expected Gherkin Output:
Feature: User Login
Background:
Given the app is open
And the user is on the login page
Scenario: Success
When ...
Then ...
Why this is needed
To comply with standard Gherkin formatting and to keep exported feature files clean and readable for non-technical stakeholders.
Description
Currently,
bdd_frameworkdoes not provide a way to define or export theBackgroundkeyword in Gherkin. When multiple scenarios share the same initial steps, they have to be repeated in every scenario, which leads to bloated.featurefiles.Current Behavior
Even if I repeat the same
Givensteps in everyBddinstance, theGherkinExporterprints them inside eachScenario.Requested Feature
I would like a way to explicitly define common steps for a
BddFeatureso that the exporter can group them under aBackground:section.Example of how it might look in code:
Expected Gherkin Output:
Why this is needed
To comply with standard Gherkin formatting and to keep exported feature files clean and readable for non-technical stakeholders.