specflow

Execute SpecFlow specs (.feature files) without compilation

别来无恙 提交于 2019-12-03 14:10:38
I want to be able to execute given SpecFlow (Gherkin) .feature file locally without doing compilation. So workflow would be (as a Business Analyst or a QA engineer): 1. modify .feature file (using predefined vocabulary of steps) 2. run SpecFlowSuperTool.exe /feature:.\FoobarprojectSpecs.feature /assembly:Foobarproject.dll,Foobarproject.Core.dll get a report Goal is to be able to execute feature on-demand without having to recompile the code if only features have changed. It feels like it should be a pretty straight-forward task to implement such a tool since Gherkin steps binding happens at

How to teach SpecFlow to add additional NUnit attributes to my test class

拜拜、爱过 提交于 2019-12-03 13:38:31
SpecFlow is great - and it helps us very much to do proper integration testing. One thing I was wondering is whether there's a way to tell SpecFlow to add additional NUnit attributes to the test class it creates in the feature code-behind file. Right now, my test class gets generated something like this: [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "1.8.1.0")] [System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [NUnit.Framework.TestFixtureAttribute()] [NUnit.Framework.DescriptionAttribute("Some action description here")] public partial class MySampleFeature {

Specflow use parameters in a table with a Scenario Context

心不动则不痛 提交于 2019-12-03 11:58:00
I am using Specflow in C# to build automatic client side browser testing with Selenium. The goal of these tests is to simulate the business scenario where a client enters our website in specific pages, and then he is directed to the right page. I Want to use parameters inside a Scenario Context, for example: When I visit url | base | page | parameter1 | parameter2 | | http://www.stackoverflow.com | questions | <questionNumber> | <questionName> | Then browser contains test <questionNumber> Examples: | <questionNumber> | <questionName> | | 123 | specflow-q1 | | 456 | specflow-q2 | | 789 |

Unit Test Adapter threw exception: Unable to load one or more of the requested types

南笙酒味 提交于 2019-12-03 11:18:25
I am attempting to run SpecFlow tests from the Visual Studio 2010 Command Prompt, and I am getting a rather obtuse error message: Unit Test Adapter threw exception: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.. Some info about my VS2010 Project setup: Windows 7 Enterprise, 64 bit (Version 6.1.7601 Service Pack 1 Build 7601) Visual Studio 2010 Premium (v10.0.40219.1 SP1Rel) Using Coded UI Tests Using SpecFlow 1.9.0, which delegates to the CodedUI test API MSTest .NET v4.0.30319 Whole solution is compiling to 32 bit code (I have

Insert screenshots in SpecRun/SpecFlow test execution reports

风格不统一 提交于 2019-12-03 09:03:18
I'm using SpecFlow with Selenium WebDriver and SpecRun as test runner to create and execute automated test cases and I'm looking for a solution to insert screenshots in the test execution report. I wrote a method to create screenshots after every Assert function. The images are saved to a specific location, but when I make the result analysis I have to follow the report and the images as well. It would be nice to have them in the same location (precisely in the report html). Is there any way to perform this (something similar to Console outputs)? (reposting from https://groups.google.com/forum

Specflow Feature files with same steps causing multiple browser instances to launch

僤鯓⒐⒋嵵緔 提交于 2019-12-03 07:55:22
I have at least 3 .feature files in my C# Specflow tests project in which I have the step, for instance: Given I am at the Home Page When I first wrote the step in the file Feateure1.feature and created the step method, I placed it in a step file, let's say, Steps1.cs , which inherits from a base class that initializes a FirefoxDriver . All my StepsXXXX.cs classes inherit from this base class. Then, I wrote Feature2.feature , which also has a step Given I am at the Home Page . And the step was automaticaly bound to the one in Steps1.cs 'Till now, no problem. That's pretty much what I wanted -

Specflow error: Force regenerate steps possible?

喜夏-厌秋 提交于 2019-12-03 06:23:28
问题 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 same steps are not bound. I have cleared everything and recreated both feature and step definition but now I cant event generate ALL the steps because specflow says they are bound already. 回答1: SpecFlow creates a .cache file in your Temp folder

How do I do unit & integration testing in a BDD style in ASP.NET MVC?

寵の児 提交于 2019-12-03 05:58:52
I am learning Behavior Driven Development with ASP.NET MVC and, based on a post from Steve Sanderson, understand that BDD can mean, at least, the following test types: individual units of code & UI interactions. Something similar is mentioned in this post . Do I need two different test frameworks if I want both unit and integration testing? Unit testing repositories, controllers, & services using a context/specification framework, like MSpec. The results of testing with this will be useful to the development team. Testing complete behaviors (integration) using a given/when/then framework, like

How do I get SpecFlow to expect an exception?

陌路散爱 提交于 2019-12-03 04:43:37
问题 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 exception It's calculator.Add() that's going to throw an exception, so how do I handle this in the method marked [Then] ? 回答1: Great question. I am neither a bdd or specflow expert, however, my first bit of advice would be to take a step back and assess your scenario.

How to increase reusability between SpecFlow/Gherkin steps?

爱⌒轻易说出口 提交于 2019-12-03 00:25:59
I think I thoroughly understand the concepts and ideas behind SpecFlow, but even after reading the Secret Ninja Cucumber Scrolls , The Cucumber Book , and going through the various forums I'm still unsure about the path to reusability. Our scenarios already comply to various guidelines Self explanatory Must have a understandable purpose (what makes it different from the other scenarios) Are unique Represent vertical functional slices Uses Ubiquitous Language Written from the stakeholder perspective About business functionality, not about software design Grouped by Epics ARE NOT TEST SCRIPTS