0

At the moment my specification files are along the lines of:

Scenario Outline: Do stuff
    Given I am on the "<website>"
    And I have entered "red" into the search field
    When I do something
    Then something happens

Examples: 
| Description | website         |
| Domain1     | www.domain1.com | 
| Domain2     | www.domain2.com |
| Domain3     | www.domain3.com |

Which works ok, to a point but isn't very repeatable or extendable for other environments (e.g. dev, test, uat, rel, stg etc..).

What's best practice here?

  • Get the site details from a database?
  • Get the site details from config?
  • Something else?

My end goal is to have a suite of repeatable acceptance tests, that can run on a box, which can be pointed to whichever combination of environments is needed at that time.

1

I would put it in the app.config file, so you define which website to test for all your tests in one place.

You could combine this then with a config file transformation to get more flexibility.

One option to do is, to use the SpecFlow+Runner and the Targets- Feature (http://www.specflow.org/plus/documentation/SpecFlowPlus-Runner-Profiles/#Targets).
You could define for every website to test a target which contains a config-transformation to the appropriate url. This results that you have every tests for every target also in your test explorer.

Full Disclosure: I am one of the developers of SpecFlow+.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.