cypress-terminal-report
cypress-terminal-report copied to clipboard
Not working when cypress run
When we use outputTarget: cypress-log.json
the file is being created but it overwrites it in between every test.
If we use outputTarget: cypress-log|json
the file is not being created
We have some some scripts to run cypress in our package.json
{
"cypress:open": "cypress open",
"cypress:run": "cypress run",
}
with cypress:open
the directory form it's working fine, but not with cypress:run
The configuration:
const options = {
outputRoot: config.projectRoot + "/logs/",
specRoot: "cypress/e2e",
outputTarget: {
"cypress-logs|json": "json",
},
printLogsToFile: "always",
printLogsToConsole: "onFail",
};
require("cypress-terminal-report/src/installLogsPrinter")(on, options);
Please also post the version of the plugin and of cypress.
4.1.1
And cypress version?
10.3.1
I cannot reproduce this issue. Both single file output and nested outputs work correctly.
Maybe more details could help, like what browser are the tests running in? is it reproducing locally and in pipelines as well? do you use any other plugins? what are your support install options? or can you maybe provide a reproducible setup (issue repo link)?
If you know how to use the nodejs debugger you could also do your own investigation: starting with a breakpoint here https://github.com/archfz/cypress-terminal-report/blob/master/src/installLogsPrinter.js#L107
Browser : chrome Reproducing locally as well as in pipelines. We are using cypress-grep plugin too. Plugin configuration in support/e2e.ts:
import registerCypressGrep from "cypress-grep";
import registerCypressLogCollector, {
SupportOptions,
} from "cypress-terminal-report/src/installLogsCollector";
registerCypressGrep();
const options: SupportOptions = {
collectTypes: ["cy:log", "cy:command"],
enableContinuousLogging: false,
enableExtendedCollector: false,
debug: false,
};
registerCypressLogCollector(options);
@harithavupputuru There must be something else going on. I have attempted unsuccessfully to reproduce based on the options from the comments, using chrome (Ubuntu). See here https://github.com/archfz/cypress-terminal-report-demo/pull/6/files
Can you check if it is working correctly for you on that branch? Maybe report back if you seem some critical difference in configuration.
With above configuration: Logs generated for command -> cypress run configFile=smoke --browser chrome Log not generated for command -> cypress run --env grepTags="smoke" configFile=smoke --browser chrome
Fix released in 4.1.2