From 55d85c924a512af11073856f697b1f49c0368c15 Mon Sep 17 00:00:00 2001 From: Shivam Pandey Date: Wed, 17 Apr 2024 11:43:49 +0530 Subject: [PATCH] MAX_ATTEMPT ADDED --- cypress/support/commands.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cypress/support/commands.js b/cypress/support/commands.js index 2a193a4..7b64b6e 100644 --- a/cypress/support/commands.js +++ b/cypress/support/commands.js @@ -114,11 +114,15 @@ function performLogin(LOGGED_IN) { } - +let MAX_ATTEMPT = 200 // function to solveCaptcha after logging in function solveCaptcha() { + // Max attempt for this function to fail + MAX_ATTEMPT -= 1 + cy.wrap(MAX_ATTEMPT, { timeout: 10000 }).should('be.gt', 0); + cy.task("log", "Calling solveCaptcha() nth time") cy.wait(500)