cypress-mochawesome-reporter
cypress-mochawesome-reporter copied to clipboard
Special chars in screenshot urls aren't properly escaped
Environment
- OS: MacOS 12.4
- Node: 16.16.0
- cypress-mochawesome-reporter: 3.2.2
- cypress: 10.7.0
What happened?
Image was not visible in the generated report due to improperly escaped special characters in the screenshot's name.
Screenshot file name: test-file#0
Generated img src: screenshots/spec.cy.js/test-file#0.png
Expected img src: screenshots/spec.cy.js/test-file%230.png
Config file
No cypress.json in Cypress 10 anymore, but that's my cypress.config.js
:
const { defineConfig } = require("cypress");
module.exports = defineConfig({
reporter: 'cypress-mochawesome-reporter',
e2e: {
setupNodeEvents(on, config) {
require('cypress-mochawesome-reporter/plugin')(on);
},
specPattern: "cypress/e2e/**/*.cy.{js,jsx,ts,tsx}"
},
component: {
setupNodeEvents(on, config) {
require('cypress-mochawesome-reporter/plugin')(on);
},
devServer: {
framework: "vue-cli",
bundler: "webpack",
},
},
});
### Relevant log output
_No response_
### Anything else?
_No response_
I've prepared a branch with reproduction here: https://github.com/FRSOURCE/cypress-plugin-visual-regression-diff/tree/example/mochawesome-unescaped-chars To reproduce the bug:
- checkout the linked branch,
- install deps via
yarn
command - run command
yarn test:e2e:ci
- open up a report file and see that the image "is missing" though it was copied to the reports directory properly
Nice, I've seen your PR - looks really nice. You don't even know how much will that help me with development of https://github.com/FRSOURCE/cypress-plugin-visual-regression-diff ❤️
I'll come back to you when I test your solution a bit heavier 😄
Should be fixed in v3.2.3.
Thank you for reporting this issue (: I updated it to 3.2.3, and I can still reproduce the problem,
@luqy maybe you have other issue, please provide an example so I can take a look.