Skip to content
A Node.js tool to automate end-to-end web testing.
JavaScript TypeScript HTML CSS CoffeeScript Dockerfile
Branch: master
Clone or download

Latest commit

miherlosev and AndreyBelym Bump version (v1.8.6-alpha.2) (#5136)
* alpha.2

* Update browser tools

Co-authored-by: Andrey Belym <belym.a.2105@gmail.com>
Latest commit 7cd8f14 May 28, 2020

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github [docs] Add the Pull Request Template (#4759) Feb 17, 2020
.md-lint [docs] Merge Documentation 2.0 (#5051) May 6, 2020
@types Rewrite the browser/connection/remotes-queue.js file to TypeScript (#… Dec 27, 2019
bin Handle SIGINT via async-exit-hook (closes #1378) (#1780) Sep 20, 2017
docker Update links to Alpine repos (closes #5057) May 8, 2020
docs feat: added docs for @testing-library/testcafe (#5121) May 27, 2020
examples Fix incorrect indentation in the BitBucket config Nov 22, 2019
media [docs] Update the README banner (#4198) Aug 27, 2019
src feat: added support for JSX in js test files (closes #4817) (#5078) May 28, 2020
test feat: added support for JSX in js test files (closes #4817) (#5078) May 28, 2020
ts-defs-src Add type definitions for RequestOptions and ResponseMock (#5119) May 28, 2020
.dockerignore add docker-test task (closes #3026) (#3081) Nov 12, 2018
.editorconfig Start implementing build infrastructure Jun 25, 2015
.eslintignore Fix `ReferenceError: selector is not defined` if selector promise is … Aug 12, 2016
.eslintrc Implement IPC messaging for the compiler service (#4254) Sep 16, 2019
.gitattributes Add new file types to git attributes (#4722) Feb 5, 2020
.gitignore [docs] Describe passing the reporter object through the API (#4757) Feb 17, 2020
.publishrc Bump version (v1.8.6-alpha.1) (#5116) May 22, 2020
.travis-docs.yml [docs] Add my TestCafe Cucumber steps plugin (#4700) Jan 28, 2020
.travis.yml Use Rollup and TypeScript for client scripts (#4915) Apr 7, 2020
CHANGELOG.md [docs] Add changelog for v1.8.5 (#5079) May 19, 2020
CODEOWNERS Exclude most scopes from CODEOWNERS (#4794) Feb 21, 2020
CODE_OF_CONDUCT.md Fix the Project Team Email in Code of Conduct (#4777) Feb 17, 2020
CONTRIBUTING.md [docs] Update the contribution guide to reflect changes in the docs w… Dec 5, 2018
Gemfile Reference my redirect-from fork (#5060) May 8, 2020
Gulpfile.js Fix gulpfile after rebase (#5080) May 19, 2020
LICENSE Update the year in the license (#4627) Jan 9, 2020
README.md Update Contributors (#5106) May 21, 2020
appveyor.yml Bump version (v1.7.1-rc.1); Allow creating branches in the core repo (#… Dec 18, 2019
azure-pipelines.yml Rerun failed tests in Azure test tasks (#5074) May 15, 2020
package.json Bump version (v1.8.6-alpha.2) (#5136) May 28, 2020

README.md

Try TestCafe Studio IDE

testcafe

Functional Windows desktop All Travis tasks (server, client, functional: mobile, macOS, Edge) NPM Version

A Node.js tool to automate end-to-end web testing.
Write tests in JS or TypeScript, run them and view results.

Homepage   •   Documentation   •   FAQ   •   Support

  • Works on all popular environments: TestCafe runs on Windows, MacOS, and Linux. It supports desktop, mobile, remote and cloud browsers (UI or headless).
  • 1 minute to set up: You do not need WebDriver or any other testing software. Install TestCafe with one command, and you are ready to test: npm install -g testcafe
  • Free and open source: TestCafe is free to use under the MIT license. Plugins provide custom reports, integration with other tools, launching tests from IDE, etc. You can use the plugins made by the GitHub community or make your own.

Install TestCafe and Run a Test

Running a sample test in Safari

Table of contents

Features

Stable tests and no manual timeouts
TestCafe automatically waits for page loads and XHRs before the test starts and after each action. It also features smart test actions and assertions that wait for page elements to appear. You can change the maximum wait time. If elements load faster, tests skip the timeout and continue.

Rapid test development tool
Changes in test code immediately restart the test, and you see the results instantly.
See how it works in the TestCafe Live repository.

Latest JS and TypeScript support
TestCafe supports the latest JavaScript features, including ES2017 (for example, async/await). You can also use TypeScript if you prefer a strongly typed language.

Detects JS errors in your code
TestCafe reports JS errors that it finds on the webpage. Tests automatically fail because of that. However, you can disable this.

Concurrent test launch
TestCafe can open multiple instances of the same browser to run parallel tests which decreases test execution time.

PageObject pattern support
The TestCafe's Test API includes a high-level selector library, assertions, etc. You can combine them to implement readable tests with the PageObject pattern.

const macOSInput = Selector('.column').find('label').withText('MacOS').child('input');

Easy to include in a continuous integration system
You can run TestCafe from a console, and its reports can be viewed in a CI system's interface (TeamCity, Jenkins, Travis & etc.)

TestCafe Studio: IDE for End-to-End Web Testing

TestCafe works great for JavaScript developers, but at some point you will need to delegate testing tasks to your Q&A department. If that's the case and you are looking for a codeless way to record and maintain tests compatible with your existing infrastructure, check out TestCafe Studio - a testing IDE built on top of the open-source TestCafe.

Read the following article to learn how TestCafe Studio could fit into your workflow: What's Better than TestCafe? TestCafe Studio.

Get Started with TestCafe Studio

Record and Run a Test in TestCafe Studio

Getting Started

Installation

Ensure that Node.js (version 6 or newer) and npm are installed on your computer before running it:

npm install -g testcafe

Creating the Test

As an example, we are going to test the https://devexpress.github.io/testcafe/example page.

Create a .js or .ts file on your computer. Note that it needs to have a specific structure: tests must be organized into fixtures. You can paste the following code to see the test in action:

import { Selector } from 'testcafe'; // first import testcafe selectors

fixture `Getting Started`// declare the fixture
    .page `https://devexpress.github.io/testcafe/example`;  // specify the start page


//then create a test and place your code there
test('My first test', async t => {
    await t
        .typeText('#developer-name', 'John Smith')
        .click('#submit-button')

        // Use the assertion to check if the actual header text is equal to the expected one
        .expect(Selector('#article-header').innerText).eql('Thank you, John Smith!');
});

Running the Test

Call the following command in a command shell. Specify the target browser and file path.

testcafe chrome test1.js

TestCafe opens the browser and starts executing the test.

Important! Make sure to stay in the browser tab that is running tests. Do not minimize the browser window. Tests are not guaranteed to execute correctly in inactive tabs and minimized browser windows because they switch to a lower resource consumption mode.

Viewing the Results

TestCafe outputs the results into a command shell by default. See Reporters for more information. You can also use plugins to customize the reports.

Test Report

Read the Getting Started page for a more detailed guide.

Documentation

Go to our website for full documentation on TestCafe.

Get Help

Join the TestCafe community on Stack Overflow to get help. Ask and answer questions with the TestCafe tag.

Issue Tracker

Use our GitHub issues page to report bugs and suggest improvements.

Stay in Touch

Follow us on Twitter. We post TestCafe news and updates, several times a week.

Contributing

Read our Contributing Guide to learn how to contribute to the project.

To create your own plugin for TestCafe, you can use these plugin generators:

If you want your plugin to be listed below, send us a note in a Github issue.

Thank you to all the people who already contributed to TestCafe!

alexey-lin anthophobiac ericyd NickCis timnederhoff vitalics
alexey-lin anthophobiac ericyd NickCis timnederhoff vitalics
alexwybraniec andrewbranch radarhere ai AndyWendt infctr
alexwybraniec andrewbranch radarhere ai AndyWendt infctr
benmonro caseyWebb lzxb smockle cdrini beyondcompute
benmonro caseyWebb lzxb smockle cdrini beyondcompute
GeoffreyBooth Ivan-Katovich jamesgeorge007 mcjim jaypea kanhaiya15
GeoffreyBooth Ivan-Katovich jamesgeorge007 mcjim jaypea kanhaiya15
dej611 mattmanske MatthewNielsen27 morfey13 rbardini renancouto
dej611 mattmanske MatthewNielsen27 morfey13 rbardini renancouto
macdonaldr93 honsq90 stefanschenk sgrillon14 tobiasbueschel raspo
macdonaldr93 honsq90 stefanschenk sgrillon14 tobiasbueschel raspo
varunkumar theghostbel aha-oretama bill-looby-i bsmithb2 link89
varunkumar theghostbel aha-oretama bill-looby-i bsmithb2 link89
VasilyStrelyaev AndreyBelym AlexanderMoskovkin inikulin AlexKamaev helen-dikareva
VasilyStrelyaev AndreyBelym AlexanderMoskovkin inikulin AlexKamaev helen-dikareva
miherlosev MargaritaLoseva LavrovArtem churkin AlexSkorkin kirovboris
miherlosev MargaritaLoseva LavrovArtem churkin AlexSkorkin kirovboris
Farfurix Dmitry-Ostashev Nuarat aleks-pro arubtsov Marketionist
Farfurix Dmitry-Ostashev Nuarat aleks-pro arubtsov Marketionist
murajun1978 pietrovich superroma cgfarmer4 intermike DevSide
murajun1978 pietrovich superroma cgfarmer4
b12031106 tomashanacek
b12031106 tomashanacek

Plugins

TestCafe developers and community members made these plugins:

Different Versions of TestCafe

  TestCafe TestCafe Studio
No need for WebDriver, browser plugins or other tools
Cross-platform and cross-browser out of the box
Write tests in the latest JavaScript or TypeScript
Clear and flexible API supports ES6 and PageModel pattern
Stable tests due to the Smart Assertion Query Mechanism
Tests run fast due to intelligent Automatic Waiting Mechanism and Concurrent Test Execution
Custom reporter plugins
Use third-party Node.js modules in test scripts
Integration with popular CI systems  ✓*
Free and open-source  
Visual Test Recorder  
Interactive Test Editor  
Automatic Selector Generation  
Run Configuration Manager  
IDE-like GUI  

* You can use open-source TestCafe to run TestCafe Studio tests in CI systems.

Badge

Show everyone you are using TestCafe: Tested with TestCafe

To display this badge, add the following code to your repository readme:

<a href="https://github.com/DevExpress/testcafe">
    <img alt="Tested with TestCafe" src="https://img.shields.io/badge/tested%20with-TestCafe-2fa4cf.svg">
</a>

Thanks to BrowserStack

We are grateful to BrowserStack for providing the infrastructure that we use to test code in this repository.

BrowserStack Logo

License

Code released under the MIT license.

Creators

Developer Express Inc. (https://devexpress.com)

You can’t perform that action at this time.