LiveModeRunner Object

An object that configures and launches test tasks in live mode. In this mode, TestCafe watches the test files, and restarts the tests when you make changes.

Use the testCafe.createLiveModeRunner function to create a LiveModeRunner.

Example

const createTestCafe = require('testcafe');

const testcafe   = await createTestCafe('localhost', 1337, 1338);
const liveRunner = testcafe.createLiveModeRunner();

await liveRunner
    .src('tests/test.js')
    .browsers('chrome')
    .run();

await testcafe.close();

LiveModeRunner is a Runner class descendant and provides the same API (with certain limitations).

Methods

Limitations

A TestCafe server can create only one file system watcher that tracks changes to test files.

This implies the following limitations:

  • You cannot create multiple live mode runners for a single TestCafe server instance.
  • You cannot call the runner.run method more than once for a single LiveModeRunner.

In rare cases when you need multiple live mode sessions running in parallel, you can create several TestCafe server instances.

Why We Use Cookies

This site uses cookies to make your browsing experience more convenient and personal. Cookies store useful information on your computer to help us improve the efficiency and relevance of our site for you. In some cases, they are essential to making the site work properly. By accessing this site, you consent to the use of cookies. For more information, refer to DevExpress privacy policy and cookie policy.