Skip to main content

Running Tests

Use the npx testplane command to run all tests in your project.

Running a Specific File

If you want to run a whole group of tests located in a specific file, specify the path to this file as an input parameter for testplane:

npx testplane src/features/Reviews/Reviews.test/MyReview/MyReview.a11y@touch-phone.testplane.js

The --grep Option

If you want to run a specific test, use the --grep option by providing the full name of the test as its value:

npx testplane --grep "Accessibility Leaving a review"

The .only Directive

You can also use the .only directive for a suite of tests (describe) or a specific test (it), similar to what is implemented in mocha (see the exclusive tests section):

For example:

describe.only("Accessibility", function () {
// Test suite...
});

or

it.only("Leaving a review", async function () {
// Test code...
});

Running a Test N Times

You might want to run the same test multiple times, for example, to check test stability. Use the @testplane/test-repeater plugin to run tests a specified number of times.

After installing and enabling the plugin, you can run the test multiple times like this:

npx testplane --test-repeater-repeat 5 --grep 'Test name'