Closed aswine closed 2 years ago
This sounds like you are using mochawesome-merge. I do not maintain that package so if this is the case, I suggest you open an issue in that repo.
Mochawesome merge was trying to find reports to merge, but they are unable to find it. The command executed in the CLI was npx cypress run --browser chrome --headless --spec cypress/integration/uk/smoke/*.spec.js --env grepTags=@TryNow --reporter-options reportDir=UKStagingJsonReports,reportFilename=StagingTests,html=false,json=true,overwrite=false. Reports are generated in the expected path as given in the CLI command
What does your cypress config look like?
"chromeWebSecurity": false, "defaultCommandTimeout": 10000, "requestTimeout": 10000, "screenshotOnRunFailure": true, "skipCopyingScreenshots": true, "viewportWidth": 1440, "viewportHeight": 900, "pageLoadTimeout": 10000, "reporter": "../node_modules/mochawesome/src/mochawesome.js", "video": false
So looks like mochawesome is saving your reports to the expected directory. However mochawesome-merge is looking for a .jsons
directory which doesn't exist. Where are you calling mochawesome-merge? You may need to adjust the options there.
Oh, I see. You're using cypress-mochawesome-reporter
which is another package I do not maintain. It bundles mochawesome and mochawesome-merge. Please file an issue with that project.
Closing the issue as I was able to resolve this. Thank you for your help
Error: Pattern UKStagingJsonReports/.jsons/*.json matched no report files
I have my tests running as
npx cypress run --browser chrome --headless --spec cypress/integration/uk/smoke/*.spec.js --env grepTags=@TryNow --reporter-options reportDir=UKStagingJsonReports,reportFilename=StagingTests,html=false,json=true,overwrite=false
Here I have given a folder name and the name of the json reports as per my test environment. After the execution I have my json reports for each individual tests in the folder "UKStagingJsonReports", but the execution fails saying StagingJsonReports/.jsons/*.json matched no report files. Is there a way to override this. Also my screenshots are getting copied from the default directory to the this custom report directory. Are there ways to override this.
Error message as it is:
Read and merge jsons from "UKStagingJsonReports/.jsons" Copy screenshots folder from "/Users/aswinedavalath/Automation_Web/c*****/cypress/screenshots" to "UKStagingJsonReports/screenshots" An error was thrown in your plugins file while executing the handler for the 'after:run' event.
Desired behavior User should be able to allowed to decide where to store the json reports and screenshots if the user wants to create a new folder for the same.