lucataglia
lucataglia

Reputation: 792

How do I run a single test in cypress picking it by name?

I'm using cypress in a project of mine. I have the constraint to keeping all the tests in one single file. To run just one test now I'm editing the source code adding the keyword only to the test I want to run and the I re-run my CLI command. Is it possible to run a single test from command line picking it by name ? I'm doing that in my jest test and I'm wondering if it is possible also for cypress.

Upvotes: 2

Views: 3076

Answers (1)

Evgenii Bazhanov
Evgenii Bazhanov

Reputation: 926

I think you are looking for this library https://github.com/cypress-io/cypress-grep

$ npx cypress run --env grep=hello
cypress-grep: tests with "hello" in their names

Upvotes: 3

Related Questions