Skip to content

Add quoting advice for PowerShell CLI options #6169

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
May 7, 2025

Conversation

MikeMcC399
Copy link
Contributor

@MikeMcC399 MikeMcC399 commented May 4, 2025

Situation

CLI options that include multiple values separated with commas, such as for --config, --env or --reporter-options may be misinterpreted when executing Cypress CLI in PowerShell on Windows.

The following documentation example cypress run --config generally fails to run in PowerShell 7.5.1 on Windows 11 24H2, Cypress 14.3.2 with package managers: npm, pnpm and Yarn:

cypress run --config pageLoadTimeout=100000,watchForFileChanges=false

The error is:

An invalid configuration value was set.

Expected pageLoadTimeout to be a number.

Instead the value was: "100000 watchForFileChanges=false"

An exception is [email protected] under Node.js v20.19.1 using npx cypress run where it works correctly.

Using PowerShell 7.5.1 on Ubuntu 24.04.2 LTS shows no issues with executing the above command in each of the package managers (npm, pnpm and Yarn).

Change

Add an info admonition to https://docs.cypress.io/app/references/command-line to advise enclosing the options in quotes:

When cypress run options or cypress open options are specified with multiple values separated by commas, such as for --config or --env options, and you are using PowerShell on Windows, you may need to surround the key/value pairs with quotes, for example: --env "host=api.dev.local,port=4222".

Copy link

netlify bot commented May 4, 2025

👷 Deploy request for cypress-docs pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit d8d5eb0

@cypress-app-bot
Copy link
Collaborator

@MikeMcC399

This comment was marked as outdated.

@MikeMcC399
Copy link
Contributor Author

image

@jennifer-shehane jennifer-shehane merged commit 61cc806 into cypress-io:main May 7, 2025
5 checks passed
@MikeMcC399 MikeMcC399 deleted the powershell-quoting branch May 7, 2025 18:39
jennifer-shehane added a commit that referenced this pull request May 8, 2025
* Add Windows 2025 to supported OS list (#6142)

* New user roles and permissions defined (#6143)

* chore: release 14.3.0 documentation (#6144)

* feat: documentation for the press() command (#6135)

* docs for the press() command, including a callout in the accessibility guide

* add press to TOC

* Move some content around, mention accesiibility

* remove 'focus' note

* Document Keyboard.Keys

* update reference to command

* Update example to be a little more real case

* Add another example of autocomplete with tab

* Add link to keyboard api page

* Fix version number for introduction

* Fix broken link

* alphabetize see also

* Update package.json

Co-authored-by: Mike McCready <[email protected]>

* Fix broken link

* lint

---------

Co-authored-by: Jennifer Shehane <[email protected]>
Co-authored-by: Mike McCready <[email protected]>

* chore: add 14.3.0 changelog to documentation

* Update docs/app/guides/accessibility-testing.mdx

* Update docs/app/references/changelog.mdx

Co-authored-by: Bill Glesias <[email protected]>

---------

Co-authored-by: Cacie Prins <[email protected]>
Co-authored-by: Jennifer Shehane <[email protected]>
Co-authored-by: Mike McCready <[email protected]>

* Correct parameter usage for click() in shadow.mdx (#6145)

* Update shadow.mdx

- Update the suggestion to pass 'top' to cy.click() using the options defined in cy.click()'s documentation

* Update shadow.mdx

Add missing quote

* Update shadow.mdx

One-line for prettier reasons

* Correct command syntax (#6148)

Adds the missing `s` to `Cypress.Command.overwrite()`

* extend pnpm config instructions (#6149)

* fix cy.origin() "yielding a value" example (#6152)

* Update results-api.mdx (#6150)

* chore: add 14.3.1 changelog (#6153)

* chore: add 14.3.1 changelog

* Update docs/app/references/changelog.mdx

Co-authored-by: Mike McCready <[email protected]>

* empty commit to rekick build

---------

Co-authored-by: Mike McCready <[email protected]>

* docs: harmonize on injectDocumentDomain removal in future version (#6154)

* Add experimentalSessionAndOrigin removed comment to origin video (#6158)

* Fix "cy.visit() succeeded, but commands are timing out" error example (#6157)

* Cross-link cy.origin and injectDocumentDomain (#6156)

* chore: add cypress 14.3.2 changelog (#6160)

* Change 'add on' to 'premium solution' for UI Cov & a11y products (#6162)

* UI Coverage and Branch Review updates (#6167)

* add AQ links and button space

* use onlinks for demo vids

* update Cypress

* content updates

* content tweaks

* add last images

* lint-fix

* simplify

* add detail view docs and clean up

* lint fix

* Update docs/cloud/get-started/introduction.mdx

Co-authored-by: Mike McCready <[email protected]>

* Update docs/ui-coverage/core-concepts/compare-reports.mdx

Co-authored-by: Mike McCready <[email protected]>

* Update docs/ui-coverage/core-concepts/compare-reports.mdx

Co-authored-by: Mike McCready <[email protected]>

* revert cypress version bump

* restore package-lock

* remove yarn lockfile

* Update docs/app/get-started/why-cypress.mdx

Co-authored-by: Tyler Biethman <[email protected]>

* Update docs/cloud/features/branch-review.mdx

Co-authored-by: Tyler Biethman <[email protected]>

* Update docs/cloud/features/branch-review.mdx

Co-authored-by: Tyler Biethman <[email protected]>

---------

Co-authored-by: Mike McCready <[email protected]>
Co-authored-by: Tyler Biethman <[email protected]>

* chore: add 14.3.3 changelog (#6171)

* chore: add 14.3.3 changelog

* Update docs/app/references/changelog.mdx

Co-authored-by: Matt Schile <[email protected]>

---------

Co-authored-by: Matt Schile <[email protected]>

* Rework instructions for missing Cypress binary in CI (#6170)

* Node.js 18 EOL (#6165)

* Add quoting advice for PowerShell CLI options (#6169)

* Add quoting advice for PowerShell CLI options

* Fix --config typo

Co-authored-by: Jennifer Shehane <[email protected]>

---------

Co-authored-by: Jennifer Shehane <[email protected]>

* Bump Cypress Docker versions in examples to Node.js 22.15.0 LTS (#6161)

---------

Co-authored-by: Mike McCready <[email protected]>
Co-authored-by: danjohansenconsulting <[email protected]>
Co-authored-by: Cacie Prins <[email protected]>
Co-authored-by: Jennifer Shehane <[email protected]>
Co-authored-by: Matthew Sbar <[email protected]>
Co-authored-by: Tim Rayers <[email protected]>
Co-authored-by: Emily Wisniewski (Rohrbough) <[email protected]>
Co-authored-by: Mark Noonan <[email protected]>
Co-authored-by: Tyler Biethman <[email protected]>
Co-authored-by: Matt Schile <[email protected]>
Co-authored-by: Jennifer Shehane <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cypress PowerShell: broken comma-separated-values CLI parsing since NodeJS 22.0.0
3 participants