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?
Use the testCafe. createRunner method to create a Runner . Specifies the browsers in which tests run. Configures the test runner to run tests from the specified locations.
You can install TestCafe from npm globally or locally in your project. Global installation is required to run TestCafe in the command line from any location. For instance, you need to install TestCafe globally to execute the testcafe command from your custom application.
TestCafe provides the t. debug method that pauses the test and allows you to debug it with the browser's developer tools. You can also use the --debug-mode command line option to pause the test before the first action or assertion.
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
)
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]'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With