specflow

Why do my SpecFlow tests not show up in Visual Studio Test window?

ぐ巨炮叔叔 提交于 2019-12-01 02:37:38
问题 I have gone through the Getting Started tutorial for SpecFlow. Everything worked fine except that I have the @SpecRun test because I have not entered a demo key. But in our main project we use NUnit instead of SpecFlow+ Runner. So I tried to mimic that project. If you use NUnit you won't need the demo key. So I changed the Unit Test Provider to: <specFlow> <unitTestProvider name="NUnit" /> </specFlow> I also compared my tutorial references to the main project's references. I find that I can

How to get the current executing step information in Specflow

假装没事ソ 提交于 2019-12-01 02:10:46
问题 We are trying to take screenshots for each step. Everything works fine. But we are not able to correlate the screenshots to the steps which created them. What we would like is something like FeatureContext.FeatureInfo and ScenarioContext.ScenarioInfo . But at individual step level. So that we can tag the screenshots accordingly. 回答1: EDIT Classes have been added which expose: ScenarioStepContext.StepInfo.Text and ScenarioStepContext.StepInfo.StepDefinitionType Which should give you what you

SpecFlow Integration Testing with Database Patterns

痞子三分冷 提交于 2019-11-30 19:35:35
I'm attempting to set up SpecFlow for integration/acceptance testing. Our product has a backing database (not a huge one though) in Sqlite. This is actually proving to be a slightly sticky point though; how do I model the database for the tests? I would like to know what patterns others out there use for doing integration/acceptance testing with backing databases. I can think of the following approaches: Compile a database into the assembly with the tests, then shadow-copy it for each test. Seems slow though. I could create the database in memory and populate it with pre-determined data. I

Multiple Browsers Tests using Webinator+Selenium, SpecFlow and NUnit

佐手、 提交于 2019-11-30 17:51:36
问题 I'm developing an ASP.NET MVC 3 app with WebinatorSpecFlow+NUnit using the Selenium driver. I'm having a problem running parallel tests with Chrome (using chromedriver) and Internet Explorer. Whenever I have both tests running in the same session and in parallel by Selenium via Webinator, IE seems to hang when I send any click action to the page. I'm not able to use the solution suggested here, since SpecFlow generates the underlying C# code automatically. My solution is designed like this

How to integrate Appium with C#?

瘦欲@ 提交于 2019-11-30 09:09:01
I am unable to find a single post where i can automate mobile testing with appium in C#. I have written my Website automation code in the specflow. Can I also Reuse it ? Appium provides the dotnet-appium-driver which is your API to interface with Appium. You can use that to write your app automation. You did not provide any example here nor code, so I cannot really act on something to show you. I will just write down some C# code to let you understand how a simple test in C# can be written: namespace AppiumTests { using System; // .NET unit test namespaces needed here as well, just not

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

ぃ、小莉子 提交于 2019-11-30 08:19:10
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 sweets by | Field | Value | | Filter.KingSize | True | | Filter.ContainsNuts | False | Then I should see : | Value | | Yorkie King Size | | Mars King Size | Scenario: Filter sweets by make Given I am on the "Sweet/List" Page When I filter sweets by | Field | Value | | Filter.Make | Haribo | Then I should see : | Value | | Starmix | These scenarios are

SpecFlow/BDD for Unit Tests?

一笑奈何 提交于 2019-11-30 06:42:12
问题 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 about BDD are we just talking integration/acceptance tests, or are we also talking unit tests - a total replacement for TDD? I've only used it on small projects, but I find that even for my unit tests, SpecFlow improves code documentation and

SpecFlow Re-usable step definitions

≯℡__Kan透↙ 提交于 2019-11-30 05:15:30
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 to get this working with SpecFlow (doesnt seem to like inheritance) Is there a way to share steps across features? Many thanks Why yes it's possible - check out the calling steps from step feature ( https://specflow.org/documentation/Calling-Steps-from-Step-Definitions/ ) In short you create a step definition class that inherits from Steps like this

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

筅森魡賤 提交于 2019-11-30 04:36:07
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 Cucumber might also work with SpecFlow. You can mark the feature with the tag @ignore: @ignore @web Scenario: Title should be matched When I perform a simple search on 'Domain' Then the book list should exactly contain book 'Domain Driven Design' In the recent version of Specflow, you now also have to provide a reason with the tag, like so: @ignore

SpecFlow Integration Testing with Database Patterns

吃可爱长大的小学妹 提交于 2019-11-30 03:13:41
问题 I'm attempting to set up SpecFlow for integration/acceptance testing. Our product has a backing database (not a huge one though) in Sqlite. This is actually proving to be a slightly sticky point though; how do I model the database for the tests? I would like to know what patterns others out there use for doing integration/acceptance testing with backing databases. I can think of the following approaches: Compile a database into the assembly with the tests, then shadow-copy it for each test.