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

npm Cypress command arguments via -a results as baseUrl is null

Open bennymeade opened this issue 2 years ago • 1 comments

I need to use -a option within the command line, as it will become an input parameter in my GitHub workflow. But when I pass -a option in the command line this results as baseUrl is null.

Is this an issue in the latest version or I'm doing something wrong?

"devDependencies": {
    "cypress": "^9.5.1",
    "cypress-multi-reporters": "^1.5.0",
    "cypress-parallel": "^0.9.0"
  }
"scripts": {
    "cy:run": "cypress run --browser chrome"
  },

Run command:

npx cypress-parallel -s cy:run -t 2 -d cypress/integration -a '\"--config baseUrl=https://example.cypress.io\"'

baseUrl is null

image

Works fine with regular Cypress run command

$ npx cypress open --config baseUrl=https://example.cypress.io

image

Also passing the option in script does work:

"scripts": {
    "cy:run": "cypress run --browser chrome --config baseUrl=https://example.cypress.io"
  },

$ npx cypress-parallel -s cy:run -t 2 -d cypress/integration

image

bennymeade avatar Mar 14 '22 14:03 bennymeade

is this issue still open? I am using 0.9.1 and I am not able to pass arguments to the cypress script.

jdini76 avatar Sep 20 '22 17:09 jdini76

Just remove the backslash from the arguments:

npx cypress-parallel -s cy:run -t 2 -d cypress/integration -a '"--config baseUrl=https://example.cypress.io"'

rushelex avatar Dec 11 '22 15:12 rushelex

Sorry, a bit too late on this: I confirm if you're using npx you don't need the backslash to escape double quotes.

tnicola avatar Dec 28 '22 11:12 tnicola