Thimali Wijayathilake
Thimali Wijayathilake

Reputation: 23

Cypress Error in sending multiple parameters via CLI

  1. I'm using below command in my terminal.(Im following the cypress support doc)

cypress run --env host=kevin.dev.local,api_server=http://localhost:8888/api/v1

  1. my spec is like this.

enter image description here

  1. I'm expecting to set variables as below:
host=kevin.dev.local
api_server=http://localhost:8888/api/v1
  1. But it does not set the value of the "api_server". Instead it sets host with both values as below:
host=kevin.dev.local http://localhost:8888/api/v1

Pls support to get this resolved.

enter image description here

Upvotes: 1

Views: 590

Answers (1)

pavelsaman
pavelsaman

Reputation: 8322

You shell might interpret some of the characters before passing them to Cypress.

When I run in Powershell the following command:

> cypress open --env a=1,b=2

I'll end up in the same situation like described.

When I run:

> cypress open --env "a=1,b=2"

It will correctly set two env variables a and b with correct values.

So, try using double quotes.

Upvotes: 1

Related Questions