Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[docs] Add a reCAPTCHA article #5204

Merged
merged 6 commits into from Jun 18, 2020
7 changes: 6 additions & 1 deletion docs/README.md
Expand Up @@ -193,19 +193,24 @@
* [createBrowserConnection](articles/documentation/reference/testcafe-api/testcafe/createbrowserconnection.md)
* [createLiveModeRunner](articles/documentation/reference/testcafe-api/testcafe/createlivemoderunner.md)
* [createRunner](articles/documentation/reference/testcafe-api/testcafe/createrunner.md)
* Plugin API
* [BrowserProvider Interface](articles/documentation/reference/plugin-api/browserprovider.md)
* [Reporter Interface](articles/documentation/reference/plugin-api/reporter.md)
* [Recipes](articles/documentation/recipes/README.md)
* Basics
* [Test \<select\> Elements](articles/documentation/recipes/basics/test-select-elements.md)
* [Test &lt;select&gt; Elements](articles/documentation/recipes/basics/test-select-elements.md)
* [Test Static HTML Pages](articles/documentation/recipes/basics/test-static-html-pages.md)
* [Test on Remote Computers and Mobile Devices](articles/documentation/recipes/basics/test-on-remote-computers-and-mobile-devices.md)
* Best Practices
* [Create Helpers](articles/documentation/recipes/best-practices/create-helpers.md)
* [Create Data-Driven Tests](articles/documentation/recipes/best-practices/create-data-driven-tests.md)
* Integrations
* [Import Third-Party Modules](articles/documentation/recipes/integrations/import-third-party-modules.md)
* [Testing Library API](articles/documentation/recipes/integrations/use-testing-library-api.md)
* [Angular CLI Builder](articles/documentation/recipes/integrations/use-angular-cli-builder.md)
* [Gulp](articles/documentation/recipes/integrations/gulp.md)
* [Grunt](articles/documentation/recipes/integrations/grunt.md)
* [Test Websites That Use reCAPTCHA](articles/documentation/recipes/integrations/test-websites-that-use-recaptcha.md)
* [Flow Type Checker](articles/documentation/recipes/integrations/find-code-issues-with-flow-type-checker.md)
* Configuration
* [Access Environment Variables in Tests](articles/documentation/recipes/configuration/access-environment-variables-in-tests.md)
Expand Down
1 change: 1 addition & 0 deletions docs/articles/documentation/recipes/README.md
Expand Up @@ -27,6 +27,7 @@ This section provides examples and recipes of how to use TestCafe in different s
* [Angular CLI Builder](integrations/use-angular-cli-builder.md)
* [Gulp](integrations/gulp.md)
* [Grunt](integrations/grunt.md)
* [Test Websites That Use reCAPTCHA](integrations/test-websites-that-use-recaptcha.md)
* [Flow Type Checker](integrations/find-code-issues-with-flow-type-checker.md)

**Configuration**
Expand Down
@@ -0,0 +1,27 @@
---
layout: docs
title: Test Websites That Use reCAPTCHA
permalink: /documentation/recipes/integrations/test-websites-that-use-recaptcha.html
---
# Test Websites That Use reCAPTCHA

TestCafe does not implement mechanisms that circumvent CAPTCHA challenges. However, many CAPTCHA providers allow you to disable or mock the verification in test environments.
VasilyStrelyaev marked this conversation as resolved.
Show resolved Hide resolved

This topic describes how to configure reCAPTCHA so that TestCafe tests pass through it.
VasilyStrelyaev marked this conversation as resolved.
Show resolved Hide resolved

## reCAPTCHA v3

Create a separate key for testing environments in the [reCAPTCHA admin console](https://www.google.com/recaptcha/admin/create). Then follow the instructions on the page to use this key when you build the site for testing.

> Scores may not be accurate in testing environments as reCAPTCHA v3 relies on seeing real traffic.
VasilyStrelyaev marked this conversation as resolved.
Show resolved Hide resolved

Alternatively, you can change the `score` threshold or disable the reCAPTCHA check completely in your development build.
VasilyStrelyaev marked this conversation as resolved.
Show resolved Hide resolved

## reCAPTCHA v2

Use the following test keys that generate the `No CAPTCHA` response and make all verification requests pass:
VasilyStrelyaev marked this conversation as resolved.
Show resolved Hide resolved

**Site key**: `6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI`
**Secret key**: `6LeIxAcTAAAAAGG-vFI1TnRWxMZNFuojJ4WifJWe`

With these keys, the reCAPTCHA widget shows a warning message that indicates reCAPTCHA is not used for production traffic.
2 changes: 2 additions & 0 deletions docs/nav/nav-menu.yml
Expand Up @@ -426,6 +426,8 @@
url: /documentation/recipes/integrations/gulp.md
- name: Grunt
url: /documentation/recipes/integrations/grunt.md
- name: Test Websites That Use reCAPTCHA
url: /documentation/recipes/integrations/test-websites-that-use-recaptcha.md
- name: Flow Type Checker
url: /documentation/recipes/integrations/find-code-issues-with-flow-type-checker.md
- name: Configuration
Expand Down