Closed antonio-zenoo closed 4 years ago
Interesting. First thing I would do is to change the script slightly by removing ./node_modules/.bin/ since all the script already part of node_modules/.bin and npm commands starts in that folder by default.
"scripts": { "test": "cypress run --spec \"/*.feature\"", "test:all": "cypress run --spec \"*/.features\"", "test:tag": "cypress-tags** run -e TAGS='@feature-tag'" }
Otherwise there is nothing suspicious (for a fairly newbie like me)
@pravynandas well, yes, having ./node_modules/.bin/ in the script or not, doesn't make a difference, and it's not the expected behavior. And that's the thing, how come if it is different when it's executed directly in command line, that's my question.
Quick suggestion @antonio-zenoo, can you try changing the single quote around @tag to escaped double quotes, just like the --spec file. ? Something like below...
"test:tag": "./node_modules/.bin/cypress-tags run -e TAGS=\"@feature-tag\""
Thanks!! That worked. Still don't know the reason behind it, but it did the trick.
Great to hear it worked !!
Can anyone also help me on how to run cypress-tags run -e TAGS='@feature-tag'
in parallel on gitlab pipeline.. I tried using
"e2e:test": "cypress-tags run -e -- TAGS='@feature-tag'",
"test:e2e": "run-p --race \"e2e:test -- {@}\" --"
but it didn't work although it is working when i use it with cypress run
instead of cypress-tag run
,
"e2e:test": "cypress run",
"test:e2e": "run-p --race \"e2e:test -- {@}\" --"
Here this work but i can not use tags with cypress run. It will be really grateful if you can help me with any solution.
Hi, So, I cloned the repo, executed it successfully and tried the commands as mentioned
C:\Development\cypress-cucumber-example-master> ./node_modules/.bin/cypress-tags run -e TAGS='@feature-tag'
This gives me the expected result.
Now, if I add a script into the package.json such as
and then execute this script, it looks into all the feature files, but doesn't execute any scenario.
So I wonder if that's the reason there was no a script as part of this repo in the first place, but I don't really understand this different behavior.
I'm pretty new to cypress and nodejs, so my apologies if this is a basic question, but I haven't been able to find an answer so far. If there's any help, I'm on Windows 10.