Cypress: Running tests from a specific groups

Created on 10 Nov 2017  Â·  6Comments  Â·  Source: cypress-io/cypress

  • Cypress Version: 1.0.3

Is this a Feature or Bug?

Feature

Current behavior:

There is no way to run a group of tests. We can either run tests from one file or all of them per project. The closest way to do it is to use --project flag and define cypress.json for each group. It feels just too much especially if we wanna to share same cypress config for couple groups.

Desired behavior:

Practical example, would be to be able to group tests into smoke tests and e2e tests and call them separately. Or sometimes just run smoke tests.

So in general being able to run group of tests, for example to run all tests from a certain subdirectory.

duplicate

Most helpful comment

Quick workaround which we found is passing --config integrationFolder=tests/smoke in cli call, not sure if that's the right way...

All 6 comments

The quick way to run groups of specs would be by controlling cypress through its module API, while we work on wildcard support for running several spec files.

Sent from my iPhone

On Nov 10, 2017, at 08:48, Paweł Gałązka notifications@github.com wrote:

Cypress Version: 1.0.3
Is this a Feature or Bug?

Feature

Current behavior:

There is no way to run a group of tests. We can either run tests from one file all of them per project. The closest way to do it is to use --project flag and define cypress.json for each group. It feels just too much especially if we wanna to share same cypress config for couple groups.

Practical example, would be to group tests into smoke tests and e2e tests.

Desired behavior:

Being able to run group of tests, for example to being able to run all tests from a certain subdirectory.

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

Quick workaround which we found is passing --config integrationFolder=tests/smoke in cli call, not sure if that's the right way...

That's good way too, by putting different groups of specs in different folders. But hard to run all specs with this

Sent from my iPhone

On Nov 10, 2017, at 09:34, Paweł Gałązka notifications@github.com wrote:

Quick workaround which we found is passing --config integrationFolder=tests/smoke in cli call, not sure if that's the right way...

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.

Closing in favor of this:

https://github.com/cypress-io/cypress/issues/681

That issue goes into a ton of detail of what we're doing to accomplish this and why its a big change.

Also as per what @bahmutov suggested you can use our Module API to accomplish this right now by chunking the specs into groups you control.

Here's an example of using the API to do that.

https://github.com/cypress-io/cypress/issues/416#issuecomment-337400871

In latest version I've used "cypress:smoke:run": "export CYPRESS_integrationFolder=cypress/smoke && node_modules/.bin/cypress run", based on @pawelgalazka comment

You can accomplish group execution using the "cypress-select-tests" plugin
https://github.com/bahmutov/cypress-select-tests
It allows you to select a group of tests based on filename or title using grep style.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

szabyg picture szabyg  Â·  3Comments

carloscheddar picture carloscheddar  Â·  3Comments

igorpavlov picture igorpavlov  Â·  3Comments

simonhaenisch picture simonhaenisch  Â·  3Comments

jennifer-shehane picture jennifer-shehane  Â·  3Comments