specflow

Specflow test step inheritance causes “Ambiguous step definitions”

天涯浪子 提交于 2019-12-05 00:37:35
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 HandleCustomer(Table table) { } } [Binding] public class FeatureOneStep : BaseStep { protected override void HandleCustomer(Table table) { // feature one action } [Given(@"feature one specific step")] public void GivenFeatureOneSpecificAction(Table table) { // do something } } [Binding] public class FeatureTwoStep : BaseStep { protected override void HandleCustomer(Table table)

Coded UI build server integration process

。_饼干妹妹 提交于 2019-12-04 21:49:07
We would like to integrate an automated functional test solution (developed using SpecFlow and Coded UI) in our build server. The project looks like this: the AUT is a WPF application the developers are working with Visual Studio 2010 Professional automation testers joined the project with Visual Studio 2012 Premium (VS Premium is needed for Coded UI tests) Visual Studio 2010 Professional is installed on the build server Jenkins is used a VM is configured for the development and a 2nd VM will be used by the testers Could someone help me with the build-server integration process? Which are the

Is there a way to run Specflow scenarios in desired order (C# Selenium)?

不打扰是莪最后的温柔 提交于 2019-12-04 17:28:13
I'm trying to run multiple Specflow tests in the Test Explorer, but the challenge is I'm unable to run them in the desired order. ex - I have 3 scenarios in my feature files: Login positive Login negative registration positive Currently, they run in random order. I want them to always run in the above order. How can I configure my feature files to make it possible? For NUnit: Tests inside a scenario run in alphabetical order, so if you want to run them in specific order just rename scenarios like Scenario: 1 Login positive Scenario: 2 Login negative Scenario: 3 Registration positive For other

Insert screenshots in SpecRun/SpecFlow test execution reports

不羁岁月 提交于 2019-12-04 14:23:15
问题 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

How to increase reusability between SpecFlow/Gherkin steps?

佐手、 提交于 2019-12-04 08:39:15
问题 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

Global [BeforeScenario], [AfterScenario] steps in SpecFlow

喜你入骨 提交于 2019-12-04 06:22:44
We're trying to implement global hooks on our specflow tests and are not entirely sure how [BeforeScenario] and [AfterScenario] attributed methods work. The way I've seen it done, those attributes are always defined in a class containing specific steps used in a few scenarios. Can they go somewhere so they apply to all scenarios? Or does attributing the methods with [BeforeScenario] and [AfterScenario] cause them to be run for all scenarios, regardless of where they're actually placed? Ben Smith Yes, you can create global BeforeScenario and AfterScenario methods, but in practice I find that

Specflow calling steps within steps causes “No matching step definition” error

强颜欢笑 提交于 2019-12-04 03:49:20
问题 I am following the technique outlined here using a step defined like [Given("some base scenario has happened")] public void SomeBaseScenarioHasHappened() { Given("some condition"); And("some action"); When("some result"); } from a scenario like Scenario: Some dependant scenario Given some condition And some base scenario has happened When some other action Then some other result However the step When some other condition produces the following error -> No matching step definition found for

Specflow setup to Share Hooks and Step Definitions Across VS Projects

大兔子大兔子 提交于 2019-12-04 02:11:42
问题 Currently working on a series of projects that are contained within one solution in VS2017. Each project is a specflow project, within one solution. I would like to setup the Hooks.cs file such that it's valid for any test within the entire solution, not just the project. I'd also like to make step definitions from one project available to the other projects as a base or utility step definition. How would I go about structuring specflow to make this possible? 回答1: You can use steps and hooks

How to set up individual tracing / logging with SpecFlow

夙愿已清 提交于 2019-12-03 22:15:29
For my SpecFlow tests, I want to setup an individual logging / tracing of the test progress during the execution of tests. E.g. i want to write all passed / failed steps started / ended scenarios started / ended features to the windows event log (in order to synchronize it with event log messages generated by other system components during the test). I tried to use the [BeforeFeature], [BeforeScenario], [BeforeStep] Hooks for doing that, but it turned out that I do not have all the required information within this hooks. E.g. i do not know how to get the current text line of the current step

Is it possible to programmatically add lines to a scenario?

浪尽此生 提交于 2019-12-03 15:42:22
I would like to add the same line to the start of each one of my SpecFlow tests. This line specifies a list of several scenarios which will change over time, and therefore it is not feasible to maintain this list for every test. For example: Given I have set my site theme to <MyTheme> |Theme Names| |Theme 1 | |Theme 2 | |Theme 3 | |Theme 4 | |Theme 5 | I'd like to have this test repeat for each of the themes. The list of themes is not set in stone, and should be maintained in a single place. So far, I've successfully managed to create a Generator Plugin , and I was planning on using this