Closed BenPowerProfessional closed 2 years ago
Hi @BenPowerProfessional
Given that you have used the package.json scripts from the readme, you can modify them to pass environment variables. On windows, with the parameter from your question, the script would then become:
"cypress-ntlm-chrome": "npm run ntlm-proxy && (cypress-ntlm run --browser chrome & ntlm-proxy-exit)"
Thank you very much, I will give this a try.
@bjowes how to run specific cucumber scenarios by tags? I am trying with below syntax to run scenarios tagged with @user-admin but all the scenarios are being executed (scenarios with different tags). I tried the same syntax on different project where cypress-ntlm-auth is not required and I see that only specific scenarios with tags are being executed. Is there anything missing in the below syntax? Thanks!
"test:tags": "npm run ntlm-proxy && (cypress-ntlm run --headed --browser chrome --env TAGS='@user-admin' configFile=test --spec 'cypress/integration/cucumber-tests/Offices/OfficeList/TestA.feature' & ntlm-proxy-exit)"
Generally you should be able to pass any command line argument also when executing through cypress-ntlm, but I remember that there have been issues with more complex variants. It should be possible to resolve with proper escaping, since qoutes won't work the same way as when entered directly on the command line. Some points to consider:
configFile=test
statement seems odd, it should be --configFile=test
if you want to set it.cypress-ntlm open
instead and go to the "Settings" tab. There you can see all settings applied, and also which source each setting is from.@bjowes Thanks for the quick response. I tried your suggestion for configFile flag and getting "error: unknown option: --configFile" and TAGS value without quotes. Still not able to execute specific scenarios.
From cypress-cucumber-preprocessor doc I see that to execute scenarios using tags syntax is "cypress-tags" but to use ntlm-auth it is "cypress-ntlm". Example: ./node_modules/.bin/cypress-tags run -e TAGS='not @foo and (@bar or @zap)' https://github.com/TheBrainFamily/cypress-cucumber-preprocessor#smart-tagging
@hari49951 I think you meant to at handle somebody else?
Is this still an issue @hari49951 ?
no, can we close this issue? Thanks for checking.
How can I pass command line parameters, for example:
cypress run --browser chrome
I would like to force Cypress to run in Chrome instead of Electron, because it's a bit buggy.
I tried this, but it didn't work:
npm run cypress-ntlm --browser chrome