Skip to main content

Testplane Config

By default, when launched, Testplane looks for a .testplane.conf.ts or testplane.config.ts file in the current working directory.

You can specify your configuration file using the --config CLI option.

Setup

To set up Testplane, you need to specify at least one browser:

testplane.config.ts
import type { ConfigInput } from "testplane";

export default {
browsers: {
chrome: {
desiredCapabilities: {
browserName: "chrome",
},
},
},
} satisfies ConfigInput;

As the number of tests in the project grows, you will likely need more advanced features—sets, plugins, and more browsers. Below is an example of a more extended configuration:

testplane.config.ts
import type { ConfigInput } from "testplane";

export default {
retry: process.env.IS_CI ? 5 : 0,

httpTimeout: 60_000,
sessionsPerBrowser: 5,
testsPerSession: 20,

browsers: {
chrome: {
desiredCapabilities: {
browserName: "chrome",
automationProtocol: "devtools",
headless: true,
},
},
},
sets: {
desktop: {
files: ["testplane-tests/**/*.testplane.(t|j)s"],
browsers: ["chrome"],
},
},
plugins: {
"html-reporter/testplane": {
enabled: true,
},
},
} satisfies ConfigInput;

Configuration Reference

The only mandatory section in Testplane settings is the browsers section.

All browser settings (except desiredCapabilities) can be moved to the global level so that they apply to all browsers. For example, this is convenient for setting timeouts for all browsers at once.

NameDescription
browsers

Mandatory section. It specifies the settings for all browsers in which the tests will be run.

sets

Section that allows you to bind a set of tests to specific browsers and run them all at once with a single command. This can be useful, for example, for separately running desktop and mobile tests.

system

Section for Testplane's system settings. Allows you to set the number of subprocesses in which tests will be run, enable debug mode for WebDriver, and much more.

pluginsSection through which you can connect external plugins to Testplane.
prepareBrowser

Function in which you can prepare the browser before tests are run in it. For example, you can add new commands to the browser object in this function.

prepareEnvironment

Function in which you can set environment variables or, for example, supplement some config parameters.

devServer

Section for setting up the automatic launch of the dev server before running tests.

lastFailedSection for configuring the rerun of only failed tests.

Follow the link or select the desired section in the left navigation menu of the documentation to learn more about the corresponding settings.