Skip to content

[EE] Upgrade to Capybara 3

Heinrich Lee Yu requested to merge upgrade-capybara-ee into master

What does this MR do?

Upgrades Capybara to version 3.22.0

Capybara's new default server is puma. I set it to webrick to retain old behavior.

Breaking changes:

  1. first and all matchers now have the waiting/retrying behavior found in the other Capybara finders and matchers

    I had to add to change some code to first('div', minimum: 0) because these now throw exceptions when no element is found.

    For all, I had to add wait: false to some of our selectors that sometimes return no elements. This doesn't throw an exception but the tests become very slow because Capybara would try to wait until default_max_wait_time.

  2. Whitespace is not normalized by default

    I changed the global setting to normalize by default. Still, there is a slight change in behavior.

    With normalize_ws: true, Capybara fully normalizes all whitespace to a single space. In Capybara 2, only parts of the whitespace was normalized, some \n are returned.

    So I had to change some of our assertions to match the new behavior

EE-port of https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/27776/diffs

Does this MR meet the acceptance criteria?

Conformity

Performance and testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team
Edited by Coung Ngo

Merge request reports