-
Notifications
You must be signed in to change notification settings - Fork 19
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
Option to only record the logs? #18
Comments
How can we retrieve the recorded logs. Is it possible to store these logs in a file? If yes how can this be done? |
From the Readme: So we used the |
Do you have any code sample for this? I tried using getLogs, but didn't get it. |
Something like this: import {
getLogs
} from 'cypress-log-to-output';
const logs = getLogs(); |
May be stupid question, but how use this in test step? |
I'm also interested about how to use it in a test step. |
I don't think I really understand what you want to do. |
Then test crashed, and cypress-log-to-output - breaks other packages, such as cypress-audit. I had to remove it altogether so that the rest of the packages would work again. |
The plugin and your spec file run in different environments, to access the node process from your test spec you need to use cy.task. When installing the plugin, add: import { getLogs, install } from 'cypress-log-to-output';
module.exports = (on, config) => {
/** the rest of your plugins... **/
const options = { recordLogs: true };
install(on, filterCallback, options);
on('task', {
getDebuggerLogs(){
return getLogs();
}
});
} Then on your spec file access it: cy.task('getDebuggerLogs').then((logs) => {
// do whatever with the logs here
} |
Its great being able to record the console logs in addition to printing them to the terminal.
I would like to store the logs during the cypress tests for our CI builds but printing them to the terminal output as well is flooding the output.
Is there a way to only record the logs and not print them to the terminal output?
The text was updated successfully, but these errors were encountered: