testcafe is a free, open source browsers & extensions project written in JavaScript and released under MIT. It has 9,903 GitHub stars, 676 forks and 42 open issues, and was last pushed 7 days ago. On this registry it ranks #40 of 101 tracked projects in Browsers & Extensions, with 5 head-to-head comparisons available.

What is testcafe?

TestCafe is a free, MIT-licensed Node.js framework that automates end-to-end web testing, built for JavaScript and TypeScript developers and QA teams who want to drive real browsers without installing or maintaining WebDriver.

What it is

TestCafe is an open-source test automation framework written in JavaScript and distributed as an npm package. It runs on Windows, macOS, and Linux, and it drives desktop, mobile, remote, and cloud browsers in either UI or headless mode. Tests themselves are written in JavaScript or TypeScript, and the framework supports modern language features including ES2017 syntax such as async/await. The project lives in the npm and Node.js ecosystem and is documented at testcafe.io, with an MIT licence, roughly 9,900 stars, and 676 forks on GitHub.

The concrete problem it solves is browser-driver management. TestCafe does not use WebDriver or Selenium, and it does not require any separate testing software to be installed or kept in sync with browser versions. One install command produces a working runner. This removes the driver-binary and grid configuration work that usually sits between writing a test and executing it, which is why the README describes setup as taking about a minute and reducing the workflow to three steps: write tests in JS or TypeScript, execute them, and view results.

Key capabilities

  • Install and run with one command, npm install -g testcafe, with no WebDriver dependency.
  • Automatic waiting for page loads and XHRs before tests start and after each action, plus smart actions and assertions that wait for page elements to appear, replacing manual timeouts.
  • Live mode, which restarts the test immediately when test code changes and shows results at once.
  • Concurrent test launch, which opens multiple instances of the same browser and runs tests in parallel to reduce execution time.
  • A high-level selector library and assertions in the Test API that support the PageObject pattern, for example Selector('.column').find('label').withText('MacOS').child('input').
  • Detection of JavaScript errors on the tested page, with automatic test failure that can be disabled.
  • Plugin support for custom reports and integration with other tools, including launching tests from an IDE.
  • Console execution with reports viewable in CI systems such as TeamCity, Jenkins, and Travis.

Who uses it and how

  • JavaScript developers and experienced QA teams, which the README names as the target audience for the open-source edition.
  • Teams running cross-environment suites across Windows, macOS, and Linux against desktop, mobile, remote, and cloud browsers.
  • Continuous integration pipelines that invoke TestCafe from the console and consume reports inside TeamCity, Jenkins, or Travis.
  • Suites that need parallel execution across multiple browser instances to cut total run time.
  • Projects adopting the PageObject pattern to keep selector-heavy test code readable and maintainable.

Getting started

Install globally with the npm package (npm install -g testcafe), then write a test in JavaScript or TypeScript and execute it from the console. Full setup, guides, and reference material are at the testcafe.io homepage and documentation.

How it compares

TestCafe sits alongside Selenium and WebDriver-based tools in the browser automation space, but it differs in requiring no WebDriver or other external testing software, so browser-driver version matching is not part of the workflow. It is also distinct from TestCafe Studio, a separate Developer Express IDE product aimed at code-free test recording and maintenance for QA engineers; the open-source edition is the code-first option for teams that write tests in JavaScript or TypeScript. Both are relevant references here rather than substitutes on equal footing, since the free edition is MIT-licensed and the Studio IDE follows a commercial model.

When to use it — and when not to

Choose TestCafe when the team already works in JavaScript or TypeScript, wants to avoid driver management, and needs results inside an existing CI system. It is a poor fit for teams looking for code-free test authoring, since that path belongs to the separate Studio IDE product, and for anyone unwilling to write and maintain test code. The project carries a moderate backlog of 42 open issues, and its README is largely a pointer to external documentation, so expect to rely on testcafe.io rather than the repository alone.

project readme (upstream, from github) — read inline

Try TestCafe Studio IDE

testcafe

Tests Test Dependencies NPM Version

Automate end-to-end web testing with TestCafe, a Node.js-based testing framework.

TestCafe is free and as easy to use as 1-2-3:
1. Write your tests in JS or TypeScript.
2. Execute your tests.
3. View test 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 create 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
When you enable live mode, changes to test code immediately restart the test, and you instantly see the results.

Latest JS and TypeScript support
TestCafe supports the most recent JavaScript-related features, including ES2017 (async/await). You can also use TypeScript if you prefer a strongly typed language instead.

Detects JS errors in your code
TestCafe reports JS errors that it locates on a given webpage. Tests automatically fail if TestCafe encounters such errors.
You can, however, disable this option.

Concurrent test launch
TestCafe can open multiple instances of the same browser and run parallel tests (to help decrease 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 within CI systems (TeamCity, Jenkins, Travis & etc.)

Love TestCafe Open-source Edition? Want to Record Tests without Writing JavaScript or TypeScript Code?

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

TestCafe is the perfect choice for JavaScript developers and experienced Q&A teams. If you’d like to delegate testing to QA engineers and are looking for a code-free way to record and maintain tests compatible with your existing infrastructure, check out TestCafe Studio - a testing IDE built atop the open-source version of TestCafe.

Review the following article to learn how TestCafe Studio can fit into any 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 you run Node.js version 16 or higher, and run the following command:

npm install -g testcafe

Creating the Test

For this simple example, we will test the following page: https://devexpress.github.io/testcafe/example

Create a .js or .ts file on your computer. Remember that a .js or .ts file must maintain 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 within it
test('My first test', async t => {
    await t
        .typeText('#developer-name', 'John Smith')
        .click('#submit-button')

        // Use the assertion to check if actual header text equals expected text
        .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 begins test execution.

Important: Make certain the browser tab that runs tests stays active. Do not minimize the browser window. Inactive tabs and minimized browser windows switch to lower resource consumption mode. In low consumption mode, tests may not execute correctly.

Viewing the Results

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

Test Report

Read the Getting Started page for additional assistance.

Documentation

Visit the following webpage to review our online help system: Documentation.

Get Help

Join the TestCafe community on Stack Overflow. Ask and answer questions using the TestCafe tag.

Issue Tracker

Use our GitHub issues page to report bugs and [suggest enhancements](https://github.com/DevExpress/testcafe/issu

readme truncated — read the full docs on github

Frequently asked questions

Is testcafe free to use?

testcafe is open source under the MIT licence. There is no licence fee and no seat count — you can self-host it or, where the project offers one, pay a vendor for a managed version instead.

What does testcafe do?

A Node.js tool to automate end-to-end web testing.

What is testcafe written in?

testcafe is primarily written in JavaScript. Its source is publicly available at https://github.com/DevExpress/testcafe, and it has 9,903 GitHub stars.