Home

Awesome

<p align="center"> <a href="https://www.devexpress.com/products/testcafestudio/?utm_source=github.com&utm_medium=referral&utm_campaign=tc-gh-banner"> <img src="https://raw.github.com/DevExpress/testcafe/master/media/testcafe-studio-banner.png" alt="Try TestCafe Studio IDE" /> </a> </p> <p align="center"> <a href="https://testcafe.io"> <img src="https://raw.githubusercontent.com/DevExpress/testcafe/master/media/testcafe-logo.svg?sanitize=true" alt="testcafe" /> </a> </p> <p align="center"> <a href="https://github.com/DevExpress/testcafe/commits/master"><img alt="Tests" src="https://img.shields.io/github/checks-status/DevExpress/testcafe/master?label=Tests"></a> <a href="https://github.com/DevExpress/testcafe/actions/workflows/test-dependencies.yml"><img alt="Test Dependencies" src="https://github.com/DevExpress/testcafe/actions/workflows/test-dependencies.yml/badge.svg" /></a> <a href="https://www.npmjs.com/package/testcafe"><img alt="NPM Version" src="https://img.shields.io/npm/v/testcafe.svg" data-canonical-src="https://img.shields.io/npm/v/testcafe.svg" style="max-width:100%;"></a> </p> <p align="center"> <i> Automate end-to-end web testing with TestCafe, a Node.js-based testing framework.</i><br><br> TestCafe is <strong>free</strong> and as easy to use as <strong>1-2-3</strong>:<br> <strong>1.</strong> Write your tests in JS or TypeScript.<br><strong>2.</strong> Execute your tests.<br><strong>3.</strong> View test results. </p> <p align="center"> <a href="https://testcafe.io">Homepage</a> &nbsp;&nbsp;•&nbsp;&nbsp; <a href="https://testcafe.io/documentation/402635/getting-started">Documentation</a> &nbsp;&nbsp;•&nbsp;&nbsp; <a href="https://testcafe.io/402636/faq">FAQ</a> &nbsp;&nbsp;•&nbsp;&nbsp; <a href="https://testcafe.io/support">Support</a> </p>

Install TestCafe and Run a Test

<p align="center"> <i>Running a sample test in Safari</i> </p>

Table of contents

Features

Stable tests and no manual timeouts<br/> 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<br/> When you enable live mode, changes to test code immediately restart the test, and you instantly see the results.

Latest JS and TypeScript support<br/> 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<br/> TestCafe reports JS errors that it locates on a given webpage. Tests automatically fail if TestCafe encounters such errors.<br /> You can, however, disable this option.<br />

Concurrent test launch<br/> TestCafe can open multiple instances of the same browser and run parallel tests (to help decrease test execution time).

PageObject pattern support<br/> 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<br/> 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

<p align="center"> <i>Record and Run a Test in TestCafe Studio</i> </p>

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.

Stay in Touch

Follow us on Twitter. We post TestCafe news and updates.

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.

Thanks to all of our contributors – We appreciate your commitment to the TestCafe community.

<img alt="aha-oretama" src="https://avatars.githubusercontent.com/u/7259161?v=4&s=117" width="117"><img alt="ai" src="https://avatars.githubusercontent.com/u/19343?v=4&s=117" width="117"><img alt="aleks-pro" src="https://avatars.githubusercontent.com/u/14822473?v=4&s=117" width="117"><img alt="Aleksey28" src="https://avatars.githubusercontent.com/u/32869530?v=4&s=117" width="117"><img alt="AlexanderMoiseev" src="https://avatars.githubusercontent.com/u/1498953?v=4&s=117" width="117"><img alt="AlexanderMoskovkin" src="https://avatars.githubusercontent.com/u/12047804?v=4&s=117" width="117">
aha-oretamaaialeks-proAleksey28AlexanderMoiseevAlexanderMoskovkin
<img alt="alexey-lin" src="https://avatars.githubusercontent.com/u/13483856?v=4&s=117" width="117"><img alt="AlexKamaev" src="https://avatars.githubusercontent.com/u/1678902?v=4&s=117" width="117"><img alt="alexphilin" src="https://avatars.githubusercontent.com/u/20364443?v=4&s=117" width="117"><img alt="AlexSkorkin" src="https://avatars.githubusercontent.com/u/995726?v=4&s=117" width="117"><img alt="alexwybraniec" src="https://avatars.githubusercontent.com/u/521536?v=4&s=117" width="117"><img alt="AnastasiaIvanova8" src="https://avatars.githubusercontent.com/u/31988208?v=4&s=117" width="117">
alexey-linAlexKamaevalexphilinAlexSkorkinalexwybraniecAnastasiaIvanova8
<img alt="andrewbranch" src="https://avatars.githubusercontent.com/u/3277153?v=4&s=117" width="117"><img alt="AndreyBelym" src="https://avatars.githubusercontent.com/u/4479386?v=4&s=117" width="117"><img alt="AndyWendt" src="https://avatars.githubusercontent.com/u/6130713?v=4&s=117" width="117"><img alt="AnnaKondratova" src="https://avatars.githubusercontent.com/u/27012218?v=4&s=117" width="117"><img alt="anthophobiac" src="https://avatars.githubusercontent.com/u/16448031?v=4&s=117" width="117"><img alt="Artem-Babich" src="https://avatars.githubusercontent.com/u/51639399?v=4&s=117" width="117">
andrewbranchAndreyBelymAndyWendtAnnaKondratovaanthophobiacArtem-Babich
<img alt="Arthy000" src="https://avatars.githubusercontent.com/u/1800622?v=4&s=117" width="117"><img alt="augustomezencio-hotmart" src="https://avatars.githubusercontent.com/u/25016353?v=4&s=117" width="117"><img alt="bdwain" src="https://avatars.githubusercontent.com/u/3982094?v=4&s=117" width="117"><img alt="benmonro" src="https://avatars.githubusercontent.com/u/399236?v=4&s=117" width="117"><img alt="beyondcompute" src="https://avatars.githubusercontent.com/u/248055?v=4&s=117" width="117"><img alt="bill-looby-i" src="https://avatars.githubusercontent.com/u/51128939?v=4&s=117" width="117">
Arthy000augustomezencio-hotmartbdwainbenmonrobeyondcomputebill-looby-i
<img alt="bsmithb2" src="https://avatars.githubusercontent.com/u/1773789?v=4&s=117" width="117"><img alt="caseyWebb" src="https://avatars.githubusercontent.com/u/5419074?v=4&s=117" width="117"><img alt="cdrini" src="https://avatars.githubusercontent.com/u/6251786?v=4&s=117" width="117"><img alt="cgfarmer4" src="https://avatars.githubusercontent.com/u/336449?v=4&s=117" width="117"><img alt="Chris-Greaves" src="https://avatars.githubusercontent.com/u/28542943?v=4&s=117" width="117"><img alt="churkin" src="https://avatars.githubusercontent.com/u/5182202?v=4&s=117" width="117">
bsmithb2caseyWebbcdrinicgfarmer4Chris-Greaveschurkin
<img alt="dej611" src="https://avatars.githubusercontent.com/u/924948?v=4&s=117" width="117"><img alt="DIRECTcut" src="https://avatars.githubusercontent.com/u/49588154?v=4&s=117" width="117"><img alt="Dmitry-Ostashev" src="https://avatars.githubusercontent.com/u/24777868?v=4&s=117" width="117"><img alt="eignatyev" src="https://avatars.githubusercontent.com/u/12494773?v=4&s=117" width="117"><img alt="ericyd" src="https://avatars.githubusercontent.com/u/8379268?v=4&s=117" width="117"><img alt="Farfurix" src="https://avatars.githubusercontent.com/u/30019338?v=4&s=117" width="117">
dej611DIRECTcutDmitry-OstasheveignatyevericydFarfurix
<img alt="flora8984461" src="https://avatars.githubusercontent.com/u/39588094?v=4&s=117" width="117"><img alt="GeoffreyBooth" src="https://avatars.githubusercontent.com/u/456802?v=4&s=117" width="117"><img alt="helen-dikareva" src="https://avatars.githubusercontent.com/u/12034551?v=4&s=117" width="117"><img alt="honsq90" src="https://avatars.githubusercontent.com/u/1791439?v=4&s=117" width="117"><img alt="infctr" src="https://avatars.githubusercontent.com/u/15550153?v=4&s=117" width="117"><img alt="inikulin" src="https://avatars.githubusercontent.com/u/453071?v=4&s=117" width="117">
flora8984461GeoffreyBoothhelen-dikarevahonsq90infctrinikulin
<img alt="Ivan-Katovich" src="https://avatars.githubusercontent.com/u/7858279?v=4&s=117" width="117"><img alt="jamesgeorge007" src="https://avatars.githubusercontent.com/u/25279263?v=4&s=117" width="117"><img alt="jaypea" src="https://avatars.githubusercontent.com/u/367199?v=4&s=117" width="117"><img alt="josephmalam" src="https://avatars.githubusercontent.com/u/47305920?v=4&s=117" width="117"><img alt="kanhaiya15" src="https://avatars.githubusercontent.com/u/38152453?v=4&s=117" width="117"><img alt="karolnowinski" src="https://avatars.githubusercontent.com/u/28826226?v=4&s=117" width="117">
Ivan-Katovichjamesgeorge007jaypeajosephmalamkanhaiya15karolnowinski
<img alt="kirovboris" src="https://avatars.githubusercontent.com/u/3633477?v=4&s=117" width="117"><img alt="kisrefod" src="https://avatars.githubusercontent.com/u/27427579?v=4&s=117" width="117"><img alt="LavrovArtem" src="https://avatars.githubusercontent.com/u/5373460?v=4&s=117" width="117"><img alt="link89" src="https://avatars.githubusercontent.com/u/3314130?v=4&s=117" width="117"><img alt="lzxb" src="https://avatars.githubusercontent.com/u/8424643?v=4&s=117" width="117"><img alt="macdonaldr93" src="https://avatars.githubusercontent.com/u/5184848?v=4&s=117" width="117">
kirovboriskisrefodLavrovArtemlink89lzxbmacdonaldr93
<img alt="MargaritaLoseva" src="https://avatars.githubusercontent.com/u/12034505?v=4&s=117" width="117"><img alt="Marketionist" src="https://avatars.githubusercontent.com/u/534603?v=4&s=117" width="117"><img alt="MatthewNielsen27" src="https://avatars.githubusercontent.com/u/35040439?v=4&s=117" width="117"><img alt="mattkubej" src="https://avatars.githubusercontent.com/u/86790511?v=4&s=117" width="117"><img alt="mattmanske" src="https://avatars.githubusercontent.com/u/2078566?v=4&s=117" width="117"><img alt="mcjim" src="https://avatars.githubusercontent.com/u/485440?v=4&s=117" width="117">
MargaritaLosevaMarketionistMatthewNielsen27mattkubejmattmanskemcjim
<img alt="miherlosev" src="https://avatars.githubusercontent.com/u/4133518?v=4&s=117" width="117"><img alt="morfey13" src="https://avatars.githubusercontent.com/u/2048346?v=4&s=117" width="117"><img alt="mostlyfabulous" src="https://avatars.githubusercontent.com/u/15062048?v=4&s=117" width="117"><img alt="murajun1978" src="https://avatars.githubusercontent.com/u/911903?v=4&s=117" width="117"><img alt="NickCis" src="https://avatars.githubusercontent.com/u/174561?v=4&s=117" width="117"><img alt="Nuarat" src="https://avatars.githubusercontent.com/u/11683678?v=4&s=117" width="117">
miherlosevmorfey13mostlyfabulousmurajun1978NickCisNuarat
<img alt="Ogurecher" src="https://avatars.githubusercontent.com/u/28919867?v=4&s=117" width="117"><img alt="PayBas" src="https://avatars.githubusercontent.com/u/3015760?v=4&s=117" width="117"><img alt="pgorny" src="https://avatars.githubusercontent.com/u/70758186?v=4&s=117" width="117"><img alt="pietrovich" src="https://avatars.githubusercontent.com/u/1728613?v=4&s=117" width="117"><img alt="radarhere" src="https://avatars.githubusercontent.com/u/3112309?v=4&s=117" width="117"><img alt="raspo" src="https://avatars.githubusercontent.com/u/927264?v=4&s=117" width="117">
OgurecherPayBaspgornypietrovichradarhereraspo
<img alt="rbardini" src="https://avatars.githubusercontent.com/u/874370?v=4&s=117" width="117"><img alt="renancouto" src="https://avatars.githubusercontent.com/u/230893?v=4&s=117" width="117"><img alt="rob4629" src="https://avatars.githubusercontent.com/u/37812673?v=4&s=117" width="117"><img alt="rueyaa332266" src="https://avatars.githubusercontent.com/u/8298718?v=4&s=117" width="117"><img alt="sgrillon14" src="https://avatars.githubusercontent.com/u/5530550?v=4&s=117" width="117"><img alt="smockle" src="https://avatars.githubusercontent.com/u/3104489?v=4&s=117" width="117">
rbardinirenancoutorob4629rueyaa332266sgrillon14smockle
<img alt="stefanschenk" src="https://avatars.githubusercontent.com/u/12391671?v=4&s=117" width="117"><img alt="superroma" src="https://avatars.githubusercontent.com/u/8553464?v=4&s=117" width="117"><img alt="sylbru" src="https://avatars.githubusercontent.com/u/3757523?v=4&s=117" width="117"><img alt="taiki-fw" src="https://avatars.githubusercontent.com/u/43266182?v=4&s=117" width="117"><img alt="testcafe-build-bot" src="https://avatars.githubusercontent.com/u/13555664?v=4&s=117" width="117"><img alt="theghostbel" src="https://avatars.githubusercontent.com/u/482899?v=4&s=117" width="117">
stefanschenksuperromasylbrutaiki-fwtestcafe-build-bottheghostbel
<img alt="titerman" src="https://avatars.githubusercontent.com/u/43554315?v=4&s=117" width="117"><img alt="tobiasbueschel" src="https://avatars.githubusercontent.com/u/13087421?v=4&s=117" width="117"><img alt="varunkumar" src="https://avatars.githubusercontent.com/u/509433?v=4&s=117" width="117"><img alt="VasilyStrelyaev" src="https://avatars.githubusercontent.com/u/11459924?v=4&s=117" width="117"><img alt="vitalics" src="https://avatars.githubusercontent.com/u/8816260?v=4&s=117" width="117"><img alt="Vla8islav" src="https://avatars.githubusercontent.com/u/1637557?v=4&s=117" width="117">
titermantobiasbueschelvarunkumarVasilyStrelyaevvitalicsVla8islav
<img alt="wentwrong" src="https://avatars.githubusercontent.com/u/26363017?v=4&s=117" width="117"><img alt="b12031106" src="https://avatars.githubusercontent.com/u/2063566?v=4&s=117" width="117"><img alt="danielroe" src="https://avatars.githubusercontent.com/u/28706372?v=4&s=117" width="117"><img alt="danieltroger" src="https://avatars.githubusercontent.com/u/4047180?v=4&s=117" width="117"><img alt="DevSide" src="https://avatars.githubusercontent.com/u/6873926?v=4&s=117" width="117"><img alt="intermike" src="https://avatars.githubusercontent.com/u/10540148?v=4&s=117" width="117">
wentwrongb12031106danielroedanieltrogerDevSideintermike
<img alt="kirillsalikhov" src="https://avatars.githubusercontent.com/u/1948153?v=4&s=117" width="117"><img alt="michaelficarra" src="https://avatars.githubusercontent.com/u/218840?v=4&s=117" width="117"><img alt="rr13k" src="https://avatars.githubusercontent.com/u/45162461?v=4&s=117" width="117"><img alt="tomashanacek" src="https://avatars.githubusercontent.com/u/1244486?v=4&s=117" width="117"><img alt="TrevorKarjanis" src="https://avatars.githubusercontent.com/u/2351292?v=4&s=117" width="117">
kirillsalikhovmichaelficarrarr13ktomashanacekTrevorKarjanis

Plugins

TestCafe developers and community members made these plugins:

Different Versions of TestCafe

 TestCafeTestCafe 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.

<a href="https://www.browserstack.com/"><img alt="BrowserStack Logo" src="https://raw.github.com/DevExpress/testcafe/master/media/BrowserStack.png"/></a>

License

Code released under the MIT license.

Creators

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