Created
June 6, 2014 16:10
-
-
Save paulnsorensen/8a31f5a7f9b58fb767fb to your computer and use it in GitHub Desktop.
Disabling CSS animations in tests
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%# 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 %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<%= yield :head %> | |
</head> | |
<body> | |
<%= yield %> | |
<%= render partial: 'layouts/spec_performance' %> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Digging this, but won't this only have an impact on view specs (i.e. cukes, capbara, etc)?