diff --git a/cypress/support/commands.ts b/cypress/support/commands.ts index eefe3a6e70..45ed4da17e 100644 --- a/cypress/support/commands.ts +++ b/cypress/support/commands.ts @@ -55,6 +55,16 @@ Cypress.Commands.add('iframeLoaded', { prevSubject: 'element' }, ($iframe) => { }); }); +Cypress.Commands.add('solveGoogleReCAPTCHA', () => { + cy.get('#recaptcha *> iframe').then(($iframe) => { + const $body = $iframe.contents().find('body'); + cy.wrap($body) + .find('.recaptcha-checkbox-border') + .should('be.visible') + .click(); + }); +}); + Cypress.Commands.add('resolve', (name, options = {}) => { const getValue = () => { // @ts-ignore diff --git a/cypress/support/e2e.ts b/cypress/support/e2e.ts index 917f50c763..a588f02785 100644 --- a/cypress/support/e2e.ts +++ b/cypress/support/e2e.ts @@ -33,6 +33,7 @@ declare global { resolve(name: string): Chainable; getIframeBody(selector: string): Chainable; findByText(text: string): Chainable; + solveGoogleReCAPTCHA(): Chainable; } } }