Command to run two or multiple tests
Asked Answered
B

2

8

How to run two or more tests from a single TestCafe CLI command.

-t "Test name" accepts only one test name.

https://devexpress.github.io/testcafe/documentation/using-testcafe/command-line-interface.html#-t-name---test-name

Requirement:

Want to run selected 10 tests out of 80 available in .js file.

Is there any specific command or pattern available?

Billionaire answered 24/1, 2019 at 16:42 Comment(0)
H
3

You can run multiple TestCafe tests using below command, for e.g.

// Matching different search patterns
testcafe -e -u chrome testcafe/tests -T 'pattern1|pattern2|pattern3'

// Matching similar search patterns L0 and L1 using regex
testcafe -e -u chrome testcafe/tests -T 'L[01]'
Hydroscope answered 3/8, 2019 at 7:45 Comment(0)
B
8

You're correct that -t will only match a test name, but -T (capital) or --test-grep will allow you to match a pattern.

If the tests you want to run are grouped in a fixture, you can also run a particular fixture with -f or a set of fixtures with -F to match a pattern (similar to -T)

Bickart answered 24/1, 2019 at 19:12 Comment(0)
H
3

You can run multiple TestCafe tests using below command, for e.g.

// Matching different search patterns
testcafe -e -u chrome testcafe/tests -T 'pattern1|pattern2|pattern3'

// Matching similar search patterns L0 and L1 using regex
testcafe -e -u chrome testcafe/tests -T 'L[01]'
Hydroscope answered 3/8, 2019 at 7:45 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.