Skip to content
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

Expose CLI parsing logic that converts "cypress run" arguments to options object #7760

Closed
bahmutov opened this issue Jun 19, 2020 · 3 comments · Fixed by #7798
Closed

Expose CLI parsing logic that converts "cypress run" arguments to options object #7760

bahmutov opened this issue Jun 19, 2020 · 3 comments · Fixed by #7798
Assignees
Labels
cli type: enhancement Requested enhancement of existing feature

Comments

@bahmutov
Copy link
Contributor

bahmutov commented Jun 19, 2020

It would be nice to expose a small utility from Cypress NPM module to parse "cypress run" CLI arguments into options object. Could be used to wrap Cypress and get for example JSON of results (#7532) while running everything the same way as "normal run" does

We already have the code in cli/lib/cli.js, just need to expose it from the NPM module

// user code
const cypress = require('cypress')
const runOptions = cypress.cli.parseRunArguments(process.argv.slice(2))
cypress.run(runOptions).then(...)

Then it could eliminate need to prefix cypress run commands like Percy or Happo plugins do right now

npx percy-cypress -- cypress run ...

and would allow those plugins to receive the Dashboard URL to link their run to Cypress Dashboard run, like done in https://github.com/cypress-io/github-action#outputs

@bahmutov bahmutov added the cli label Jun 19, 2020
@bahmutov
Copy link
Contributor Author

It could also enable checking Cypress test run against expected number of tests, their results, etc, Almost like meta testing

@cypress-bot cypress-bot bot added the stage: proposal 💡 No work has been done of this issue label Jun 22, 2020
@jennifer-shehane jennifer-shehane added the type: enhancement Requested enhancement of existing feature label Jun 22, 2020
@cypress-bot cypress-bot bot added stage: work in progress There is an open PR for this issue [WIP] stage: needs review The PR code is done & tested, needs review and removed stage: proposal 💡 No work has been done of this issue stage: work in progress There is an open PR for this issue [WIP] labels Jun 24, 2020
@cypress-bot cypress-bot bot added stage: work in progress There is an open PR for this issue [WIP] stage: needs review The PR code is done & tested, needs review and removed stage: needs review The PR code is done & tested, needs review stage: work in progress There is an open PR for this issue [WIP] labels Jul 13, 2020
@cypress-bot cypress-bot bot added stage: work in progress There is an open PR for this issue [WIP] and removed stage: needs review The PR code is done & tested, needs review labels Jul 14, 2020
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Jul 14, 2020

The code for this is done in cypress-io/cypress#7798, but has yet to be released.
We'll update this issue and reference the changelog when it's released.

@cypress-bot cypress-bot bot added stage: pending release and removed stage: work in progress There is an open PR for this issue [WIP] labels Jul 14, 2020
@jennifer-shehane
Copy link
Member

Released in 4.11.0.

This comment thread has been locked. If you are still experiencing this issue after upgrading to
Cypress v4.11.0, please open a new issue.

@cypress-io cypress-io locked as resolved and limited conversation to collaborators Aug 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cli type: enhancement Requested enhancement of existing feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants