DamianOsipiuk / testcafe-reporter-testrail

Testcafe reporter plugin that automatically publishes test run details to the TestRail system.
MIT License
6 stars 5 forks source link

exception when trying update results for non-exising ID in testrail #43

Open raga-varicent opened 2 years ago

raga-varicent commented 2 years ago

Issue:

test1 id exists in test rail, test2 id (C5215) does not exist or has been removed. when the results pushed to testrail, the below exception happens and no results are pushed to testrail. It would be better if there is check for testcase exists. if it does exit, then no results need to be pushed for that.

if you can provide a fix for this, that would be great

testcafe-reporter-testrail version = 0.11.1 or older versions.

test.meta({CID: 'C520'})('test1', async (t) => {

});

test.meta({CID: 'C5215'})('test2', async (t) => {

});

The "reporter" option from the configuration file will be ignored. [TestRail] All TestRail mappings should be valid. Following test case id does not exist in TestRail: 5215. [TestRail] Error during API request [TestRail] Sending report to TestRail failed { url: 'https://symonqa.testrail.io/index.php?/api/v2/update_run/44', status: 400, message: { error: 'Field :case_ids contains unrecognized case IDs.' } } ERROR The "reportTaskDone" method of the "testrail" reporter produced an uncaught error. Error details: undefined

DamianOsipiuk commented 2 years ago

Hi, If we change this loop to actually filter caseIds in addition to logging the warning, this error would go away. https://github.com/DamianOsipiuk/testcafe-reporter-testrail/blob/main/src/index.ts#L238

Do you feel like contributing the change?

raga-varicent commented 2 years ago

yeah, i should be able to fix it. I will test my change and send a PR.