Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I use Selenium IDE to generate Cucumber/Capybara steps?

I've both installed Selenium IDE (Firefox addon) and Capybara (gem). I'm now driving Selenium from Cucumber/Capybara steps (@javascript) in my rails app.

The question is:

Can I export Selenium IDE steps as Cucumber/Capybara steps?

In Selenium IDE Options > Format I can only see Ruby (Test::Unit) and RSpec, but having Capybara format as well would be awesome.

Thank you.

like image 819
Leonardo Dario Perna Avatar asked Dec 20 '10 07:12

Leonardo Dario Perna


1 Answers

I don't believe it is possible to export Selenium IDE tests as Cucumber scenarios. Honestly, I'm not even convinced that it would make sense to build such an exporter - Selenium IDE tests are focused on the technical interactions of the test - click this button, type into that field, wait for this page to load. Good Cucumber tests are focused on higher-level user actions - for a healthcare system, your Cucumber tests might have "When I admit a new patient named Joe Blow" in them rather than "When I click the new patient link And I enter a first name of Joe and I enter a last name of Blow". You might be able to define some sort of matcher to recognize some of these combinations of technical interactions into the higher level abstractions, but it would be highly dependent on each system under test.

I haven't yet used Capybara, so I'm not sure whether an export to that format would be feasible.

like image 182
Andy Tinkham Avatar answered Sep 22 '22 13:09

Andy Tinkham