Peeling cucumbers

SO Folk,

Do any of these parts know if you can leave Cucumber to clear the test data at the end of the run? I have several tests that continue to fail, and I would like to look at the data supporting these tests ...

Any ideas?

Thanks! Corey Wilkerson

+6
ruby-on-rails integration-testing cucumber
source share
3 answers

There are a few comments about this in your features/support/env.rb file. If you do not want to roll back the database after completing a specific script, add the @no-txn tag to the script. Then you will need to clear the db yourself. The easiest way is to make db:test:clone .

The best way to fix your problems is to run the problem scenarios individually and see how each of them is faulty. If you run a run and you have scripts that leave data in the database, then you will cause all kinds of problems. After you correct the script, do db:test:clone before working on the next one or run it.

+5
source share

Here's definitely for the debugging phase, which I mentioned in a comment on Sam Livingston-Gray:

 When /I want to debug/i do debugger true # never put debugger at the end of a method end 
+3
source share

A bit hacky, but in a pinch, perhaps you could add a Then block, called "Then pause tests", which either stops or goes into the polling cycle, and does not continue until it sees some change in conditions (for example, do you touch /features/continue.txt)?

Stick to โ€œSuspend Testsโ€ in the test you want to see, and you have a way to check the database before continuing. Of course, this does not work if Cucumber uses database transactions ...

(Sorry for the uncertainty, it has been a while since I last used Cucumber.)

+1
source share

All Articles