Kevin
Kevin

Reputation: 485

How to get cucumber to run the same steps against Selenium and a headless browser

I've been doing some work testing web applications with Cucumber and I currently have a number of steps set up to run with Culerity. This works well, but there are times when it would be nice to run the exact same stories in Selenium.

I see two possible approaches that may work:

  1. Writing each step so that it performs the step appropriately depending on the value of some global variable.
  2. Having separate step definition files and somehow selectively including the correct one.

What is the preferred method for accomplishing this?

Upvotes: 4

Views: 701

Answers (4)

A user
A user

Reputation: 1108

You can schedule the tests to run in Jenkins. Local machine Jenkins software is open source. You can get cucumber plugin in Jenkins so that you can achieve reporting part to your project on top of continuous test run

Upvotes: 0

millisami
millisami

Reputation: 10161

I think this is the one you are looking for. http://robots.thoughtbot.com/post/1658763359/thoughtbot-and-the-holy-grail

Upvotes: 0

paulbjensen
paulbjensen

Reputation: 838

HI, have you looked at Capybara? It will allow you to use a variety of web drivers, and will allow you to test javascript-related features as well.

Upvotes: 1

agentofuser
agentofuser

Reputation: 9317

Third option: See if Culerity implements the Webrat API. Its README file says: "Culerity lets you (...) reuse existing Webrat-Style step definitions". Couldn't find much more than that though. Ideally, you would be able to switch backends with a config option or command-line argument without having to touch the step definitions.

Of course this would only work if you're not testing Javascript, which Culerity supports, but Webrat doesn't.

Upvotes: 1

Related Questions