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

run --quiet CLI option outputs test steps #30661

Closed
MikeMcC399 opened this issue Nov 21, 2024 · 3 comments
Closed

run --quiet CLI option outputs test steps #30661

MikeMcC399 opened this issue Nov 21, 2024 · 3 comments

Comments

@MikeMcC399
Copy link
Contributor

MikeMcC399 commented Nov 21, 2024

Current behavior

The cypress run --quiet CLI option does not suppress all Cypress stdout output. Test spec steps, such as the following, are output:

  template spec
    ✓ passes (421ms)


  1 passing (2s)

Desired behavior

According to cypress run Options, there should be no stdout output if --quiet or -q are passed:

Option Description
--quiet, -q If passed, Cypress output will not be printed to stdout. Only output from the configured Mocha reporter will print.

In a project with no Mocha reporter configured, running Cypress in a bash shell, the output from:

npx cypress run --quiet

and

npx cypress run > /dev/null

should be identical.

Test code to reproduce

Scaffold a Cypress E2E project with the single default cypress/e2e/spec.cy.js

describe('template spec', () => {
  it('passes', () => {
    cy.visit('https://example.cypress.io')
  })
})

Execute:

npx cypress run --quiet

Cypress Version

13.16.0

Node version

v22.11.0 LTS

Operating System

Ubuntu 24.04.1 LTS

Debug Logs

$ npx cypress run --quiet

DevTools listening on ws://127.0.0.1:39903/devtools/browser/01a687fe-8df0-41a4-b4b4-67217f4a1d1f


  template spec
    ✓ passes (421ms)


  1 passing (2s)

Other

@ryanthemanuel
Copy link
Collaborator

@MikeMcC399, by default we use the spec mocha reporter so I think the test steps, etc. are accurate to what the doc says. The dev tools output would ideally not be present though i think?

@MikeMcC399
Copy link
Contributor Author

MikeMcC399 commented Nov 22, 2024

@ryanthemanuel

Thanks for putting me right! The CLI --quiet option documentation doesn't make it clear about the built in https://mochajs.org/#spec configuration. That could be fixed by a documentation update which I will propose in the docs repo.

The dev tools output is on stderr, not stdout, so it shouldn't be suppressed by --quiet. See https://github.com/aslushnikov/getting-started-with-cdp/blob/master/README.md#protocol-fundamentals

DevTools listening on ws://127.0.0.1:39903/devtools/browser/01a687fe-8df0-41a4-b4b4-67217f4a1d1f

Closing as "works as designed".

@MikeMcC399
Copy link
Contributor Author

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

No branches or pull requests

2 participants