LironEr / cypress-mochawesome-reporter

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

Not able to skip screenshot copying in windows os - https://github.com/LironEr/cypress-mochawesome-reporter/issues/52 #91

Closed AspireSytemsINC closed 1 year ago

AspireSytemsINC commented 2 years ago

Environment

- OS: Windows 10
- Node: 16.13.1
- cypress-mochawesome-reporter: 3.2.0
- cypress: 9.6.0

What happened?

Not able to skip screenshot copying in windows os when source and target of screenshot folder is same. Below is the error message -

An error was thrown in your plugins file while executing the handler for the after:run event.

The error we received was:

Error: Cannot copy 'C:\Users\XXXXXXX\XXXXXX\XXXXXX\cypress\results\AutomationReport_Mochawsome' to a subdirectory of itself, 'cypress\results\AutomationReport_Mochawsome\screenshots'. at C:\Users\XXXXXXX\XXXXXX\XXXXXX\node_modules\cypress-mochawesome-reporter\node_modules\fs-extra\lib\util\stat.js:60:17 at processTicksAndRejections (node:internal/process/task_queues:83:21)

Config file

Cypreess.json
====

{
    "projectId": "XXXXXXX",
    "env":    {
      "host" : "XXXXXXX"      
    },

  "reporter": "cypress-multi-reporters",
  "reporterOptions": {
    "reporterEnabled": "@reportportal/agent-js-cypress, cypress-mochawesome-reporter",   
    "reportportalAgentJsCypressReporterOptions": {
    "autoMerge": "false",
    "mode" : "trace",
    "debug": true,
    "restClientConfig":{
      "timeout":3600000
    },
    "endpoint": "http://localhost:8080/api/v1",
    "token": "XXXXXXXXXXXXXXXX",
    "launch": "XXXXXXXXXXXXXX",
    "project": "XXXXXXXXXXXXX",
    "description": "XXXXXXX"
 },
 "cypressMochawesomeReporterReporterOptions": {
      "reportDir": "cypress/results/AutomationReport_Mochawsome",
      "charts": true,
      "saveJson": true,
      "embeddedScreenshots": false,
      "inlineAssets": true,
      "skipCopyingScreenshots": true,
      "reportPageTitle": "CypressTests"     
    }
  },
  "screenshotsFolder" : "cypress/results/AutomationReport_Mochawsome",
  "screenshotOnRunFailure":false,
  "trashAssetsBeforeRuns" : true,
  "overwrite": true,
  "video" : false,
  "chromeWebSecurity": false,

  "author": "XXXXXXXXXXXX",
  "license": "XXXXXXXXXX", 

 "retries": {    
    "runMode": 0,   
    "openMode": 0
  }, 

  "pageLoadTimeout" : 120000,
  "numTestsKeptInMemory":0
}

Relevant log output

An error was thrown in your plugins file while executing the handler for the after:run event.

The error we received was:

Error: Cannot copy 'C:\Users\XXXXXXX\XXXXXX\XXXXXX\cypress\results\AutomationReport_Mochawsome' to a subdirectory of itself, 'cypress\results\AutomationReport_Mochawsome\screenshots'.
    at C:\Users\XXXXXXX\XXXXXX\XXXXXX\node_modules\cypress-mochawesome-reporter\node_modules\fs-extra\lib\util\stat.js:60:17
    at processTicksAndRejections (node:internal/process/task_queues:83:21)

Anything else?

Referred this issue, as per the PR, the issue is fixed but still not working in windows - https://github.com/LironEr/cypress-mochawesome-reporter/issues/52

LironEr commented 2 years ago

I tried to replicate the bug with cypress v10 and everything works as expected.

Can you try to upgrade?

AspireSytemsINC commented 2 years ago

I tried to replicate the bug with cypress v10 and everything works as expected.

Can you try to upgrade?

Okay, but did you try to reproduce in a windows machine?

LironEr commented 2 years ago

I tried to replicate the bug with cypress v10 and everything works as expected. Can you try to upgrade?

Okay, but did you try to reproduce in a windows machine?

Yeah

stale[bot] commented 2 years 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.