Skip to content

Instantly share code, notes, and snippets.

@dmitriy-kiriyenko
Created September 28, 2017 05:20
Show Gist options
  • Save dmitriy-kiriyenko/c70d7fd43810f4605b8704ce1bf0e4bb to your computer and use it in GitHub Desktop.
Save dmitriy-kiriyenko/c70d7fd43810f4605b8704ce1bf0e4bb to your computer and use it in GitHub Desktop.
Capybara etc tip
<%# http://www.venombytes.com/2013/03/11/faster-browser-specs %>
<% if Rails.env.test? -%>
<style type="text/css">
.notransition * {
/*CSS transitions*/
-webkit-transition: none !important;
-moz-transition: none !important;
-o-transition: none !important;
-ms-transition: none !important;
transition: none !important;
/*CSS transition properties*/
-webkit-transition-property: none !important;
-moz-transition-property: none !important;
-o-transition-property: none !important;
-ms-transition-property: none !important;
transition-property: none !important;
/*CSS transforms*/
-webkit-transform: none !important;
-moz-transform: none !important;
-o-transform: none !important;
-ms-transform: none !important;
transform: none !important;
/*CSS animations*/
-webkit-animation: none !important;
-moz-animation: none !important;
-o-animation: none !important;
-ms-animation: none !important;
animation: none !important;
}
</style>
<%= javascript_tag do %>
$.fx.off = true;
$($('body').addClass('notransition'));
<% end %>
<% end %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment