Disable text-transforms in Selenium tests

Updated . Posted . Visible to the public. Deprecated.

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

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

    [data-environment="test"] *
      text-transform: none !important
    
Tobias Kraze
Last edit
Henning Koch
Keywords
css
License
Source code in this card is licensed under the MIT License.
Posted by Tobias Kraze to makandra dev (2013-09-23 09:30)