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
94
votes
14 answers

How to do block comments in Gherkin?

In gherkin syntax (used by Cucumber and SpecFlow, I can comment out a line by prefixing it with '#' Is there any way to block-comment multiple lines?
dbruning
  • 5,042
  • 5
  • 34
  • 35
77
votes
5 answers

How do I disable a feature in specflow (Gherkin) without deleting the feature?

I have some SpecFlow features (using the Gherkin syntax) and I would like to temporarily disable the feature to prevent its tests from running? Is there an attribute I can mark the feature with to do this? I'm guessing that something that works with…
Simon Keep
  • 9,886
  • 9
  • 63
  • 78
62
votes
4 answers

How do I write comments in a SpecFlow Feature?

I'd like to include some comments in a SpecFlow feature. I get the the following error: Custom tool error: Parsing error near '/*' I've tried the following: // comment /* comment */ -- comment ' comment How do I do this?
Kofi Sarfo
  • 3,310
  • 6
  • 23
  • 24
43
votes
3 answers

Outside-in BDD (with Specflow)

I'm new to BDD, but I found it very interesting and want to develop my next project using BDD. After googling and watching screencasts I still have lots of questions about BDD in real life. 1. Declarative or Imperative scenarios? Most of…
Sergey Berezovskiy
  • 232,247
  • 41
  • 429
  • 459
42
votes
7 answers

How do I get SpecFlow to expect an exception?

I'm using SpecFlow, and I'd like to write a scenario such as the following: Scenario: Pressing add with an empty stack throws an exception Given I have entered nothing into the calculator When I press add Then it should throw an…
Roger Lipscombe
  • 89,048
  • 55
  • 235
  • 380
41
votes
8 answers

How to run SpecFlow tests in Visual Studio 2010?

Trying to get SpecFlow running with a fresh VS2010 Professional install. Created a new console application and added references to NUnit and SpecFlow. Created a SpecFlow feature. The .feature with the default template code is created. Now I try to…
testerboy
  • 441
  • 1
  • 4
  • 5
41
votes
6 answers

In SpecFlow how can I share data between steps/features?

I have 2 features that use a common 'When' step but have different 'Then' steps in different classes. How do I access, for example, the ActionResult from my MVC controller call in the When step in my two Then steps?
Simon Keep
  • 9,886
  • 9
  • 63
  • 78
41
votes
1 answer

Can I escape the pipe in specflow (or gherkin)

I've got a specflow step table that I want to have the | (pipe) character as a part of the content. Example: Then the data should be | Field | Value | | SomeField | a|b|c | But this doesn't work. How can I escape the pipe character?
viggity
  • 15,039
  • 7
  • 88
  • 96
40
votes
13 answers

Specflow error: Force regenerate steps possible?

Is it possible to "force" regenerate step definitions for a specflow feature file? I have created this feature file but cannot generate all steps. Am getting a message that all steps are already bound but when I run the test, I get an error that the…
Ibexy I
  • 1,123
  • 6
  • 16
  • 29
39
votes
6 answers

Cuke4Nuke or SpecFlow?

I am trying to decide if I should use Cuke4Nuke or SpecFlow. What are the pro/cons of each? Opinions on which is better and why. Thanks!
Rich Blumer
  • 960
  • 1
  • 15
  • 26
38
votes
8 answers

Are there any non-developer tools to edit gherkin files?

Gherkin syntax files are just plain text so any editor such as notepad can be used. However, one of the more important things we are using this for is to provide tables of sample data. Without good formatting options the files become hard to…
toddles2000
  • 1,032
  • 1
  • 8
  • 16
33
votes
2 answers

How to regenerate designer code for all SpecFlow features

I've got ~30 SpecFlow feature files, and I recently removed the Foo.feature.cs files from source control because I got sick of resolving merge conflicts in Designer Generated code. I did not exclude or remove these files from my Visual Studio…
Greg Burghardt
  • 17,900
  • 9
  • 49
  • 92
32
votes
1 answer

Specflow custom tool error when adding "Examples:"

I have this specification: Feature: Homepage As a webiste user I want to see a pretty homepage Scenario: Homepage Display Given I am on an ecommerce When I look at the content Then I should see a swiper Examples: |…
NikolaiDante
  • 18,469
  • 14
  • 77
  • 117
30
votes
6 answers

SpecFlow / BDD Examples

Just looking for some examples of BDD/SpecFlow - ideally a projectб so I can see how to use SpecFlow on big projects where multiple features my reference the same steps etc. I've read a few blogs over the last few months, but haven't had a nice,…
nick
  • 1,477
  • 2
  • 20
  • 29
29
votes
6 answers

SpecFlow/BDD for Unit Tests?

Seems like the internet doesn't have a definitive answer, or set of principles to help me answer the question. So I turn to the great folk on SO to help me find answers or guiding thoughts :) SpecFlow is very useful for BDD in .NET. But when we talk…
Nicko-Mctricko
  • 461
  • 5
  • 6
1
2 3
99 100