Features
< Back to Blog Overview

TestCafe Automation

2020-08-10
Run TestCafe tests on TestingBot's Browser Grid
  • Share on Facebook
  • Share on Twitter
  • Share on LinkedIn
  • Share on HackerNews

Today we're releasing testcafe-browser-provider-testingbot, a plugin for TestCafe.


TestCafe is a NodeJS framework to do automate end-to-end web testing. It allows you to write tests in Javascript or TypeScript and is easy to install and use.


It is a popular test framework, mainly because it's open-source and has good documentation and examples.


TestCafe is not built on Selenium. TestCafe uses a URL-rewriting proxy, this allows it to work without using Selenium WebDriver. The proxy adds a driver script to the browser, which emulates user actions into the page. To find out how it works, please see their How It Works page.

What does the plugin do?

The plugin allows you to use TestCafe and TestingBot together, with very little configuration.


All you need to do is install the plugin, add the browsers you want to use in a capabilities.json file and use TestCafe.


You will see a video, screenshots and logs of each test in the TestingBot member dashboard.

Installing the plugin

To start using the TestCafe plugin, simply install it:

npm install -g testcafe testcafe-browser-provider-testingbot

Once that is done, add both the TB_KEY and TB_SECRET environment variables to authenticate to the TestingBot browser grid.

A TestCafe example

Let's use a simple TestCafe example which we can run on a TestingBot browser.

import { Selector } from 'testcafe';

fixture `Getting Started`
    .page `http://devexpress.github.io/testcafe/example`;

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!');
});

This will open a page, type text in an input field, click a button and verify that the page is showing a specific piece of text.

To run this test on TestingBot, simply use this command:

testcafe "testingbot:chrome@83:WIN10" 'example.js'

The plugin will start a TestingBot Tunnel, start a new Windows 10 VM and run the test on the VM. Once the test has finished running, you will see the test result in your terminal and see a new test appear in your TestingBot dashboard.

Parallel Testing

One of the advantages of using a Cloud based Selenium grid is that you can run tests with high concurrency.

For example, let's run the same test on 3 different browsers at the same time:

testcafe "testingbot:chrome@83:WIN10","testingbot:safari@13:MOJAVE","testingbot:firefox@79:LINUX" 'example.js'

Your tests will appear in the dashboard, together with a video and logs.


Want to find out more? See our TestCafe documentation for more information.

TestingBot Logo

Sign up for a Free Trial

Start testing your apps with TestingBot.

No credit card required.

Other Articles

Selenium 4 (Alpha) Testing on TestingBot

TestingBot now supports Selenium 4 (Alpha) testing on its Selenium grid! Even though Selenium 4 is still only available as an alpha version, we've...

Read more
Test on macOS Big Sur and Safari 14

macOS Big Sur Preview 1 We have added Apple's upcoming OS to our list of platforms. Apple announced this next new major macOS release in its lates...

Read more
Take control of a physical iOS device via VNC

Today we're excited to open-source a feature that we've been using in production for the last 3 years: an iOS VNC Server. This will allow you to c...

Read more
TestingBot has improved its Analytics Offering

TestingBot has long been providing Analytics to its users, where metrics are both visualised and available in table format. Recently we've been wo...

Read more
Codeless Web Automation on iOS and Android

What is Codeless Automation? Codeless Automation allows for creating and running automated tests, without writing the tests.

Read more
Microsoft Edge Chromium - Automated Selenium Testing

The new Microsoft Edge is a browser based on Chromium and was released on January 15, 2020. It is available on both Windows and macOS.

Read more