Reconfigured cypress / typescript / vite.

This commit is contained in:
Jay
2025-06-17 10:19:39 -04:00
parent ce8cf473c9
commit c0343f2378
10 changed files with 84 additions and 60 deletions
+30 -1
View File
@@ -34,4 +34,33 @@
// visit(originalFn: CommandOriginalFn, url: string, options: Partial<VisitOptions>): Chainable<Element>
// }
// }
// }
// }
Cypress.Commands.add("dataCy", (value: string) => {
return cy.get(`[data-cy="${value}"]`);
});
Cypress.Commands.add("disableTransitions", () => {
cy.document().then((document) => {
const style = document.createElement("style");
style.id = "cypress-disable-transitions";
style.innerHTML = `
* {
transition: none !important;
animation: none !important;
animation-duration: 0ms !important;
transition-duration: 0ms !important;
}
`;
document.head.appendChild(style);
});
});
Cypress.Commands.add("enableTransitions", () => {
cy.document().then((document) => {
const styleElement = document.getElementById("cypress-disable-transitions");
if (styleElement) {
styleElement.remove();
}
});
});