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](https://testcafe.io/documentation/402828/guides/concepts/browsers#browser-support) (UI or headless). * **1 minute to set up**: You [do not need WebDriver](https://testcafe.io/402636/faq#i-have-heard-that-testcafe-does-not-use-selenium-how-does-it-operate) 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](https://github.com/DevExpress/testcafe/blob/master/LICENSE). [Plugins](#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](https://raw.githubusercontent.com/DevExpress/testcafe/master/media/install-and-run-test.gif)Running a sample test in Safari
## Table of contents * [Features](#features) * [TestCafe Studio: IDE for End-to-End Web Testing](#testcafe-studio-ide-for-end-to-end-web-testing) * [Getting Started](#getting-started) * [Documentation](#documentation) * [Get Help](#get-help) * [Issue Tracker](#issue-tracker) * [Stay in Touch](#stay-in-touch) * [Contributing](#contributing) * [Plugins](#plugins) * [Different Versions of TestCafe](#different-versions-of-testcafe) * [Badge](#badge) * [License](#license) * [Creators](#creators) ## Features **Stable tests and no manual timeouts**Record and Run a Test in TestCafe Studio
## Getting Started ### Installation Ensure that [Node.js](https://nodejs.org/) ([Current or Active LTS](https://github.com/nodejs/Release#release-phases) is recommended, version 12 at minimum) and [npm](https://www.npmjs.com/) are installed on your computer before running it: ```sh npm install -g testcafe ``` ### Creating the Test As an example, we are going to test the [https://devexpress.github.io/testcafe/example](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: ```js 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](https://testcafe.io/documentation/402639/reference/command-line-interface#browser-list) and [file path](https://testcafe.io/documentation/402639/reference/command-line-interface#file-pathglob-pattern). ```sh testcafe chrome test1.js ``` TestCafe opens the browser and starts executing the test. > Important! Make sure the browser tab that runs tests stays active. > Do not minimize the browser window. Inactive tabs and minimized browser windows switch > to a lower resource consumption mode where tests are not guaranteed to execute correctly. ### Viewing the Results TestCafe outputs the results into a command shell by default. See [Reporters](https://testcafe.io/documentation/402825/guides/concepts/reporters) for more information. You can also use [plugins](#plugins) to customize the reports. ![Test Report](https://testcafe.io/images/report.png) Read the [Getting Started](https://testcafe.io/documentation/402635/getting-started) page for a more detailed guide. ## Documentation Go to our website for full [documentation](https://testcafe.io/documentation/402635/getting-started) on TestCafe. ## Get Help Join the TestCafe community on Stack Overflow to get help. Ask and answer [questions with the TestCafe tag](https://stackoverflow.com/questions/tagged/testcafe). ## Issue Tracker Use our GitHub issues page to [report bugs](https://github.com/DevExpress/testcafe/issues/new?template=bug-report.md) and [suggest improvements](https://github.com/DevExpress/testcafe/issues/new?template=feature_request.md). ## Stay in Touch Follow us on [Twitter](https://twitter.com/DXTestCafe). We post TestCafe news and updates, several times a week. ## Contributing Read our [Contributing Guide](https://github.com/DevExpress/testcafe/blob/master/CONTRIBUTING.md) to learn how to contribute to the project. To create your own plugin for TestCafe, you can use these plugin generators: * [Build a browser provider](https://testcafe.io/documentation/402812/guides/extend-testcafe/browser-provider-plugin) to set up tests on your on-premises server farm, to use a cloud testing platform, or to start your local browsers in a special way. Use this [Yeoman generator](https://www.npmjs.com/package/generator-testcafe-browser-provider) to write only a few lines of code. * To [build a custom reporter](https://testcafe.io/documentation/402810/guides/extend-testcafe/reporter-plugin) with your formatting and style, check out this [generator](https://www.npmjs.com/package/generator-testcafe-reporter). If you want your plugin to be listed below, [send us a note in a Github issue](https://github.com/DevExpress/testcafe/issues/new). Thank you to all the people who already contributed to TestCafe! [](https://github.com/aha-oretama) |[](https://github.com/ai) |[](https://github.com/aleks-pro) |[](https://github.com/Aleksey28) |[](https://github.com/AlexanderMoiseev) |[](https://github.com/AlexanderMoskovkin) | :---: |:---: |:---: |:---: |:---: |:---: | [aha-oretama](https://github.com/aha-oretama) |[ai](https://github.com/ai) |[aleks-pro](https://github.com/aleks-pro) |[Aleksey28](https://github.com/Aleksey28) |[AlexanderMoiseev](https://github.com/AlexanderMoiseev) |[AlexanderMoskovkin](https://github.com/AlexanderMoskovkin) | [](https://github.com/alexey-lin) |[](https://github.com/AlexKamaev) |[](https://github.com/alexphilin) |[](https://github.com/AlexSkorkin) |[](https://github.com/alexwybraniec) |[](https://github.com/AnastasiaIvanova8) | :---: |:---: |:---: |:---: |:---: |:---: | [alexey-lin](https://github.com/alexey-lin) |[AlexKamaev](https://github.com/AlexKamaev) |[alexphilin](https://github.com/alexphilin) |[AlexSkorkin](https://github.com/AlexSkorkin) |[alexwybraniec](https://github.com/alexwybraniec) |[AnastasiaIvanova8](https://github.com/AnastasiaIvanova8) | [](https://github.com/andrewbranch) |[](https://github.com/AndreyBelym) |[](https://github.com/AndyWendt) |[](https://github.com/AnnaKondratova) |[](https://github.com/anthophobiac) |[](https://github.com/Artem-Babich) | :---: |:---: |:---: |:---: |:---: |:---: | [andrewbranch](https://github.com/andrewbranch) |[AndreyBelym](https://github.com/AndreyBelym) |[AndyWendt](https://github.com/AndyWendt) |[AnnaKondratova](https://github.com/AnnaKondratova) |[anthophobiac](https://github.com/anthophobiac) |[Artem-Babich](https://github.com/Artem-Babich) | [](https://github.com/Arthy000) |[](https://github.com/augustomezencio-hotmart) |[](https://github.com/bdwain) |[](https://github.com/benmonro) |[](https://github.com/beyondcompute) |[](https://github.com/bill-looby-i) | :---: |:---: |:---: |:---: |:---: |:---: | [Arthy000](https://github.com/Arthy000) |[augustomezencio-hotmart](https://github.com/augustomezencio-hotmart) |[bdwain](https://github.com/bdwain) |[benmonro](https://github.com/benmonro) |[beyondcompute](https://github.com/beyondcompute) |[bill-looby-i](https://github.com/bill-looby-i) | [](https://github.com/bsmithb2) |[](https://github.com/caseyWebb) |[](https://github.com/cdrini) |[](https://github.com/cgfarmer4) |[](https://github.com/Chris-Greaves) |[](https://github.com/churkin) | :---: |:---: |:---: |:---: |:---: |:---: | [bsmithb2](https://github.com/bsmithb2) |[caseyWebb](https://github.com/caseyWebb) |[cdrini](https://github.com/cdrini) |[cgfarmer4](https://github.com/cgfarmer4) |[Chris-Greaves](https://github.com/Chris-Greaves) |[churkin](https://github.com/churkin) | [](https://github.com/dej611) |[](https://github.com/DIRECTcut) |[](https://github.com/Dmitry-Ostashev) |[](https://github.com/eignatyev) |[](https://github.com/ericyd) |[](https://github.com/Farfurix) | :---: |:---: |:---: |:---: |:---: |:---: | [dej611](https://github.com/dej611) |[DIRECTcut](https://github.com/DIRECTcut) |[Dmitry-Ostashev](https://github.com/Dmitry-Ostashev) |[eignatyev](https://github.com/eignatyev) |[ericyd](https://github.com/ericyd) |[Farfurix](https://github.com/Farfurix) | [](https://github.com/flora8984461) |[](https://github.com/GeoffreyBooth) |[](https://github.com/helen-dikareva) |[](https://github.com/honsq90) |[](https://github.com/infctr) |[](https://github.com/inikulin) | :---: |:---: |:---: |:---: |:---: |:---: | [flora8984461](https://github.com/flora8984461) |[GeoffreyBooth](https://github.com/GeoffreyBooth) |[helen-dikareva](https://github.com/helen-dikareva) |[honsq90](https://github.com/honsq90) |[infctr](https://github.com/infctr) |[inikulin](https://github.com/inikulin) | [](https://github.com/Ivan-Katovich) |[](https://github.com/jamesgeorge007) |[](https://github.com/jaypea) |[](https://github.com/josephmalam) |[](https://github.com/kanhaiya15) |[](https://github.com/karolnowinski) | :---: |:---: |:---: |:---: |:---: |:---: | [Ivan-Katovich](https://github.com/Ivan-Katovich) |[jamesgeorge007](https://github.com/jamesgeorge007) |[jaypea](https://github.com/jaypea) |[josephmalam](https://github.com/josephmalam) |[kanhaiya15](https://github.com/kanhaiya15) |[karolnowinski](https://github.com/karolnowinski) | [](https://github.com/kirovboris) |[](https://github.com/kisrefod) |[](https://github.com/LavrovArtem) |[](https://github.com/link89) |[](https://github.com/lzxb) |[](https://github.com/macdonaldr93) | :---: |:---: |:---: |:---: |:---: |:---: | [kirovboris](https://github.com/kirovboris) |[kisrefod](https://github.com/kisrefod) |[LavrovArtem](https://github.com/LavrovArtem) |[link89](https://github.com/link89) |[lzxb](https://github.com/lzxb) |[macdonaldr93](https://github.com/macdonaldr93) | [](https://github.com/MargaritaLoseva) |[](https://github.com/Marketionist) |[](https://github.com/MatthewNielsen27) |[](https://github.com/mattkubej) |[](https://github.com/mattmanske) |[](https://github.com/mcjim) | :---: |:---: |:---: |:---: |:---: |:---: | [MargaritaLoseva](https://github.com/MargaritaLoseva) |[Marketionist](https://github.com/Marketionist) |[MatthewNielsen27](https://github.com/MatthewNielsen27) |[mattkubej](https://github.com/mattkubej) |[mattmanske](https://github.com/mattmanske) |[mcjim](https://github.com/mcjim) | [](https://github.com/miherlosev) |[](https://github.com/morfey13) |[](https://github.com/mostlyfabulous) |[](https://github.com/murajun1978) |[](https://github.com/NickCis) |[](https://github.com/Nuarat) | :---: |:---: |:---: |:---: |:---: |:---: | [miherlosev](https://github.com/miherlosev) |[morfey13](https://github.com/morfey13) |[mostlyfabulous](https://github.com/mostlyfabulous) |[murajun1978](https://github.com/murajun1978) |[NickCis](https://github.com/NickCis) |[Nuarat](https://github.com/Nuarat) | [](https://github.com/Ogurecher) |[](https://github.com/PayBas) |[](https://github.com/pgorny) |[](https://github.com/pietrovich) |[](https://github.com/radarhere) |[](https://github.com/raspo) | :---: |:---: |:---: |:---: |:---: |:---: | [Ogurecher](https://github.com/Ogurecher) |[PayBas](https://github.com/PayBas) |[pgorny](https://github.com/pgorny) |[pietrovich](https://github.com/pietrovich) |[radarhere](https://github.com/radarhere) |[raspo](https://github.com/raspo) | [](https://github.com/rbardini) |[](https://github.com/renancouto) |[](https://github.com/rob4629) |[](https://github.com/rueyaa332266) |[](https://github.com/sgrillon14) |[](https://github.com/smockle) | :---: |:---: |:---: |:---: |:---: |:---: | [rbardini](https://github.com/rbardini) |[renancouto](https://github.com/renancouto) |[rob4629](https://github.com/rob4629) |[rueyaa332266](https://github.com/rueyaa332266) |[sgrillon14](https://github.com/sgrillon14) |[smockle](https://github.com/smockle) | [](https://github.com/stefanschenk) |[](https://github.com/superroma) |[](https://github.com/sylbru) |[](https://github.com/taiki-fw) |[](https://github.com/testcafe-build-bot) |[](https://github.com/theghostbel) | :---: |:---: |:---: |:---: |:---: |:---: | [stefanschenk](https://github.com/stefanschenk) |[superroma](https://github.com/superroma) |[sylbru](https://github.com/sylbru) |[taiki-fw](https://github.com/taiki-fw) |[testcafe-build-bot](https://github.com/testcafe-build-bot) |[theghostbel](https://github.com/theghostbel) | [](https://github.com/titerman) |[](https://github.com/tobiasbueschel) |[](https://github.com/varunkumar) |[](https://github.com/VasilyStrelyaev) |[](https://github.com/vitalics) |[](https://github.com/Vla8islav) | :---: |:---: |:---: |:---: |:---: |:---: | [titerman](https://github.com/titerman) |[tobiasbueschel](https://github.com/tobiasbueschel) |[varunkumar](https://github.com/varunkumar) |[VasilyStrelyaev](https://github.com/VasilyStrelyaev) |[vitalics](https://github.com/vitalics) |[Vla8islav](https://github.com/Vla8islav) | [](https://github.com/wentwrong) |[](https://github.com/b12031106) |[](https://github.com/danielroe) |[](https://github.com/danieltroger) |[](https://github.com/DevSide) |[](https://github.com/intermike) | :---: |:---: |:---: |:---: |:---: |:---: | [wentwrong](https://github.com/wentwrong) |[b12031106](https://github.com/b12031106) |[danielroe](https://github.com/danielroe) |[danieltroger](https://github.com/danieltroger) |[DevSide](https://github.com/DevSide) |[intermike](https://github.com/intermike) | [](https://github.com/kirillsalikhov) |[](https://github.com/michaelficarra) |[](https://github.com/rr13k) |[](https://github.com/tomashanacek) |[](https://github.com/TrevorKarjanis) | :---: |:---: |:---: |:---: |:---: | [kirillsalikhov](https://github.com/kirillsalikhov) |[michaelficarra](https://github.com/michaelficarra) |[rr13k](https://github.com/rr13k) |[tomashanacek](https://github.com/tomashanacek) |[TrevorKarjanis](https://github.com/TrevorKarjanis) | ## Plugins TestCafe developers and community members made these plugins: * **Browser Providers**