Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add opt-in feature of enforcing properly constructed Given-When-Then scenarios #179

Open
3 tasks
Suremaker opened this issue Jan 17, 2019 · 0 comments
Open
3 tasks
Labels
enhancement An enhancement of the feature or new feature

Comments

@Suremaker
Copy link
Collaborator

Description

As a follow up to #167, the LightBDD should offer and opt-in feature enforcing developers to write properly constructed scenarios, where:

  • each scenario will start with 0 or more SETUP steps,
  • followed by 1 or more GIVEN steps,
  • followed by 1 or more WHEN steps (configurable to exactly 1?),
  • followed by 1 or more THEN steps.

When feature is enabled, any scenario written in any style (basic/extended/compact way) should fail if step types are in wrong order or missing.

The composite steps behavior should be rethink yet, but there are multiple possible implementations:

  1. composite sub-steps should be verified independently from parent step, i.e
GIVEN I purchased a TV
    GIVEN I have a basket
    GIVEN I put TV to the basket
    WHEN I go to the checkout
    WHEN I pay
    THEN The purchase should be made
WHEN I request an invoice for the purchase
THEN I should receive the invoice
  1. composite sub-steps should start with the same type as the composite itself
GIVEN a basket with a TV
    GIVEN I have a basket
    GIVEN I put TV to the basket
WHEN I finalize the transaction
    WHEN I go to the checkout
    WHEN I pay
    THEN The purchase should be made
WHEN I request an invoice for the purchase
THEN I should receive the invoice
  1. composite sub-steps should be only of the same type as the composite itself
GIVEN a basket with a TV
    GIVEN I have a basket
    GIVEN I put TV to the basket
WHEN I finalize the transaction
    WHEN I go to the checkout
    WHEN I pay
WHEN I request an invoice for the purchase
THEN I should receive the invoice

Progress

  • Feature is implemented,
  • Ensured backward-compatibility,
  • Ensured good debugging experience
@Suremaker Suremaker added the enhancement An enhancement of the feature or new feature label Jan 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An enhancement of the feature or new feature
Projects
None yet
Development

No branches or pull requests

1 participant