miguel.camba
miguel.camba

Reputation: 1827

optimize capybara times

I have test suite for acceptance tests in my rails app that uses pure capybara (no cucumber).

It has 220 examples and it takes 21 minutes to finish. My non-js driver is rack_test and my js_driver is capybara-webkit instead of selenium.

I would like to improve test times, but i have no idea if there is a common bottle-neck in this kind of testing.

Some ideas i have/had:

Upvotes: 1

Views: 601

Answers (1)

phoet
phoet

Reputation: 18835

there are two things that come to my mind:

  1. parallel_tests can improve your test-speed if you run multicore https://github.com/grosser/parallel_tests

  2. providing a backdoor-login-route for your test-login can improve test-speed by bypassing the login-step

in general acceptance-tests are slow. that's why i use them only for testing critical user workflows. i try to keep my whole test-suite within a 5 minute range. i really think that it's critical for your application test suite to be fast. that's why i try to put a lot of logic outside of rails tests so that a test-run completes within a second or less.

Upvotes: 2

Related Questions