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
17
votes
8 answers

Specflow - GenerateFeatureFileCodeBehindTask has failed unexpectedly

I have a problem with SpecFlow. We are using Azure Devops and when I build solution on my local machine it works perfectly but during Azure Devops build I am getting following…
aj_2017
  • 171
  • 1
  • 1
  • 5
17
votes
5 answers

Error build VSTS: ## [error] Error: Unable to locate the 'nuget'

I created a test project with C# + SpecFlow and I am trying to build the solution through VSTS, however in Nuget Restore is presenting the error below. 2018-08-07T15:29:39.6678023Z ##[error]Error: Unable to locate the 'nuget'…
mribeiro
  • 197
  • 11
17
votes
1 answer

SpecFlow - How you properly use the "Background:" command in the feature file?

I've been reading articles, watching some screen-casts and playing around with a few sample/demo tutorials. I read an article where someone said "don't use too many backgrounds". I was curious so I tried it in SpecFlow's feature file and it…
Mastro
  • 1,477
  • 2
  • 22
  • 52
16
votes
2 answers

MSpec and SpecFlow when to use which? What are the advantages/disadvantages of either?

I am trying to get started with BDD and found a view blog posts about MSpec and SpecFlow. I'm currently not quite sure when I would use which and what the advantages/disadvantages of either framework are. Looking at the documentation it seems that…
b3n
  • 3,805
  • 5
  • 31
  • 46
16
votes
1 answer

SpecFlow Re-usable step definitions

Is there a way to have SpecFlow reuse Step Definitions? In other tools I have used a GivenWhenThen base class that contains methods such as WhenAnOrderIsCreated -- this inits a protected order member to be used by inheriting classes. Just cant seem…
Chris McKelt
  • 1,378
  • 2
  • 17
  • 38
15
votes
2 answers

Sharing a common set of Examples across multiple Scenario Outlines in Specflow

Is is possible to share a common set of examples across multiple scenario outlines in Specflow without duplicating the set of examples for each outline? e.g. excuse the noddy example, but here the Examples are repeated for each Scenario Outline and…
AdaTheDev
  • 142,592
  • 28
  • 206
  • 200
15
votes
8 answers

specflow generate step definitions missing from context menu

I followed the getting started instructions and the "generate step definitions" is missing from context menu. I tried adding the additional specflow packages from nuget for mstest and still nothing.
MonkeyBonkey
  • 46,433
  • 78
  • 254
  • 460
15
votes
4 answers

In Specflow can I run one test as a step of another?

TL;DR; How can I create a specflow test that calls another test as its first step? Given I already have one specflow test And I want to run another test that goes deeper than the first test Then I create a second test that runs the first test as…
JK.
  • 21,477
  • 35
  • 135
  • 214
15
votes
2 answers

XUnit nuget failing (visual studio 2013) xunit.core already has dependency defined

When doing a Nuget for XUnit.Net I get: Attempting to resolve dependency 'xunit'. Attempting to resolve dependency 'xunit.core (= 2.0.0-rc1-build2826)'. 'xunit.core' already has a dependency defined for 'xunit.extensibility.core'. I get the same…
pashute
  • 3,965
  • 3
  • 38
  • 65
15
votes
8 answers

How can I run Internet Explorer Selenium tests as a specific domain user?

I have a ASP.NET MVC website that uses Windows Authentication to control access. I would like to have a specflow selenium test that checks the configuration is correct by attempting to visit the site as a non-authorised user. As we're using domain…
15
votes
4 answers

Specflow and reusing steps from another feature

I am trying to learn specflow and right now. Currently I have 2 feature files. In the second feature file, I am reusing a step from the first feature file. Specflow automatically recognizes the step from the first feature file and when specflow…
user2846391
  • 153
  • 1
  • 1
  • 5
15
votes
1 answer

How to programmatically ignore some acceptance tests using TechTalk.SpecFlow and C#?

I have several feature files with some scenarios. I need to ignore several scenarios, or features, marked with some @tag depending on some condition. I have read specflow documentation but didn't find there something that can be useful for my…
Dmytro
  • 16,668
  • 27
  • 80
  • 130
15
votes
2 answers

SpecFlow/Gherkin highlighting in Sublime Text 2

Does anyone know if there are any Sublime Text 2 packages available to enable syntax highlighting for SpecFlow / Gherkin specification files?
Stuart Hallows
  • 8,795
  • 5
  • 45
  • 57
14
votes
5 answers

SpecFlow wrongly using NUnit

I've just (today) tried SpecFlow for the first time. I'm playing about by creating a new class library in VS2010 Pro and adding a SpecFlow Feature Definition file. Thing is, the integration doesn't appear to be working properly, with a variety of…
Tom W
  • 5,108
  • 4
  • 30
  • 52
14
votes
1 answer

Specflow steps with await for async API

We're trying to get the following scenrio step to break the test in case failure happens within DoAyncStuff() method: [Given(@"There is something")] public async Task GivenSomething() { await DoStuff(); } private async Task DoStuff() { …
2ooom
  • 1,760
  • 1
  • 23
  • 37