Andrei Botalov
Andrei Botalov

Reputation: 21096

Running cucumber scenarios against multiple environments?

I have a suite of scenarios that should be runned against a site. Now I want to make a configuration testing using this test suite against large amount of urls. The tests that should be runned are equal, the only difference is base url of site.

Currently I have the following ideas on how it can be done:

  1. Convert scenarios to scenario outlines.
    Disadvantage: I should provide examples in each of scenario outlines. One "Examples" will be list of base urls of sites. All lists will be equal and copy-pasted for each of scenario outlines.
  2. Gem cuke_iterations.
    Disadvantage: I need to specify tags in each of my scenarios
  3. Iterating over urls in Rakefile.
    Disadvantage: If I'll do it like

    # Iterating over urls 
      # Running Cucumber::Rake::Task
    end
    

    then new copies of Cucumber and driver will be created for each of urls. It will take too much time

  4. Use hooks. But I don't know how it can be done via them

What's the best method to solve it?

Upvotes: 1

Views: 1586

Answers (1)

Jon M
Jon M

Reputation: 11705

As the author of the cuke_iterations gem, I'll jump in to say your situation is exactly what it's designed for. It hadn't crossed my mind that you may not want to specify tags for each scenario, I will look into removing that requirement.

Don't forget that you can specify tags at the feature level, which will then apply to any scenario contained within that feature, so depending on how many scenarios per feature you have, it may not be a huge disadvantage.

Upvotes: 3

Related Questions