gkushang/cucumber-html-reporter

Screenshot file names too long

aschepp opened this issue · 1 comments

Hello,

with our acceptance tests we have rather long method names, so we run into a file length problem with the screenshot names. See error below:

Starting: Publish Cucumber Report
==============================================================================
Task         : Publish Cucumber Report
Description  : Publish Cucumber Report
Version      : 1.0.7
Author       : Maciej Maciejewski
Help         : Replace with markdown to show in help
==============================================================================
/__t/node/12.22.1/x64/bin/npm install
added 22 packages from 53 contributors and audited 22 packages in 1.367s
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN reporter No description
npm WARN reporter No repository field.
npm WARN reporter No license field.

found 0 vulnerabilities

Found 1 matching /__w/1/s/XXXX-acceptancetests/XXXXXX/cucumber pattern
Processing /__w/1/s/XXXX-acceptancetests/XXXXXX/cucumber/cucumber.json
Saving modified report as /__w/1/s/XXXX-acceptancetests/XXXXXX/cucumber/cucumber.json
/__t/node/12.22.1/x64/bin/node script.js
internal/fs/utils.js:269
    throw err;
    ^

Error: ENAMETOOLONG: name too long, open '/__w/1/s/XXXX-acceptancetests/XXXXXX/XXXXXXXXX/screenshots/XXXXXXX_XXX_BXXXXXXX_XXX_FXXXXXXXXXXXX_DXX_XXX_IXXXX_XXXXXXXXXX_AXX-NXXXXX_XXXXXX3_XXX_XXX_XXX_BXXXXXXX-AXXXXXX_XXX_XXX_XXX_XXXXX_XXX_EXXX_XXXXXXX_VXXXX_XXXXX_XXX_XXXXX_XXXXX_X_XXXXX_SXXXXX_XX_XXXX_XX_IXXXX_BXXXXXXX-AXXXXXX_XXXXXXX_XXXXXX_SXX_XXXX_XXXXXXX_XXX__4466.png'
    at Object.openSync (fs.js:462:3)
    at Object.writeFileSync (fs.js:1384:35)
    at /__w/_tasks/PublishCucumberReport_83c082c0-5032-11ea-8fab-XXXXXXXXXXXX/1.0.7/reporter/node_modules/cucumber-html-reporter/lib/reporter.js:272:40
    at Array.forEach (<anonymous>)
    at /__w/_tasks/PublishCucumberReport_83c082c0-5032-11ea-8fab-XXXXXXXXXXXX/1.0.7/reporter/node_modules/cucumber-html-reporter/lib/reporter.js:238:41
    at Array.forEach (<anonymous>)
    at /__w/_tasks/PublishCucumberReport_83c082c0-5032-11ea-8fab-XXXXXXXXXXXX/1.0.7/reporter/node_modules/cucumber-html-reporter/lib/reporter.js:236:31
    at Array.forEach (<anonymous>)
    at /__w/_tasks/PublishCucumberReport_83c082c0-5032-11ea-8fab-XXXXXXXXXXXX/1.0.7/reporter/node_modules/cucumber-html-reporter/lib/reporter.js:221:30
    at Array.forEach (<anonymous>) {
  errno: -36,
  syscall: 'open',
  code: 'ENAMETOOLONG',
  path: '/__w/1/s/paco-acceptancetests/target/cucumber/screenshots/XXXXXXX_XXX_BXXXXXXX_XXX_FXXXXXXXXXXXX_DXX_XXX_IXXXX_XXXXXXXXXX_AXX-NXXXXX_XXXXXX3_XXX_XXX_XXX_BXXXXXXX-AXXXXXX_XXX_XXX_XXX_XXXXX_XXX_EXXX_XXXXXXX_VXXXX_XXXXX_XXX_XXXXX_XXXXX_X_XXXXX_SXXXXX_XX_XXXX_XX_IXXXX_BXXXXXXX-AXXXXXX_XXXXXXX_XXXXXX_SXX_XXXX_XXXXXXX_XXX__4466.png'
}
##[warning]Error: Failed to run script
Finishing: Publish Cucumber Report

you might have to trim the names yourself until this is fixed