views:

19

answers:

0

So I just started using Steak, which in turn uses Capybara, which in turn uses Selenium.

So I've heard it's good RSpec practice to split testing into lots of little it-clauses, each testing a small piece of functionality. But then it makes a test run take a lot longer, because the same steps get repeated for each test.

Say I'm testing some ajax functionality. I want to test that:

  • a form appears when I click a certain link
  • error messages appear if I submit invalid input to that form
  • a confirmation message appears if I submit valid input, etc.

But if I have each of those things broken into its own test case, then Selenium has to start from scratch: it has to load the same page three times, click the link to make the form appear three times, etc. It strikes me as wasteful.

What I'd like to be able to do is specify a sequence of tests that preserve browser state, so each test continues where the previous one left off. Is that possible?