ervirendersingh / newman-reporter-allure

A newman reporter for generating nice and clean report using Allure-js framework
16 stars 27 forks source link

Getting TypeError: Cannot read property 'method' of undefined #20

Open nuskyazhar opened 2 years ago

nuskyazhar commented 2 years ago

I am trying to execute newman tests and generate allure reports . I am using the latest 1.0.7 version of newman-reporter-allure

newman run postman_collection.json -k -e postman_environment.json -r allure --reporter-allure-export /abc/allure-results

However I am getting an error :

build 14-Dec-2021 09:51:50 ### Starting Execution For - XYZ ### error 14-Dec-2021 09:54:00 __postmanruntime_fatal_debug: instruction.execute callback called twice error 14-Dec-2021 09:54:00 TypeError: Cannot read property 'method' of undefined error 14-Dec-2021 09:54:00 at AllureReporter.item (/usr/local/lib/node_modules/newman-reporter-allure/index.js:311:59) error 14-Dec-2021 09:54:00 at EventEmitter.emitter.on (/usr/local/lib/node_modules/newman-reporter-allure/index.js:22:103) error 14-Dec-2021 09:54:00 at EventEmitter.emit (/usr/local/lib/node_modules/newman/node_modules/eventemitter3/index.js:203:33) error 14-Dec-2021 09:54:00 at Function.callbacks.(anonymous function) [as item] (/usr/local/lib/node_modules/newman/lib/run/index.js:213:34) error 14-Dec-2021 09:54:00 at PostmanCollectionRun.<anonymous> (/usr/local/lib/node_modules/newman/node_modules/postman-runtime/lib/runner/extensions/item.command.js:253:47) error 14-Dec-2021 09:54:00 at apply (/usr/local/lib/node_modules/newman/node_modules/lodash/lodash.js:489:27) error 14-Dec-2021 09:54:00 at /usr/local/lib/node_modules/newman/node_modules/lodash/lodash.js:9541:36 error 14-Dec-2021 09:54:00 at /usr/local/lib/node_modules/newman/node_modules/lodash/lodash.js:4943:15 error 14-Dec-2021 09:54:00 at Function.<anonymous> (/usr/local/lib/node_modules/newman/node_modules/lodash/lodash.js:9540:7) error 14-Dec-2021 09:54:00 at apply (/usr/local/lib/node_modules/newman/node_modules/lodash/lodash.js:490:27) error 14-Dec-2021 09:54:00 at Function.invokeMap (/usr/local/lib/node_modules/newman/node_modules/lodash/lodash.js:6627:16) error 14-Dec-2021 09:54:00 at Instruction.<anonymous> (/usr/local/lib/node_modules/newman/node_modules/postman-runtime/lib/runner/instruction.js:148:48) error 14-Dec-2021 09:54:00 at PostmanCollectionRun.<anonymous> (/usr/local/lib/node_modules/newman/node_modules/postman-runtime/lib/runner/extensions/event.command.js:526:17) error 14-Dec-2021 09:54:00 at /usr/local/lib/node_modules/newman/node_modules/postman-runtime/node_modules/async/dist/async.js:1140:9 error 14-Dec-2021 09:54:00 at /usr/local/lib/node_modules/newman/node_modules/postman-runtime/node_modules/async/dist/async.js:473:16 error 14-Dec-2021 09:54:00 at replenish (/usr/local/lib/node_modules/newman/node_modules/postman-runtime/node_modules/async/dist/async.js:1006:25)

But it works fine if I use htmlextr like newman run postman_collection.json -k -e postman_environment.json -r htmlextra --reporter-htmlextra-export /abc/ahtmlextrareport.html

Note: I suspect this happens only when tests in the collection fail. However I could not verify that

schepil-ledger commented 2 years ago

Have the same issue time to time.

David-Kozina-SA commented 2 years ago

I have encountered this very same error while using --timeout-request (if and only if the request is actually timeouted), but I see you are not using it. But maybe you, @schepil-ledger, are using the timeout? In that case not using timeout would solve the problem. Well in any case I opened a new issue #24, because this one does not consider the --timeout-request option.

schepil-ledger commented 2 years ago

NO I don't use timeouts in my collections, only setNextRequest for example.

vovsemenv commented 1 year ago

Hello, this repo will be archived. New versions of the newman-reporter-allure will be maintained in the allure framework repo. https://github.com/allure-framework/allure-js

This issue is fixed in the newman-reporter-allure@2.0.0-beta.21