cypress-documentation icon indicating copy to clipboard operation
cypress-documentation copied to clipboard

Grep docs

Open leonid-sviderskii-mtl opened this issue 2 years ago • 2 comments

Subject

Cypress grep readme should contain examples for CI runs with multiple args

Description

Hello guys!

Why

I spent a few hours trying to understand why my tests are not working as expected using grepTags plugin on GitHub Actions so I guess my finding could be helpful for others too.

Target page

https://github.com/cypress-io/cypress/blob/develop/npm/grep/README.md

What's missing

The majority of the examples provided do not cover cases with multiple arguments for the grepTags command when running on CI. As the way it's working in CLI and GHA is slightly different, it causes a huge confusion.

While in CLI (like npm scripts) it can work with quotes around the tags like:

"test": "npx cypress run",
"test:prod": "npm run test -- --env environmentName=prod,grepTags='@works-in-prod @only-in-prod --@only-in-staging'",

on GHA, the whole value must be in quotes like:

with:
      env: 'environmentName=prod,grepTags=@works-in-prod @only-in-prod --@only-in-staging'

Otherwise, the tests will be skipped / Cypress cannot find spec files.

leonid-sviderskii-mtl avatar Mar 21 '23 19:03 leonid-sviderskii-mtl

Hello, is anyone working on this issue? I would like to resolve it

Ioanna2001 avatar Apr 11 '23 07:04 Ioanna2001

@Ioanna2001 did you face the same issue?

leonid-sviderskii-mtl avatar Apr 11 '23 15:04 leonid-sviderskii-mtl