Skip to content

Bakanych/SpecFlowSharedSteps

Repository files navigation

SpecFlow Shared Steps

Build status NuGet version

Download

The latest version is available on Nuget

Configuration

Add or update the following section in your specflow.json:

  "stepAssemblies": [
    { "assembly": "SpecFlowSharedSteps" }
  ]

Usage

Assume you have some set of steps you wanna share between your specflow scenarios.

Now it's as easy as just one step:

Given I execute the steps of 'My Feature'.'Some Scenario'

or

Given I execute background steps of Some Feature

# for quote lovers:
Given I execute background steps of 'Some Feature'

or even

Given I execute the steps of:
| feature     | scenario       |
| Feature One | Shared Steps 1 |
| Feature Two | Shared Steps 2 |

See more examples

Shared context

Parent Feature and Scenario Context is used by shared steps. Context values created by shared steps are available in parent scenario. Be careful with context key duplication.