From 54e6aeb0ead3e1280bcaff1a5ba8a813a8cc69ec Mon Sep 17 00:00:00 2001 From: Felipe Elia Date: Thu, 8 Aug 2024 09:47:40 -0300 Subject: [PATCH] Fix Cypress typing --- tests/cypress/support/commands.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/cypress/support/commands.js b/tests/cypress/support/commands.js index f18b1411e..c8f415be3 100644 --- a/tests/cypress/support/commands.js +++ b/tests/cypress/support/commands.js @@ -84,6 +84,13 @@ Cypress.Commands.add('createTerm', (data) => { }); Cypress.Commands.add('clearThenType', { prevSubject: true }, (subject, text, force = false) => { + /** + * Typing 'x' and immediately deleting it, as sometimes Cypress is too fast and + * does not type the first character(s) correctly. + * + * @see https://github.com/cypress-io/cypress/issues/3817 + */ + cy.wrap(subject).type('x'); cy.wrap(subject).clear(); cy.wrap(subject).type(text, { force }); });