specflow

How to use a supported language by gherkin in Specflow?

时光总嘲笑我的痴心妄想 提交于 2019-12-13 07:09:04
问题 I want to use persian language for authoring BDD scenarios using Specflow in Visual Studio 2013. I added following config to specflow config section: <language feature="fa-IR" tool="en" /> But when Specflow tries to generate test out of the scenarios, it emits following error: #error The specified feature file language ('fa-IR') is not supported. 来源: https://stackoverflow.com/questions/37942289/how-to-use-a-supported-language-by-gherkin-in-specflow

Specification Testing with EF - The ObjectContext instance has been disposed

让人想犯罪 __ 提交于 2019-12-13 05:19:27
问题 I have the following SpecFlow scenario: [When(@"the registration is submitted")] public void WhenTheRegistrationIsSubmitted() { //var controller = _kernel.Get<AccountController>(); var factory = new HockeyDbContextFactory(); var userRepository = new Repository<User>(factory); var cryptoService = new CryptoService(); var roleRepository = new Repository<Role>(factory); var playerService = new Mock<IPlayerService>(); var leagueService = new Mock<ILeagueService>(); var userService = new

Coded UI - UITestControlCollection using FindMatchingControls() is empty on consecutive runs

半腔热情 提交于 2019-12-13 04:48:32
问题 I use SpecFlow with Coded UI to create some automated functional tests for a WPF application. Let's see the following SpecFlow scenario: Scenario: Issue When Results button is pressed When Result 123 is selected When Results button is pressed When Result 123 is selected 1st and 3rd row parameter: Results 2nd and 4th row parameter: 123 Here are the methods for the upper mentioned steps: When Results button is pressed public void PressButton(string buttonName) { WpfButton uIButton = this.UIAUT

Wrong step name displayed in Extent Report And replaced with When

核能气质少年 提交于 2019-12-13 03:26:53
问题 I am using the given code in spec flow to generate the extent report. Test execute and report generated successfully but wrong steps name displayed in the extent report, And in the extent report replace with When. Steps come under And displayed in When while in the feature file steps written in And section. Steps written under And syntax in feature files, displaying under When in Extent report. I am using the following code to generate extent report. using AventStack.ExtentReports; using

Specflow - State between “scenarios”

情到浓时终转凉″ 提交于 2019-12-12 14:27:32
问题 Using Specflow, I'm writing a suite of scenarios that model monthly payrolls, validating the calculated payments for each month and finally the yearend figures. The result of each month is cumulative, so each subsequent scenario is dependent on the previous month’s additions and deductions. The payment calculations are written to a database via a third party tool, so creating and destroying test data between scenarios is expensive. From my experience with testing, I know it's not always

How to Structure CRUD Tests using BDD

折月煮酒 提交于 2019-12-12 14:15:55
问题 I'm stuck at a bit of a quandary trying to figure out the best way of structuring my CRUD tests. Within my application users have the ability to create several types of 'tasks'. My currently implementation looks something like the following: Scenario: Create Task-Type A Given I am on a user's profile page And Have access to create tasks When I create a new task with a unique title and description Then The confirmation prompt should display Scenario: Read the Task-Type A Given A new task was

Coded UI - “Continue on failure” for Assertions

半城伤御伤魂 提交于 2019-12-12 13:20:04
问题 I'm using SpecFlow with Coded UI to create automated tests for a WPF application. I have multiple assertions inside a "Then" step and a couple of them fails. When an assertion fails, the test case is failed and the execution is stopped. I want my test case to go ahead till the end with the execution and when the last step is performed if any failed assertions were present during the execution I want to fail the whole test case. I found only partial solutions: try { Assert.IsTrue(condition) }

SpecFlow “Generate Test Definition” context menu missing in VS2015

拈花ヽ惹草 提交于 2019-12-12 12:36:57
问题 I'm trying out VS2015 and writing SpecFlow feature files. When I right click on the file, I cannot find "Generate Test Definitions" context menu. This happens only in "Class Library (Package)" which is obviously DNX 5.0 library. Here is my project.json: { "version": "1.0.0-*", "description": "", "authors": [ "" ], "tags": [ "" ], "projectUrl": "", "licenseUrl": "", "dependencies": { "SpecFlow": "1.9.0", "SpecFlow.xUnit": "1.0.2", "xunit": "2.1.0-beta3-build3029", "xunit.extensions": "2.0.0" }

SpecFlow - Find all scenarios from method step and Find all unimplemented steps

有些话、适合烂在心里 提交于 2019-12-12 10:23:34
问题 New to SpecFlow. When specs project become larger, organizing files and refactoring Given/When/Then string become troublesome. How to find Scenarios in feature file from method step. Sometimes I have a steps shared in a few scenarios and features but from the C# step method view how to 'Find All References' in feature file? How to get all unimplemented scenario steps (font color purple) in all features files so that I can implement the steps. Currently when I Run All tests, no warn about

How to set up individual tracing / logging with SpecFlow

耗尽温柔 提交于 2019-12-12 08:17:42
问题 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