TestCafe
TestCafe is a NodeJS framework to do automate end-to-end web testing. You can write tests in either Javascript or TypeScript and is very easy to install and use.
To get started, make sure you have:
- NodeJS installed
- Java (8 or higher) installed
Install TestCafe
To install TestCafe and the TestingBot plugin, please use this command:
Once this is installed, you can start using TestCafe to run tests on TestingBot.
Configure the TestCafe + TestingBot plugin
Please add these 2 environment variables to authenticate to our browser grid:
These two environment variables are required, however the plugin can be further configured with these environment variables as well:
-
TB_TEST_NAME
: the text that will be displayed as Test Name in the dashboard. -
TB_BUILD
: you can add the tests as part of a build. -
SELENIUM_CAPABILITIES
: path to a file which contains a JSON formatted object with the capabilities you want to use. By default it will look forcapabilities.json
. -
TB_SCREEN_RESOLUTION
: set the VMs to a specific screen resolution.
Test Example
Please see this sample test, which you can use to run a test on our browser grid:
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!');
});
Now you can run this test on TestingBot:
TestCafe will start a TestingBot Tunnel, then start a new Windows 10 VM on TestingBot with Chrome 83 and run the test.
You will see a video recording of the test in the member dashboard, together with screenshots and logs.
Specify Browsers & Devices
With our TestCafe plugin, you can use a file called capabilities.json where you can specify a JSON object with capabilities for each browser you want to use.
Run tests in Parallel
Parallel Testing means running the same test, or multiple tests, simultaneously. This greatly reduces your total testing time.
You can run the same tests on all different browser configurations or run different tests all on the same browser configuration.
TestingBot has a large grid of machines and browsers, which means you can use our service to do efficient parallel testing. It is one of the key features we provide to greatly cut down on your total testing time.
To run multiple tests simultaneously, you can specify multiple browsers, like this:
Queuing
Every plan we provide comes with a limit of parallel tests.
If you exceed the number of parallel tests assigned to your account, TestingBot will queue the additional tests (for up to 6 minutes) and run the tests as soon as slots become available.
Other NodeJS Framework examples
-
WebDriverIO
With WebDriverIO you can run Mocha, Jasmine and Cucumber tests.
-
Protractor
Protractor is an end-to-end test framework for AngularJS applications. Protractor is a NodeJS program built on top of WebDriverJS.
-
Soda
Selenium Node Adapter. A light-weight Selenium RC client for NodeJS.
-
Nightwatch
Nightwatch is an automated testing framework written in NodeJS.
-
Intern
Intern is a nodeJS framework for testing Web sites and applications.
-
WD.js
WD.js is a NodeJS client for WebDriver/Selenium.
-
Hermione
Hermione is a Test Framework similar to WebDriverIO, with automatic test retries and plugins.