cypress run doesn't output retries logging in the terminal when using reporters other than spec.
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)
}
run a failing test with any mocha reporter except spec
e.g cypress run --reporter list
Cypress 5.0.0
I can recreate this. I do see that the attempts are not logged within the test when running with the list reporter.
CYPRESS_RETRIES=3 cypress run --reporter list
support/index.js
require('cypress-plugin-retries')
plugins/index.js
module.exports = (on, config) => {
require('cypress-plugin-retries/lib/plugin')(on)
}
spec.js
it('test', () => {
expect(true).to.be.false
})
package.json
{
"devDependencies": {
"cypress": "4.12.1",
"cypress-plugin-retries": "^1.5.2"
}
}

cypress run --reporter list
spec.js
it('test', {
retries: 3
}, () => {
expect(true).to.be.false
})
package.json
{
"devDependencies": {
"cypress": "5.0.0"
}
}
You can see that the test retried 3 times because it took 4 attempt screenshots, but it's not logged in the reporter output.

Yes, in the plugin it did print the retry logs, however that just a hack. If you opt into a custom reporter you're telling Cypress you want to control the reporting - so we don't print anything. The mocha list reporter does not print retries info
As an example if you provided a custom xml reporter, it wouldn't make sense for us to log retries to the console.
Your custom reporter will need to listen to the retry event if you want to implement retries logging similar to the default reporter.
@Bkucera I'll kindly have to disagree due to the fact that spec also is a mocha reporter that doesn't have retries logging by default and yet cypress prints retires when I opt into a 'custom' reporter by running with --reporter spec. Therefor it would make more sense to be able to enable retries logging with some property in the cypress configuration file.
right, It's a reasonable request for us to add retry info to existing internal mocha reporters. Reopening
Many people are running into this issue when defining the mocha-multi-reporters as their reporter, which I suppose is outside of the scope that Ben originally defined, but this is a pretty popular reporter. Any way to accommodate printing retries in that reporter also?
Most helpful comment
right, It's a reasonable request for us to add retry info to existing internal mocha reporters. Reopening