Skip to content

Is there a way to add screenshot to JUnit report as attachment? #1502

@iljao

Description

@iljao

Hi

I'd like to generate a JUnit report for my tests, and include a screenshot, which is automatically saved by codeceptjs on fail.
Searching didn't give any results. But maybe there is a simple way to achieve this though?

This is a part of my config describing reporter options:

  helpers: {
    Puppeteer: {
      uniqueScreenshotNames: true,
      [...]
    }
  },
  mocha: {
    reporterOptions: {
      codeceptjs-cli-reporter: {
        stdout: "-",
        options: {
          debug: true
        }
      },
      mocha-junit-reporter: {
        stdout: "./output/console.log",
        options: {
          mochaFile: "./output/result.xml"
        }
      }
    }
  },

here's how I run tests:
codeceptjs run --reporter=mocha-multi

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions