cypress-mochawesome-reporter icon indicating copy to clipboard operation
cypress-mochawesome-reporter copied to clipboard

Cypress mochawesome report is showing a broken img

Open AhmedMohaidat opened this issue 1 year ago • 3 comments

Environment

- OS: Windows 11
- Node: v18.17.1
- cypress-mochawesome-reporter: 
- cypress: 13.3.0

What happened?

The reporter is saving the screenshots in the main cypress file which makes the report show a broken img

image

Config file

cypress.config.js:

module.exports = defineConfig({
  projectId: "4d49nh",
  defaultCommandTimeout: 20000,
  requestTimeout: 30000,
  chromeWebSecurity: false,
  retries: 0,
  video: true,
  reporter: "cypress-mochawesome-reporter",
  reporterOptions: {
    // reportDir: "cypress/reports/",
    // json: false,
    // html: true,
    videoOnFailOnly: false,
    overwrite: true,
    charts: true,
    reportPageTitle: "custom-title",
    embeddedScreenshots: true,
    screenshotOnRunFailure: true,
    inlineAssets: false,
    saveAllAttempts: false,
    screenshotsFolder: "cypress/reports/screenshots",
  },
  e2e: {
    testIsolation: true,
    setupNodeEvents(on, config) {
      // implement node event listeners here
      require("cypress-mochawesome-reporter/plugin")(on);
      // on("before:run", async (details) => {
      //   console.log("override before:run");
      //   await beforeRunHook(details);
      // });
      // on("after:run", async () => {
      //   console.log("override after:run");
      //   await afterRunHook();
      // });
    },
  },
  env: {
  },
});

Relevant log output

No response

Anything else?

No response

AhmedMohaidat avatar Oct 06 '23 01:10 AhmedMohaidat

Please create a repo with the problem and steps to reproduce the issue so I can have a look.

Thanks.

LironEr avatar Oct 10 '23 15:10 LironEr

I found this problem too, when open the report in Jenkins and it show error as below:

Refused to load the font '<URL>' because it violates the following Content Security Policy directive: "default-src 'self' 'unsafe-inline' *". Note that 'font-src' was not explicitly set, so 'default-src' is used as a fallback. Note that '*' matches only URLs with network schemes ('http', 'https', 'ws', 'wss'), or URLs whose scheme matches `self`'s scheme. The scheme 'data:' must be added explicitly.
Refused to load the image 

frankind avatar Dec 01 '23 03:12 frankind

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Feb 02 '24 06:02 stale[bot]