Posted over 7 years ago. Visible to the public. Deprecated.

Disable text-transforms in Selenium tests

This doesn't seem to be an issue when testing with Chrome instead of Firefox.

Using text-transform: uppercase - especially on form labels - can cause you serious headaches in Selenium tests. Sometimes the web driver will see the uppercase text, sometimes it won't, and umlauts will be a problem as well.

Simply disable it in tests, by

  • adding a body class for tests

    Copy
    %body{'data-environment' => Rails.env}
  • overriding the transforms

    Copy
    [data-environment="test"] * text-transform: none !important

makandra has been working exclusively with Ruby on Rails since 2007. Our laser focus on a single technology has made us a leader in this space.

Owner of this card:

Avatar
Tobias Kraze
Last edit:
about 3 years ago
by Henning Koch
Keywords:
css
About this deck:
We are makandra and do test-driven, agile Ruby on Rails software development.
License for source code
Posted by Tobias Kraze to makandra dev
This website uses short-lived cookies to improve usability.
Accept or learn more