Gáspár Nagy on software

coach, trainer and bdd addict, creator of SpecFlow; owner of Spec Solutions

SpecFlow Tips: Put your hooks in order

by Gáspár on March 1, 2016

SpecFlow hooks (or events) are extension points where you can insert custom automation logic into the scenario execution before or after different sections, for example before any scenario execution. These can be used to perform custom preparation or cleanup logic, e.g. resetting the database. In bigger projects, you might need to have multiple hooks of the same kind. These run in an arbitrary order by default, which can be problematic in some cases. Hook ordering is a new feature in SpecFlow v2 that can help you in this situation. In the current “SpecFlow Tips” post, I am showing you how.

[read more…]

Integrating SpecFlow with Microsoft Test Manager (MTM)

by Gáspár on February 25, 2016

Many teams that are currently in a transformation process towards using agile and bdd have to face the problem that the new specification artefacts and reports have to be integrated into the existing tool chain. In the case of SpecFlow, many of such teams use Microsoft Test Manager (MTM, part of Team Foundation Server / Visual Studio Team Services). As the manual test activities (especially exploratory testing) also play an important role in agile testing and BDD, MTM might still have its place in the new tool chain. Also MTM has an important feature that it allows to run automated tests on different virtual lab environments (e.g. on different operating systems). As the structure of test cases in MTM are somewhat similar to the structure of Gherkin scenarios (title, tags, steps), it is an obvious idea to try integrating SpecFlow to MTM. I have worked on a prototype to test  this idea that I would like to present in this post.

[read more…]

Running SpecFlow scenarios in parallel with xUnit v2

by Gáspár on February 23, 2016

As mentioned earlier, one of the key new features of SpecFlow v2 is that you can run your tests in parallel within this same AppDomain. This is currently possible with NUnit v3 and xUnit v2. This post shows a step-by-step guidance about how this can be done.

[read more…]

SpecFlow tips: Feature file backgrounds — like them or not

by Gáspár on February 11, 2016

The format of the feature files used in Cucumber or SpecFlow is very simple. The format (or grammar), called Gherkin, was intentionally designed to be simple, so that the specification written in these files are kept simple and understandable. There are no loops or ifs. The only special structure you can make in a feature file is the “Background” section. In the background section you can list one or more given steps that will be implicitly included in every scenario of the file. So you can use it to extract common preconditions from the scenarios to avoid duplication. Sounds simple, but still, half of the BDD practitioners like and use this feature, while the other half doesn’t. Where do you belong to? Here is a list of pros and cons.

[read more…]

BDD Addict Newsletter February 2016

by Gáspár on February 8, 2016

Dear BDD Addicts,

bddaddict-newsletterWelcome to the first BDD Addict newsletter. My plan is to collect interesting posts, articles and events about behavior driven development, SpecFlow, Cucumber and also test automation and agile testing. I’m following many channels, but surely not all. So if you have seen something that fed your addiction, just send me the link with a few comments to bddaddict@specsolutions.eu.

Your dose for February 2016 contains the following topics:

  • [News] SpecFlow v2 Released!
  • [Process] Improve the collaboration part of BDD with example mapping (Matt Wynne)
  • [Number Crunching] 9% QA budget increase in 2015
  • [Learn:SpecFlow] All those tricky base classes
  • [Learn:SpecFlow] Clean up your automation code that vary by tags (Joe Buschmann)
  • [Event] CukeUp! London 2016

Read the full newsletter here. You can also subscribe to it at http://specsolutions.eu/bddaddict.