We are using testCafe for automation. when it comes to executing tests in parallel, test cafe even executes test blocks within the spec file, parallelly.

Our tests are independent, but there are some tests (within the same file) that are interdependent (to save time). For example:

Test1: End to end user journey, to make a purchase
Test2: Go to transaction portal, to check the transaction details (to ensure that the transaction was smooth)

So, we have kept the above two tests in the same spec file and want to execute them sequentially. Since, we have a transaction from 1st test, so we want to leverage that in test2; instead of doing it again.

1 Answer 1


There's no such feature out of the box. There's been this discussion on TestCafe's Github page, it's still open.

One not very nice workaround could be using meta information to filter what tests you want to execute:

    .meta({ num: '1' })
    ('Test 1', async t => { 

    // some test steps

    .meta({ num: '2' })
    ('Test 2', async t => { 

    // some test steps

and execute the tests using --test-meta or --fixture-meta options:

$ testcafe tests/* --test-meta num=1 && testcafe tests/* --test-meta num=1

then you know Test 1 will be run before Test 2.

  • Thanks. Seems like this is what we have for now.
    – Aalok
    Aug 17, 2020 at 3:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.