UNPKG

cypress-enterprise-commands

Version:

Reusable Cypress custom commands for enterprise web applications

21 lines (20 loc) 604 B
"use strict"; Cypress.Commands.add("inputTextArea", (index, text) => { cy.get("textarea") .eq(index) .scrollIntoView() .should("be.visible") .clear() .type(text); }); Cypress.Commands.add("inputDecimal", (index, value) => { cy.get('input[inputmode="decimal"]') .eq(index) .scrollIntoView() .clear() .type(value.toString()); }); Cypress.Commands.add("inputText", (attr, str) => { cy.getByTestAttribute(attr).scrollIntoView().click({ force: true }); cy.getByTestAttribute(attr).scrollIntoView().clear().type(str); });