question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

No retry attempts are logged in stdout when setting different reporter other than `spec`

See original GitHub issue

Current behavior:

cypress run doesn’t output retries logging in the terminal when using reporters other than spec.

Desired behavior:

Having cypress run to always output retries logging in the terminal (at least be able to enable it).

This was possible in the cypress retries plugin with this:

module.exports = (on, config) => {
  require('cypress-plugin-retries/lib/plugin')(on)
}

Test code to reproduce

run a failing test with any mocha reporter except spec e.g cypress run --reporter list

Versions

Cypress 5.0.0

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
kucebcommented, Sep 2, 2020

right, It’s a reasonable request for us to add retry info to existing internal mocha reporters. Reopening

2reactions
Hazzard17hcommented, Jan 26, 2021

As a workaround you can use:

// plugins/index.js

module.exports = (on, config) => {
  on('task', {
    log: param => console.log(...Array.isArray(param) ? param : [ param ]) || true
  });
};
// support/index.ts

const config: any = Cypress.config();
if (!config.isInteractive && config.reporter !== 'spec') {
  afterEach(() => {
    const test = (cy as any).state('runnable')?.ctx?.currentTest;
    if (test?.state === 'failed' && test?._currentRetry < test?._retries) {
      cy.task('log', `    (Attempt ${test._currentRetry + 1} of ${test._retries + 1}) ${test.title}`, { log: false });
    }
  });
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

Allow sh to return exit status, stdout and stderr all at once
I've got a step that runs a shell command and then based on it's exit code I want to take the output and...
Read more >
In webdriver-io, how to separate specs from source
I'm using webdriver-io + browserstack (TS/JS project), and I'd like to run my tests against the bundled production output. Settings specs to ...
Read more >
Advanced: configuration | Playwright - CukeTest
Advanced: configuration. Configuration object; workerInfo object; testInfo object; Launching a development web server during the tests; Global setup and ...
Read more >
Configuration - WebdriverIO
Directory to store all testrunner log files (including reporter logs and wdio logs). If not set, all logs are streamed to stdout ....
Read more >
Troubleshooting Control Center | Confluent Documentation
Check the security configuration for all brokers, metrics reporter, client interceptors, and Control Center (see debugging check configuration).
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found