specflow

Should I use specflow at unit test level? [duplicate]

落花浮王杯 提交于 2019-12-20 12:24:12
问题 This question already has answers here : Closed 8 years ago . Possible Duplicate: SpecFlow/BDD for Unit Tests? Over the last few years I have worked in TDD using NUnit/Moq and over the last few months I have been getting to grips with BDD using mSpec. So far so good but we now want to move more into acceptance criteria based tests where the business analysts are involved and we get an outside in development process. So now we have predefined Gherkin syntax files and with specflow it feels the

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

送分小仙女□ 提交于 2019-12-20 08:56:39
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 3 years ago . 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 read. There are some good tools (see: How to get Gherkin syntax

Specflow step argument transformation on table cell contents with CreateInstance

醉酒当歌 提交于 2019-12-20 01:21:50
问题 Has anyone solved the riddle of how to apply SpecFlow Step Argument Transformations to cells in a table, in conjunction with the SpecFlow.Assist CreateInstance/CreateSet? (code combined here to save space) Given a table like the following: | Price | Zip | Effective Date | | 10.00 | 90210 | in 2 days | When the 'given' step executes And the table data populates a poco Then the effective date should be transformed into a DateTime with value of 2 days from today [Given(@"a table like the

How to transform Spec-flow table data into different values

删除回忆录丶 提交于 2019-12-19 23:28:32
问题 I need to transform Spec-flow table data that we get via table.CreateInstance() or table.CreateSet() . I am using Spec flow for DB testing and in some cases, Table field values needs to be mapped to different values as DB tables are storing codes instead of the the values we have entered in tables of feature files. I do not want to include the codes in feature files as it reduces the readability. For example, If I have entered Single for status as mentioned below, I want it to be mapped or

How to transform Spec-flow table data into different values

China☆狼群 提交于 2019-12-19 23:27:50
问题 I need to transform Spec-flow table data that we get via table.CreateInstance() or table.CreateSet() . I am using Spec flow for DB testing and in some cases, Table field values needs to be mapped to different values as DB tables are storing codes instead of the the values we have entered in tables of feature files. I do not want to include the codes in feature files as it reduces the readability. For example, If I have entered Single for status as mentioned below, I want it to be mapped or

SpecFlow Re-usable step definitions

天大地大妈咪最大 提交于 2019-12-18 11:55:54
问题 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 回答1: Why yes it's possible - check out the calling steps from step feature (https://specflow.org/documentation/Calling

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

随声附和 提交于 2019-12-17 17:56:17
问题 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? 回答1: In SpecFlow 1.3 there are three methods: static members ScenarioContext ContextInjection Comments: static members are very pragmatic and in this case not so evil as we as developers might first think (there is no threading or need for mocking/replacing in step-definitions)

NUnit Specflow how to share a class instance for all tests

╄→гoц情女王★ 提交于 2019-12-17 06:14:24
问题 I am using Specflow with NUnit and Selenium and want to share instance of driver across all tests. I can do do this up to feature level with FeatureContext but can't see anything for all tests. I am aware that this is probably not the right way to go but I want to know if there is a way. Please help with example(s). Thanks 回答1: There are a few ways to do this. Most are covered on this page What I personally would probably do is define a SeleniumContext class and require this class in all my

DataSource attribute with Specflow for multiple browser testing

六眼飞鱼酱① 提交于 2019-12-14 01:13:40
问题 I have some web ui tests in C# which are executed through selenium in browserstack. Currently these are just simple unit ms tests and they are executed againts different browsers. I want to port the test to specflow, but I don't really know how to do the multiple browser testing bit. At the moment, to execute these tests in multiple browsers I am using a DataSource attribute, which basically takes different inputs for the same tests from an XML file [TestMethod] [Ignore] [DeploymentItem("JLL

Specflow Association with .feature Files

泄露秘密 提交于 2019-12-13 18:32:00
问题 I have installed Specflow via Nuget, but .feature files do not appear to be associated with Specflow. The TechTalk.Specflow DLL is present in the references for the DLL containing my tests. Right clicking on a feature file and selecting Run Tests results in a dialog No tests found in file. Can anyone help me diagnose this? 回答1: The nuget package gives you everything you need to run SpecFlow tests, but there is a separate installation @ The Visual Studio Gallery which gives you the design time