Cucumber Features

Expand All

Collapse All

Feature: Step actions and behavior

In order to validate implementations against acceptance criterias
As a go developer
I want to define actions and behavior of cucumber steps

features/actions.feature:6

Scenario: Invoke user defined code of a step

  1. Given a go wire server
    Unknown
  2. And the following feature:
    features/step_definitions/steps.rb:4
    Feature: feature
      Scenario: scenario
        Given a step with code
  3. When I run cucumber
    features/step_definitions/steps.rb:10
  4. Then the code was executed
    Unknown
features/actions.feature:17

Scenario: Report the message of a failing step

  1. Given a step with pattern "failure step" that fails with message "failure message"
    Unknown
  2. And a go wire server
    Unknown
  3. And the following feature:
    features/step_definitions/steps.rb:4
    Feature: feature
      Scenario: scenario
        Given failure step
  4. When I run cucumber
    features/step_definitions/steps.rb:10
  5. Then the output should contain:
    features/step_definitions/steps.rb:14
    failure message

Feature: Scenario validation

In order to delevop behavior driven
As a go developer
I want to get feedback about success or failure of steps and scenarios

features/feedback.feature:6

Scenario: An undefined step

  1. Given a go wire server
    Unknown
  2. And the following feature:
    features/step_definitions/steps.rb:4
    Feature: feature
      Scenario: scenario
        Given an undefined step
  3. When I run cucumber
    features/step_definitions/steps.rb:10
  4. Then the output should contain:
    features/step_definitions/steps.rb:14
    1 scenario (1 undefined)
    1 step (1 undefined)
features/feedback.feature:21

Scenario: A pending step

  1. Given a go wire server
    Unknown
  2. And the following feature:
    features/step_definitions/steps.rb:4
    Feature: feature
      Scenario: scenario
        Given a step which is pending
  3. When I run cucumber
    features/step_definitions/steps.rb:10
  4. Then the output should contain:
    features/step_definitions/steps.rb:14
    1 scenario (1 pending)
    1 step (1 pending)
features/feedback.feature:36

Scenario: A passing step

  1. Given a go wire server
    Unknown
  2. And the following feature:
    features/step_definitions/steps.rb:4
    Feature: feature
      Scenario: scenario
        Given a step which passes
  3. When I run cucumber
    features/step_definitions/steps.rb:10
  4. Then the output should contain:
    features/step_definitions/steps.rb:14
    1 scenario (1 passed)
    1 step (1 passed)
features/feedback.feature:51

Scenario: A failing step

  1. Given a go wire server
    Unknown
  2. And the following feature:
    features/step_definitions/steps.rb:4
    Feature: feature
      Scenario: scenario
        Given a step which fails
  3. When I run cucumber
    features/step_definitions/steps.rb:10
  4. Then the output should contain:
    features/step_definitions/steps.rb:14
    1 scenario (1 failed)
    1 step (1 failed)
features/feedback.feature:66

Scenario: A combination of undefined, passing and failing steps

  1. Given a go wire server
    Unknown
  2. And the following feature:
    features/step_definitions/steps.rb:4
    Feature: feature
      Scenario: scenario
        Given a step which passes
        And a step which fails
        Then a step which is pending
        And a step which passes
  3. When I run cucumber
    features/step_definitions/steps.rb:10
  4. Then the output should contain:
    features/step_definitions/steps.rb:14
    1 scenario (1 failed)
    4 steps (1 failed, 2 skipped, 1 passed)

Feature: Snippets

In order to quickly add new steps
I want code snippets for undefined steps

features/snippet.feature:5

Scenario: Suggest go code snippets for undefined steps

  1. Given a go wire server
    Unknown
  2. And the following feature:
    features/step_definitions/steps.rb:4
    Feature: feature
      Scenario: scenario
        Given an undefined step
        When another undefined step
        Then yet another undefined step
  3. When I run cucumber
    features/step_definitions/steps.rb:10
  4. Then the output should contain:
    features/step_definitions/steps.rb:14
    cucumber.Given("an undefined step").Pending
  5. And the output should contain:
    features/step_definitions/steps.rb:14
    cucumber.When("another undefined step").Pending
  6. And the output should contain:
    features/step_definitions/steps.rb:14
    cucumber.Then("yet another undefined step").Pending

Feature: Patterns to match steps

In order to reuse steps with different parameters
I want to use regular expressions in step patterns

features/step_matching.feature:5

Scenario: Match a number

  1. Given step with pattern "^a number (\d+)$"
    Unknown
  2. And a go wire server
    Unknown
  3. And the following feature:
    features/step_definitions/steps.rb:4
    Feature: feature
      Scenario: scenario
        Given a number 1234
  4. When I run cucumber
    features/step_definitions/steps.rb:10
  5. Then number 1234 is passed to the matching step
    Unknown