Skip to content

Capybara slow steps - what to do ?

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

Problem

Some feature specs are waiting 30 seconds (default max wait time) un-necessarily

Proposal

Digest https://www.cloudbees.com/blog/faster-rails-tests, and https://github.com/ngauthier/capybara-slow_finder_errors#common-fixes to find some automated way to:

  1. Detect these slow steps
  2. Fix these slow steps

/cc @alinamihaila

Discussion

  1. Capybara auto-waits for certain finders / steps. e.g. find_all, has_button?

  2. We cannot naively apply wait: false to every Capybara step. To find, and fix these requires some pre-conditions:

    1. The previous step has already waited
    2. The current step does not have to wait in the success case
    3. The current step in the failure case will always fail deterministically (due to 1)

Links

Some example fixes:

Edited by 🤖 GitLab Bot 🤖