billylam / wdio-wdiov5testrail-reporter

https://www.npmjs.com/package/wdio-wdiov5testrail-reporter
MIT License
6 stars 8 forks source link

For some reason start return Cannot read property 'id' of undefined for run id from getRuns #8

Closed djamknacker closed 2 years ago

djamknacker commented 2 years ago

This line options.runId = JSON.parse(response.getBody())[0].id;

Returns this error: ERROR @wdio/cli:utils: Error in onCompleteHook: TypeError: Cannot read property 'id' of undefined at /Users/autotests/tests/node_modules/wdio-wdiov5testrail-reporter/src/util.js:113:56

I can see that there is a body (buffer) being returned by getRuns so I guess it is not parsing it correctly

billylam commented 2 years ago

Thanks for reporting the issue. TestRail changed the data shape for some of their api calls a few months ago, and I missed one that is called when using useLatestRunId. This should be fixed in 1.0.30, but reopen if you are still seeing an issue.

djamknacker commented 2 years ago

@billylam thanks for fix. Can confirm it works now