Execute tests one by one even across browsers

562 views Asked by At

I am writing my E2E tests with testcafe against a test backend that doesn't support concurrency, i.e. if two tests execute in parallel, the test backend blows up.

When I am testing against one browser only, the tests execute serially. However, when I specify multiple browsers, the tests run serially per browser, but the tests get started in each browser at the same time.

I want testcafe to first execute all the tests in one browser, then open the next browser and execute all tests in it, etc.

Is this possible?

1

There are 1 answers

0
Alexander Moskovkin On BEST ANSWER

TestCafe doesn't have a built-in options for that. But you can configure it manually. For example you can setup running in the package.json with the npm-run-all module:

  "scripts": {
    "test:chrome": "testcafe chrome c:/temp/test.js",
    "test:ie": "testcafe ie c:/temp/test.js",
    "test": "run-s test:chrome test:ie -c"
  }

Also you can setup it in the node.js script with TestCafe Programming API.