Created
January 15, 2021 01:35
-
-
Save dotherightthing/338b2eba568a8ae2b5422227eea5d88f to your computer and use it in GitHub Desktop.
Cypress - force No CAPTCHA reCAPTCHA to fail
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @file cypress/integration/recaptcha.spec.js | |
* @summary Cypress spec for End-to-End UI testing. | |
*/ | |
/* eslint-disable prefer-arrow-callback */ | |
/* eslint-disable max-len */ | |
// Test principles: | |
// ARRANGE: SET UP APP STATE > ACT: INTERACT WITH IT > ASSERT: MAKE ASSERTIONS | |
// Passing arrow functions (“lambdas”) to Mocha is discouraged | |
// https://mochajs.org/#arrow-functions | |
/* eslint-disable func-names */ | |
const idOfElementBeforeCaptcha = ''; // TODO | |
const urlOfPageContainingACaptcha = ''; // TODO | |
describe('Recaptcha', function () { | |
before(function () { | |
cy.visit(urlOfPageContainingACaptcha); | |
}); | |
describe('Tests', function () { | |
it('1', function () { | |
cy.get('#' + idOfElementBeforeCaptcha) | |
.scrollIntoView() | |
.tab() | |
.type(' '); | |
cy.get('.recaptcha-checkbox-checked') | |
.should('exist'); | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment