There are various ways to run your test suite:
The initializer script will install a basic runner at tests/e2e/runner.js
and add a test:e2e
script to your package.json
. To start the script, run npm run test:e2e
or yarn test:e2e
in the root of your project.
By default the Chrome browser is used and all the tests in your tests
-folder are executed.
If you want to provide additional flags to TestCafé, run only a single testfile or change any of the options, feel free to change the runner functionality to suit your use cases.
Test suites can also be run on BrowserStack. BrowserStack has a list of available browsers you can choose from.
Requirements:
- BrowserStack account with "Automate" possibilities.
- The URL of your project should be accessible from the BrowserStack servers.
- WIP - BrowserStack Proxy - Proxy a locally hosted project to BrowserStack
To run your test suite on BrowserStack, the following environment variables should be available: BROWSERSTACK_USERNAME
and BROWSERSTACK_ACCESS_KEY
When the test suite is complete, a URL is returned to show you the test results.
Environment variables |
---|
Don't know how to set environment variables in a JavaScript project? The following tools might provide you with a solution:
|
If you have problems running the test suite from CI (like Jenkins for example), try setting the BROWSERSTACK_PARALLEL_RUNS
and/or the BROWSERSTACK_USE_AUTOMATE
environment variable to 1
.
(related issue).
By default, only the Chrome browser is tested on BrowserStack. A list of available browsers is available on the BrowserStack website.