LironEr / cypress-mochawesome-reporter

Zero config Mochawesome reporter for Cypress with screenshots and videos
MIT License
159 stars 49 forks source link

Screenshot copy not skipped with matching directory #113

Closed sblair12 closed 1 year ago

sblair12 commented 1 year ago

Environment

- OS: Linux (internal)
- Node: 14.20.1
- cypress-mochawesome-reporter: 3.2.3
- cypress: 10.0.3

What happened?

Got Error: Source and destination must not be the same when the source and destination directories are the same path, but their strings differ. See log output section for the full log. Looks like this was initially fixed in #52

This could be related, but cypress-tests is a symlink

cypress-tests -> /local/home/workplace/cypress-tests

Config file

const { defineConfig } = require('cypress')

module.exports = defineConfig({
    chromeWebSecurity: false,
    defaultCommandTimeout: 10000,
    requestTimeout: 10000,
    reporter: 'cypress-mochawesome-reporter',
    retries: 0,
    viewportHeight: 900,
    viewportWidth: 1600,
    video: false,
    e2e: {
        baseUrl: 'https://redacted.com',
        specPattern: 'tests/**/*.cy.{js,jsx,ts,tsx}',
        async setupNodeEvents(on, config) {
            require('cypress-mochawesome-reporter/plugin')(on)
            return config
        }
    }
})

Relevant log output

Start generate report process
Read and merge jsons from "/local/home/workplace/cypress-tests/.jsons"
Copy screenshots folder from "./cypress-tests/screenshots" to "/local/home/workplace/cypress-tests/screenshots"
Enhance report
An error was thrown in your plugins file while executing the handler for the after:run event.

The error we received was:

Error: Source and destination must not be the same.
    at /local/home/workplace/node_modules/cypress-mochawesome-reporter/node_modules/fs-extra/lib/util/stat.js:49:19
    at cb (util.js:290:31)
    at processTicksAndRejections (internal/process/task_queues.js:82:21)

Anything else?

No response

stale[bot] commented 1 year ago

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.