Executing selected tests
Quite often, when writing or extending a set of tests, we need to concentrate on one specific test while omitting all others. Tests are usually organized into sets (groups of tests are also known as fixtures). Luckily, TestCafe provides the fixture.only
and test.only
methods to specify that only a selected test or fixture should be executed and all others should be skipped. Let's review it using our set of tests in a simplified form, with all the test actions commented out:
// ...fixture('Redmine log in tests')Â Â Â Â .page('http://demo.redmine.org/');test.only('Create a new user', async (t) => { /* ... */ });test('Log in', async (t) => { /* ... */ });test('Log out', async (t) => { /* ... */ });fixture('Redmine entities creation tests')Â Â Â Â .page('http://demo.redmine.org/');test('Create a new project', async (t) => { /* ......