-
Notifications
You must be signed in to change notification settings - Fork 39
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
Abbility to import logs into report #180
Comments
I have quickly glanced into the mochawesome report. I suppose we are talking here about the html generated output. And you would like to include the logs generated from this plugin into that right? I haven't used mochawesome, but I am open to it and contribution is welcome. Wouldn't this also require formatting the logs for proper html display? Also besides all this have you also considered configuring the plugin to export logs in files only for failed tests? In any case it seems to me that this should be enabled by a new config on the support install, and might also need a little bit of refactoring on how we send logs to node plugin side, as we would also need to direct them into this context push too on the support js side ( changes to be made in log collector controllers) + necessary formatting. |
I am thinking that maybe we can go with something simple. This would be simpler if the processing of the logs for output into files would have happened in the browser, but they happen on node side. We could add a Cypress.TerminalReport.on('logs', (logs) => {
Cypress.Mochawesome.context.push({
title: `Execution log`,
value: Cypress.TerminalReport.formatLogs('txt', logs)
})
}); |
This really nice aproach, since inside Only one possible problem I can see here (and maybe is not valid at all), if the To be honest, I like the txt format but I think the JSON gives more freedom on formating the output. Or even better expose both formats. |
Hi we also looking forward to this feature! afterEach(() => {
const data = Cypress.TerminalReport.getLogsOfCurrentTest().join('\n']);
cy.addTestContext(`---[ Logs ]-------------------------------------------------------------:\n${data}`);
}); Although the proposed way also works, we could collect the logs per test in some way or another. |
#180: Implement support for mochawesome integration.
Added support in 5.1.1; see readme |
Hello
This plugin is very helpfull during debuging failed tests.
But when run on CI it is not very convinient to search into the expoted log files to locate the failed test.
I'd like be able to import the collected logs of failed tests into the Mochawesome report as "additiona context" on test:after:run.
I can underestant that the log files are not yet created at this state, but later.
So I'm thinking of a different kind of data exposure and use it on test:after:run.
But "auto-import" by the plugin - activated by a new flag - could be also OK, if not even better.
For example I can import the video with the following simple code
An idea of the code to be used to add the logs into report is:
Thank you for your work on this plugin
.
The text was updated successfully, but these errors were encountered: