Skip to content

Latest commit

 

History

History
57 lines (41 loc) · 2.77 KB

running-the-testsuite.md

File metadata and controls

57 lines (41 loc) · 2.77 KB

Home

Running the test suite

There are various ways to run your test suite:

Running locally

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.

Running on BrowserStack

Test suites can also be run on BrowserStack. BrowserStack has a list of available browsers you can choose from.

Requirements:

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:
  • cross-env: Cross platform setting of environment scripts.
  • dotenv: Loads environment variables from .env for nodejs projects.
  • dotenv-cli: Load dotenv files in your CLI.

Running it from CI

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

Test on a different Browser / OS / Device

By default, only the Chrome browser is tested on BrowserStack. A list of available browsers is available on the BrowserStack website.