multiple-cucumber-html-reporter icon indicating copy to clipboard operation
multiple-cucumber-html-reporter copied to clipboard

Example doesn't work - missing directory- no instructions - no README

Open bartonhammond opened this issue 1 year ago • 0 comments

Environment (please complete the following information):

  • multiple-cucumber-html-reporter: [e.g. 1.10.0]
  • Node.js version: v20.10.0
  • NPM version: 10.2.3
  • Platform name and version: mac sonoma 14.2.1
  • Cucumber version: [e.g. 4.2.0]

Config of multiple-cucumber-html-reporter Using the provided example

Describe the bug Example fails w/

To Reproduce Steps to reproduce the behavior:

  • clone repo
  • cd examples/cypress
  • npm run test
An error was thrown in your plugins file while executing the handler for the after:run event.

The error we received was:

Error: ENOENT: no such file or directory, open './reports/generated/results.json'
    at Object.openSync (node:fs:581:18)
    at Object.writeFileSync (node:fs:2342:35)
    at createReportJsonMeta (/Users/bartonhammond/projects/cypress/multiple-cucumber

Expected behavior A README that explains what to do. I only see the package.json. There are no instructions about creating a directory or anything.

Log

npm run test

> [email protected] test
> cypress run --browser chrome --headed --reporter json


DevTools listening on ws://127.0.0.1:57871/devtools/browser/9fb68d73-d677-404c-9ef0-40aeef756118
2024-02-24 13:45:12.576 Cypress[95728:12830810] WARNING: Secure coding is not enabled for restorable state! Enable secure coding by implementing NSApplicationDelegate.applicationSupportsSecureRestorableState: and returning YES.

================================================================================

  (Run Starting)

  ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
  │ Cypress:        13.2.0                                                                         │
  │ Browser:        Chrome 121                                                                     │
  │ Node Version:   v20.10.0 (/Users/bartonhammond/.asdf/installs/nodejs/20.10.0/bin/node)         │
  │                 9m                                                                             │
  │ Specs:          2 found (gmail/gmail.feature, google/google.feature)                           │
  │ Searched:       cypress/e2e/**/*.feature                                                       │
  └────────────────────────────────────────────────────────────────────────────────────────────────┘


────────────────────────────────────────────────────────────────────────────────────────────────────
                                                                                                    
  Running:  gmail/gmail.feature                                                             (1 of 2)
{
  "stats": {
    "suites": 1,
    "tests": 1,
    "passes": 1,
    "pending": 0,
    "failures": 0,
    "start": "2024-02-24T19:45:15.681Z",
    "end": "2024-02-24T19:45:22.088Z",
    "duration": 6407
  },
  "tests": [
    {
      "title": "Gmail",
      "fullTitle": "Gmail Opening Gmail",
      "duration": 3219,
      "currentRetry": 0,
      "err": {}
    }
  ],
  "pending": [],
  "failures": [],
  "passes": [
    {
      "title": "Gmail",
      "fullTitle": "Gmail Opening Gmail",
      "duration": 3219,
      "currentRetry": 0,
      "err": {}
    }
  ]
}
  (Results)

  ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
  │ Tests:        1                                                                                │
  │ Passing:      1                                                                                │
  │ Failing:      0                                                                                │
  │ Pending:      0                                                                                │
  │ Skipped:      0                                                                                │
  │ Screenshots:  0                                                                                │
  │ Video:        false                                                                            │
  │ Duration:     6 seconds                                                                        │
  │ Spec Ran:     gmail/gmail.feature                                                              │
  └────────────────────────────────────────────────────────────────────────────────────────────────┘


────────────────────────────────────────────────────────────────────────────────────────────────────
                                                                                                    
  Running:  google/google.feature                                                           (2 of 2)
{
  "stats": {
    "suites": 1,
    "tests": 1,
    "passes": 1,
    "pending": 0,
    "failures": 0,
    "start": "2024-02-24T19:45:23.249Z",
    "end": "2024-02-24T19:45:26.658Z",
    "duration": 3409
  },
  "tests": [
    {
      "title": "Google",
      "fullTitle": "Google Opening Google",
      "duration": 1669,
      "currentRetry": 0,
      "err": {}
    }
  ],
  "pending": [],
  "failures": [],
  "passes": [
    {
      "title": "Google",
      "fullTitle": "Google Opening Google",
      "duration": 1669,
      "currentRetry": 0,
      "err": {}
    }
  ]
}
  (Results)

  ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
  │ Tests:        1                                                                                │
  │ Passing:      1                                                                                │
  │ Failing:      0                                                                                │
  │ Pending:      0                                                                                │
  │ Skipped:      0                                                                                │
  │ Screenshots:  0                                                                                │
  │ Video:        false                                                                            │
  │ Duration:     3 seconds                                                                        │
  │ Spec Ran:     google/google.feature                                                            │
  └────────────────────────────────────────────────────────────────────────────────────────────────┘

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

The error we received was:

Error: ENOENT: no such file or directory, open './reports/generated/results.json'
    at Object.openSync (node:fs:581:18)
    at Object.writeFileSync (node:fs:2342:35)
    at createReportJsonMeta (/Users/bartonhammond/projects/cypress/multiple-cucumber-html-reporter/examples/cypress/cypress.config.js:7:6)
    at Object.handler (/Users/bartonhammond/projects/cypress/multiple-cucumber-html-reporter/examples/cypress/cypress.config.js:31:7)
    at invoke (/Users/bartonhammond/Library/Caches/Cypress/13.2.0/Cypress.app/Contents/Resources/app/packages/server/lib/plugins/child/run_plugins.js:183:18)
    at /Users/bartonhammond/Library/Caches/Cypress/13.2.0/Cypress.app/Contents/Resources/app/packages/server/lib/plugins/util.js:59:14
    at tryCatcher (/Users/bartonhammond/Library/Caches/Cypress/13.2.0/Cypress.app/Contents/Resources/app/node_modules/bluebird/js/release/util.js:16:23)
    at Function.Promise.attempt.Promise.try (/Users/bartonhammond/Library/Caches/Cypress/13.2.0/Cypress.app/Contents/Resources/app/node_modules/bluebird/js/release/method.js:39:29)
    at Object.wrapChildPromise (/Users/bartonhammond/Library/Caches/Cypress/13.2.0/Cypress.app/Contents/Resources/app/packages/server/lib/plugins/util.js:58:23)
    at RunPlugins.execute (/Users/bartonhammond/Library/Caches/Cypress/13.2.0/Cypress.app/Contents/Resources/app/packages/server/lib/plugins/child/run_plugins.js:164:21)
    at EventEmitter.<anonymous> (/Users/bartonhammond/Library/Caches/Cypress/13.2.0/Cypress.app/Contents/Resources/app/packages/server/lib/plugins/child/run_plugins.js:56:12)
    at EventEmitter.emit (node:events:514:28)
    at process.<anonymous> (/Users/bartonhammond/Library/Caches/Cypress/13.2.0/Cypress.app/Contents/Resources/app/packages/server/lib/plugins/util.js:33:22)
    at process.emit (node:events:514:28)
    at emit (node:internal/child_process:951:14)
    at processTicksAndRejections (node:internal/process/task_queues:83:21)

cypress$ node --version
v20.10.0
cypress$ npm -v
10.2.3
cypress$ cypress

Additional context I tried this: *. create reports\generated and rerun npm run test log:


Your configFile threw an error from: cypress.config.js

We stopped running your tests because your config file crashed.

ReferenceError: cy is not defined
    at /Users/bartonhammond/projects/cypress/multiple-cucumber-html-reporter/examples/cypress/cypress.config.js:38:11
    at /Users/bartonhammond/Library/Caches/Cypress/13.2.0/Cypress.app/Contents/Resources/app/packages/server/node_modules/graceful-fs/graceful-fs.js:209:16
    at /Users/bartonhammond/Library/Caches/Cypress/13.2.0/Cypress.app/Contents/Resources/app/packages/server/node_modules/graceful-fs/graceful-fs.js:209:16
    at FSReqCallback.oncomplete (node:fs:189:23)

So I edit the config.js file and changed cy.log("Issue in the file reading"); to console.log("Issue in the file reading");

Reran and see that message ("Issue in the ....")

I see a cucumber-messages.ndjson file in root.
I'm lost as to what is needed

bartonhammond avatar Feb 24 '24 22:02 bartonhammond