Questions tagged [specflow]

SpecFlow is a Behavior-Driven Development (BDD) tool for .NET.

SpecFlow is an implementation of Cucumber for .NET Core and .NET BDD-Framework. The SpecFlow and Cucumber uses the same language to write your specifications.

SpecFlow aims at bridging the communication gap between domain experts and developers by binding business readable behavior specifications to the underlying implementation.

It aims to:

provide a pragmatic and frictionless approach to specification-by-example for .NET projects.

Additionally it:

supports the concepts of acceptance test driven development (ATDD) and behavior-driven development (BDD), which are often used synonymously with specification-by-example.

SpecFlow can most easily be installed through its NuGet package.

Install-Package SpecFlow

SpecFlow is open source and provided under a BSD license.

Visit the SpecFlow site for more information.

2251 questions
29
votes
5 answers

Is Page Object Model linking compatible with Cucumber's Gherkin?

With Test Automation's Page Object Model we link pages together like this: WebDriver driver = new WebDriver() HomePage homePage = new HomePage(driver); LoginPage loginPage = homePage.GoToLoginPage(); WelcomePage welcomePage =…
Charlie S
  • 4,366
  • 6
  • 59
  • 97
26
votes
6 answers

Given When Then Testing - Do I NEED a "When"?

I am implementing some smoke tests to our website. I'm using a Given/When/Then format for existing automated acceptance tests/User stories. But now I want to do an initial smoke test of: Given I'm on the homepage Then I should see "Welcome To The…
Dan Black
  • 1,167
  • 3
  • 14
  • 20
25
votes
7 answers

How to learn/teach Gherkin for Cucumber

I'd like to enable the business analysts to be able to write all of their specs for features, scenarios and steps that is Cucumber friendly using Gherkin. I've read some of the basic info on the github site for Cucumber and from doing a quick Google…
Satchel
  • 16,414
  • 23
  • 106
  • 192
23
votes
8 answers

SpecFlow and complex objects

I'm evaluating SpecFlow and I'm a bit stuck. All samples I have found are basically with simple objects. Project I'm working on heavily relies on a complex object. A close sample could be this object: public class MyObject { public int Id { get;…
Ramunas
  • 3,853
  • 1
  • 30
  • 31
23
votes
10 answers

Built tests are not added to the Visual Studio Test Explorer window

I set up the SpecFlow plug-in for the Visual Studio 2013. I created new Feature Item and build it. Result: built test is not shown in the Test Explorer. Why? I do it according to this video
Vlad Kostyukevich
  • 463
  • 1
  • 3
  • 12
22
votes
3 answers

Passing arrays of variable in specflow

Is there a way to pass an array of parameters instead of passing each parameter individually? For example I have the following scenarios: When i login to a site then , , , , , are…
AutomateFr33k
  • 562
  • 2
  • 8
  • 26
22
votes
4 answers

Specflow test step inheritance causes "Ambiguous step definitions"

I want to have the following test step class structure: [Binding] public class BaseStep { [Given(@"there is a customer")] public void GivenThereIsACustomer(Table table) { HandleCustomer(table); } protected virtual void…
wd113
  • 477
  • 1
  • 9
  • 18
21
votes
2 answers

Specflow's [AfterScenario]

I have defined [AfterScenario] binding in my stepdefinition class and have method which will be executed after each scenario, but from some reason this isn't working. My method isn't called after each scenario, so excel remains open after some…
Vajda
  • 1,795
  • 6
  • 39
  • 49
21
votes
5 answers

ATDD versus BDD and the proper use of a framework

I am just getting into the concept of BDD and have listened to Scott Bellware's talk with the Herding Code guys. I have been playing around with SpecFlow some and like it pretty well. I understand the distinction between ATDD and TDD as described…
Brian McCord
  • 4,943
  • 7
  • 32
  • 44
20
votes
4 answers

Where can I find a Gherkin language spec/guide?

I'm trying to find out all available syntax/format in Gherkin, such as about multiline argument and everything else I don't know yet. After digging Google search results though, it seems that the comprehensive guide is located in here: I thought…
ryaner
  • 3,927
  • 4
  • 20
  • 23
19
votes
5 answers

How to input null-value into specflow step definition table

How can I input a null value in Specflow through a table? Let's look at an overly simplistic example: When a tire is attached to a car | CarId | TireModel | FabricationDate | Batch | | 1 | Nokian Hakka R | 2015-09-1 | | The…
Tuukka Haapaniemi
  • 1,156
  • 1
  • 11
  • 24
18
votes
4 answers

I cannot get specflow's code behind files to regenerate

When I edit a specflow feature file test, it doesn't update the code-behind file. When I try to manually regenerate the code-behind files by right-clicking the project and choosing 'Regenerate Feature Files' I get an error: Error: cannot find…
Megan Styles
  • 631
  • 1
  • 5
  • 10
18
votes
2 answers

SpecFlow/Cucumber/Gherkin - Using tables in a scenario outline

Hopefully I can explain my issue clearly enough for others to understand, here we go, imagine I have the two following hypothetical scenarios: Scenario: Filter sweets by king size and nut content Given I am on the "Sweet/List" Page When I filter…
MattStacey
  • 875
  • 4
  • 12
  • 23
18
votes
6 answers

Feature-scoped step definitions with SpecFlow?

I'm using SpecFlow to do some BDD-style testing. Some of my features are UI tests, so they use WatiN. Some aren't UI tests, so they don't. At the moment, I have a single StepDefinitions.cs file, covering all of my features. I have a BeforeScenario…
Roger Lipscombe
  • 89,048
  • 55
  • 235
  • 380
18
votes
5 answers

SpecFlow.NUnit via Nuget: Missing reference to nunit.core

I just installed the 'specflow.nunit' package via nuget, but the project containing the specs want compile anymore, because of the SpecFlowNUnitExtension class that is added to the project is missing references to nunit.core (more specifically the…
Kjetil Klaussen
  • 6,266
  • 1
  • 35
  • 29