Showing posts with label BDD. Show all posts
Showing posts with label BDD. Show all posts

Wednesday, November 3, 2010

@ignore SpecFlow scenario

When you have all SpecFlow scenarios working, you always run them.
However, sometimes tests are incomplete or just broken. The correct course of actions is to fix or complete tests, but often you just don't have time (yeah, you need to deliver the product next day, but it will take two days to fix the test). In this case you may use a predefined tag, @ignore with SpecFlow scenarios. Adding this tag to a scenario will mark this test is ignored. That will allow you to pass tests without having ignored tests

For instance, you have a scenario which doesn't work yet

Scenario: Create User
Given ....


Running it as is causes a test (and the whole test suite) to fail





So once you modify as below


@ignore
Scenario: Create User
Given ....


You have your tests passed (or, more precisely, not failed).




P.S. Ignoring an issue is just a way to postpone its resolution, you'd need to fix to this scenario anyway. However, if this scenario isn't needed, just delete it.

Monday, August 2, 2010

Given-When-Then with SpecFlow

I think that key articles for understanding how BDD tests should be written are
Given-When-Then
and The Truth about BDD
I really recommend to read those articles if you're involved into any BDD testing (whether they use SpecFlow or not)