qase-tms / qase-javascript

Qase TMS JavaScript SDK
https://developers.qase.io
47 stars 38 forks source link

Newman: TypeError: Cannot read properties of undefined (reading 'status') #617

Closed JungPham closed 1 month ago

JungPham commented 1 month ago

Hi team,

I have installed newman and newman-reporter-qase with newest version:

npm install -g newman newman-reporter-qase@beta                                                                                        npm warn deprecated har-validator@5.1.5: this library is no longer supported
npm warn deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.

changed 187 packages in 9s

16 packages are looking for funding
  run `npm fund` for details

npm list -g | grep newman
├── newman-reporter-qase@2.0.0-beta.1
├── newman@6.1.3

However, when I run tests with the command:

newman run "Livechat API Tests.postman_collection.json" \
--environment "https://api.getpostman.com/environments/$environmentId?apikey=$PM_API_KEY" \
--folder 'Get NEW conversation list' \
-r qase

I have gotten issues, the same problem with #576. Could you please help me check this issue?

/opt/hostedtoolcache/node/20.14.0/x64/lib/node_modules/newman-reporter-qase/node_modules/qase-javascript-commons/dist/qase.js:300
        this.logger.log(resultLogMap[test.execution.status](test));
                                                    ^

TypeError: Cannot read properties of undefined (reading 'status')
    at QaseReporter.logTestItem (/opt/hostedtoolcache/node/20.14.0/x64/lib/node_modules/newman-reporter-qase/node_modules/qase-javascript-commons/dist/qase.js:300:53)
    at QaseReporter.addTestResult (/opt/hostedtoolcache/node/20.14.0/x64/lib/node_modules/newman-reporter-qase/node_modules/qase-javascript-commons/dist/qase.js:164:18)
    at EventEmitter.<anonymous> (/opt/hostedtoolcache/node/20.14.0/x64/lib/node_modules/newman-reporter-qase/dist/reporter.js:111:31)
    at EventEmitter.emit (node:events:531:35)
    at callbacks.<computed> [as item] (/opt/hostedtoolcache/node/20.14.0/x64/lib/node_modules/newman/lib/run/index.js:213:34)
    at PostmanCollectionRun.<anonymous> (/opt/hostedtoolcache/node/20.14.0/x64/lib/node_modules/newman/node_modules/postman-runtime/lib/runner/extensions/item.command.js:264:47)
    at apply (/opt/hostedtoolcache/node/20.14.0/x64/lib/node_modules/newman/node_modules/lodash/lodash.js:489:27)
    at /opt/hostedtoolcache/node/20.14.0/x64/lib/node_modules/newman/node_modules/lodash/lodash.js:9541:36
    at /opt/hostedtoolcache/node/20.14.0/x64/lib/node_modules/newman/node_modules/lodash/lodash.js:4943:15
    at Function.<anonymous> (/opt/hostedtoolcache/node/20.14.0/x64/lib/node_modules/newman/node_modules/lodash/lodash.js:9540:7)
    at apply (/opt/hostedtoolcache/node/20.14.0/x64/lib/node_modules/newman/node_modules/lodash/lodash.js:490:27)
    at Function.invokeMap (/opt/hostedtoolcache/node/20.14.0/x64/lib/node_modules/newman/node_modules/lodash/lodash.js:6627:16)
    at Instruction.<anonymous> (/opt/hostedtoolcache/node/20.14.0/x64/lib/node_modules/newman/node_modules/postman-runtime/lib/runner/instruction.js:148:48)
    at PostmanCollectionRun.<anonymous> (/opt/hostedtoolcache/node/20.14.0/x64/lib/node_modules/newman/node_modules/postman-runtime/lib/runner/extensions/event.command.js:579:17)
    at /opt/hostedtoolcache/node/20.14.0/x64/lib/node_modules/newman/node_modules/async/dist/async.js:252:13
    at wrapper (/opt/hostedtoolcache/node/20.14.0/x64/lib/node_modules/newman/node_modules/async/dist/async.js:273:20)

Thank you

gibiw commented 1 month ago

@JungPham thanks for noticing! Try to update newman-reporter-qase to 2.0.0-beta.2. If that doesn’t help, then enable debug logs and send them to us.

JungPham commented 1 month ago

it works, thank you so much for your support @gibiw

JungPham commented 1 month ago

Hi @gibiw, Could you please help me upgrade qase-javascript-commons in newman-reporter-qase to 2.0.9, I also need to use feature add rootSuite for test (env variable: QASE_ROOT_SUITE)

gibiw commented 1 month ago

Hi @JungPham, run the command: npm install qase-javascript-commons@2.0.9

JungPham commented 1 month ago

Hi @JungPham, run the command: npm install qase-javascript-commons@2.0.9

Thank you for your reply, @gibiw to install newman and newman-reporter-qase with commands:

npm install -g newman@6.1.3 newman-reporter-qase@2.0.0-beta.2 qase-javascript-commons@2.0.9
npm install qase-javascript-commons@2.0.9

and add QASE_ROOT_SUITE to environment variables but new test cases are not uploaded to test plan on QASE.

gibiw commented 1 month ago

@JungPham can you show your package-lock.json file? Also enable debug logs and send them to us.

JungPham commented 1 month ago

My mistake, after installing qase-javascript-commons@2.0.9 the issue is solved from my side. Thank you very much for your support. @gibiw