cypress-io / cypress

Fast, easy and reliable testing for anything that runs in a browser.
https://cypress.io
MIT License
47.09k stars 3.19k forks source link

run --quiet CLI option outputs test steps #30661

Open MikeMcC399 opened 21 hours ago

MikeMcC399 commented 21 hours ago

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 commented 12 hours ago

@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?