specflow looks like a solution I want my team to consider using. My manager, however, isn’t real fond of BDD-style tests. Because of the nice integration of specflow with visual studio, I’m wondering if I could leverage the specflow framework while allowing a less bdd-style form of tests.
For example, instead of writing a test like:
Scenario: Help->About
Given a user is logged in to "http://..." as "user/password"
And they are on the page titled "Home"
When I click on "about"
Then I should see a window titled "about"
… I would like to write it as:
Scenario: Help->About
log in to "http://..." as "user/password"
click on the "About" link
assert "About" window should be visible
In other words, must I use keywords like Given, Then, etc. or is specflow able to handle steps that don’t begin with those words?
Specflow uses the Given, When and Then keywords in the code generator to generate a test case like this:
The only way to change the tests to the way you described is by changing the code generator. The
TryParseStepKeyword()method in GherkinDialect is a good start