Skip to content

Instantly share code, notes, and snippets.

View GlickG's full-sized avatar

Garrett Glick GlickG

View GitHub Profile
@GlickG
GlickG / commands.js
Created April 28, 2022 02:11 — forked from cvan/commands.js
cypress disable basic css transitions + animations
Cypress.Commands.add('cssDisableMotion', (selector = 'head') => {
cy.get('html').then(() => {
document.querySelector(selector).insertAdjacentHTML('beforeend', `
<style>
/* Disable CSS transitions. */
* { -webkit-transition: none !important; -moz-transition: none !important; -o-transition: none !important; transition: none !important; }
/* Disable CSS animations. */
* { -webkit-animation: none !important; -moz-animation: none !important; -o-animation: none !important; animation: none !important; }