allure-framework / allure-js

Allure integrations for JavaScript test frameworks
https://allurereport.org/
Apache License 2.0
225 stars 122 forks source link

Running with Newman 6.2.0 raises: error: Cannot read properties of undefined (reading 'exec') #1114

Closed thokuest closed 2 months ago

thokuest commented 2 months ago

Describe the bug Postman collection execution with Newman gets stuck with error: Cannot read properties of undefined (reading 'exec'). Can be reproduced with recently released newman 6.2.0, and newman-reporter-allure 3.0.0-beta.10 as well as 2.15.1.

To Reproduce Steps to reproduce the behavior:

  1. Install Newman 6.2.0 and Allure Reporter 3.0.0-beta.10
    npm install -g newman-reporter-allure@3.0.0-beta.10 newman@6.2.0
  2. Run Postman collection with Newman containing the following empty pre-request/test code block (Exec.postman_collection.json):
    "event": [
      {
          "listen": "test",
          "script": {
              "exec": [
                  ""
              ],
              "type": "text/javascript",
              "packages": {}
          }
      },
      {
          "listen": "prerequest",
          "script": {
              "exec": [
                  ""
              ],
              "type": "text/javascript",
              "packages": {}
          }
      }
    ]

Expected behavior Collection is executed without error.

Desktop (please complete the following information):

> npm -v
9.5.1

> node -v
v18.16.0

> npm list -g newman-reporter-allure
newman-reporter-allure@3.0.0-beta.10

> npm list -g newman
newman@6.2.0

Additional context The issue was noticed on CI, build got stuck after receiving the error and went into timeout. Not sure whether this is a bug in the reporter, or Newman.

kyra-ohare commented 2 months ago

My team has fixed it by rolling newman back to v6.1.3

pedrHenrique commented 2 months ago

I was facing the same issue. Thank you very much!

jval-sellsy commented 2 months ago

Same here. Need to rollback to V6.1.3

Following the thread to see if a fix is push

rdzberisha commented 2 months ago

Same issue here as well. Fixed by rolling back to @6.1.3