infosum / cypress-tags

Use custom tags to slice up Cypress test runs
83 stars 20 forks source link

Cypress 10 + cypress-tags 1.0.0 looking for cypress.json #220

Open pdisselhorst opened 1 year ago

pdisselhorst commented 1 year ago

Currently on Cupress 10.3.1 and trying to add cypress-tags (version 1.0.0 showing in package-lock.json).

Whenever I attempt to run any cypress-tags commands, I see the following error:

Failed to read cypress.json, using default configuration Spec files: cypress/integration/*/.feature No matching tags found

Any ideas why it is still searching for cypress.json instead of the new cypress-config.ts for Cypress 10+? Is there a way I can override which config file it attempts to use?

annaet commented 1 year ago

Hi @pdisselhorst

Are you sure that's a cypress-tags issue? Cypress is the one that will look up your cypress.json or cypress.config.ts file. Cypress-tags is just a pre-processor.

I would also suggest upgrading to cypress-tags@1.1.0 as there were a couple of bug fixes added.

niko7o commented 1 year ago

Same thing happens here since we upgraded to Cypress 10.6.0 coming from Cypress 8.0.0, happening with cypress-tags 1.1.2

image

My thoughts are that maybe something changed with the interface (we used cypress tags with cucumber) and i'm seeing in the documentation a different way of tags, for example it('mobile', 'Foo bar')

I will be deep-diving and follow up if I find solution!

@pdisselhorst just for context in case it helps us deep-dive, do you use cucumber in your project?

annaet commented 1 year ago

@nikotomad can you share your cypress.config.ts?

niko7o commented 1 year ago

@nikotomad can you share your cypress.config.ts?

Yes, surely. I've hidden some values but the context is still there (keep in mind this is a custom config file for mobile but same happens with the main config entry point regardless)

image

More context:

Appreciate you reaching back to us

annaet commented 1 year ago

Hi @nikotomad

It looks like you're not actually using cypress-tags as your preprocessor. I don't think the plugin would be compatible cucumber for this reason, as they both filter tests in different ways.

As per this issue (https://github.com/infosum/cypress-tags/issues/29) we currently can't support running alongside other preprocessors.

I would suggest if you're using cucumber then you will need to use their inbuilt test filtering.