specflow

Specflow Binding from External Assembly always purple

风流意气都作罢 提交于 2019-12-07 04:56:54
问题 I have bindings in an external assembly (As per the specflow docs here) We need this, as we are making a generic library of Step Definitions that can be used in any of our test suites. It works, however some specflow functionality does not appear to work. Namely: All steps are highlighted purple (Indicating that it cannot be matched with a binding) If you select a step and hit F12 or right-click and select "Go To Step Definition", it says it cannot find a matching binding. However, the code

Default Values Specflow Step Definitions

南楼画角 提交于 2019-12-07 03:51:05
问题 I'm starting out in the world of SpecFlow and I have come across my first problem. In terms of keeping my code DRY I'd like to do the following: Have two scenarios: Given I am on a product page And myfield equals todays date Then... Given I am on a product page And myfield equals todays date plus 4 days Then... I was hoping to use the following Step Definition to cover both variants of my And clause: [Given(@"myfield equals todays date(?: (plus|minus) (\d+) days)?")] public void

Clean Up after Canceling tests

纵然是瞬间 提交于 2019-12-07 00:52:12
问题 I'm currently running tests through visual studio. Before all the tests are run, I automatically create a set number of users with know credentials, and at the end of the run I delete those users. However, sometimes I need to cancel my tests midway. In these cases the test never gets the chance to clean up, this means that there is left over fake user info from the test run and may causes the next test run to crash (when it attempts to add user info into the DB). Is there anyway to force

Providing multiple When statements for SpecFlow Scenario

风格不统一 提交于 2019-12-07 00:46:56
问题 Fairly new to SpecFlow so bear with me. I was working with a colleague to get a basic understanding of what you can do with SpecFlow. We were using the classic FizzBuzz problem, which we have used to test unit testing to compare how we would do a similar problem in SpecFlow. we wrote our scenarios as follows growing the code as needed: (please excuse naming just wanted to get the tests writ) Scenario: 1 is 1 Given there is a FizzBuzzFactory When you ask What I Am with the value of 1 Then the

Loading NUnit project file (example.nunit) during Specflow feature execution

五迷三道 提交于 2019-12-06 23:42:28
To enable environment configuration, I included an NUnit project as part of the SpecFlow BDD framework (as per Pass parameters via command line to NUnit ). But when I try to load it from the command prompt, I am getting the error message .\nunit-console-x86.exe : Unable to locate fixture. Command trying to run: nunit-console-x86.exe example.nunit /config:CI /run:"xxxx.Features.abcdFeature" $dll_dir /result=$result_dir The framework is as per SpecFlow and Selenium-Share data between different step definitions or classes , using NUnit 2.6.4 and SpecFlow 1.9. My NUnit project file. Do we need to

SpecFlow: ClassInitialize and TestContext

江枫思渺然 提交于 2019-12-06 22:30:49
问题 first of all I'm new to SpecFlow. I have a feature file which I have / want to automate using MSTest to run as a functional test involving a fully set up server, data access ... For this purpose I have to configure the server with the data in the SpecFlow's 'Given' blocks and start it afterwards. I also have to copy some files to the test's output directory. In the non-SpecFlow functional tests I was using the ClassInitialize attribute to get the TestDeploymentDir from the TestContext;

Error with specflow in visual studio 2012 with <unitTestProvider>

非 Y 不嫁゛ 提交于 2019-12-06 22:05:48
问题 I am using selenium, Specflow and nUnit to run automated tests with visual studio. The code was working with visual studio 2010. After I installed visual studio 2012, selenium and Specflow again (I think I did it right), it stopped working. First, the steps didn't recognize their definitions and I think I fix it writing [Binding] in all the c# files that contains their definitions. Now when I try to build the project it shows an error that I can't solve to all feature files. It shows 50

Passing arrays of variable in specflow

喜夏-厌秋 提交于 2019-12-06 18:08:05
问题 Is there a way to pass an array of parameters instead of passing each parameter individually? For example I have the following scenarios: When i login to a site then <firstname>, <lastname>, <middleName>, <Desingation>, <Street>, <Apartmentno> are valid The list can go on above. Instead can I pass all the above variables in an array? 回答1: You can pass a comma separated string and then transform it into a list: When i login to a site then 'Joe,Bloggs,Peter,Mr,Some street,15' are valid [Then("'

Preparing data for a SpecFlow scenario [closed]

戏子无情 提交于 2019-12-06 16:04:39
Closed . This question is opinion-based . It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post . Closed 3 years ago . I'm going to test a complex scenario which expects several other steps to have performed prior to it. For example , it can be equivalent to have proper data in a warehouse before goods are taken our from it. So in order for fetching to happen, it must first be made sure that there are products in the warehouse and there is a fetch-order. There may be seperate screens to

Coded UI build server integration process

感情迁移 提交于 2019-12-06 15:24:16
问题 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