Jn Neer
Jn Neer

Reputation: 245

TestCafe : How to run all tests except few tests

I have few tests that took a considerable long time as few jobs are initiated at the backend side which takes quite long. I want to have some control so that I can run all tests as part of my regression suite except these few long-running tests.

I do not want to specify metadata on all the tests, it would be great if I can add metadata on long-running tests and somehow run all tests except that metadata.

Let's say I add metadata on long-running tests as longRunning=true and I can run tests with some command like : node node_modules/testcafe/bin/testcafe not --test-meta longRunning=true

Is there any way to execute all tests other than this metadata longRunning=true

Upvotes: 0

Views: 1065

Answers (2)

Martin H.
Martin H.

Reputation: 584

Additionally, there is another way provided by TestCafe to skip specific tests, which is the skip method:

fixture `My test fixture`
.page`https://www.my-test-page-com`;

  test('Test 1', () => {}); // This test will run
  test.skip('Test 2', () => {}); // This test will be skipped
  test('Test 3', () => {}); // This test will run too

Upvotes: 0

pavelsaman
pavelsaman

Reputation: 8352

You can't do it (as of December 2020) as part of the command, but you can do it programatically, which is described here: https://devexpress.github.io/testcafe/documentation/reference/testcafe-api/runner/filter.html

Upvotes: 1

Related Questions