chrismjx
chrismjx

Reputation: 19

How to make Cypress NOT wait between clicks

I have a test case where we found a bug that surfaces when you rapidly click two buttons on the page. I'm trying to write a test around this, so I need to make Cypress rapidly click the two buttons rather than waiting for the first click event to complete. Is this even possible in Cypress? I am not finding any information that seems to be what I'm looking for.

Upvotes: 0

Views: 553

Answers (1)

pixelistik
pixelistik

Reputation: 7820

You could try to click() with a combination of the arguments multiple (Serially click multiple elements) and force (Forces the action, disables waiting for actionability). Documentation with details.

Example:

cy.get(".my-button").click({ multiple: true, force: true});

Note that the selector cy.get(".my-button") must return both of your buttons.

Upvotes: 3

Related Questions