Closed spencerlavallesonos closed 1 year ago
To check, is the issue that the results and comments section should report 3 passes and 1 failure? The overall result is intended to fail if any fail.
Closed while awaiting info.
@billylam That would be my assumption that not all 4 would be reported as failures as according to WDIO not all 4 of those tests failed, only the single locale. IMO it seems that reporting all 4 as failed is reporting the test status incorrectly.
Please let me know if you need any other info :smile:
Unfortunately, I no longer use webdriverio or have a TestRail instance so won't be able to test a fix.
If you use v8+, it looks like there is now an official package.
If you are not, I believe this can be fixed by changing the logic in the block at https://github.com/billylam/wdio-wdiov5testrail-reporter/blob/master/src/util.js#L127. I THINK the fix would be to change to something like
if (testCaseIds.length !== new Set(testCaseIds).size) {
const failures = results
.filter((result) => result.status_id !== 1);
const successes = results.filter((result => result.status_id === 1))
.map((result) => result.case_id);
results = successes.concat(failures);
}
If you find this helps, let me know so I can create a commit or feel free to submit a pull request yourself.
Hey Billy thanks so much, when I have some free time in a few weeks to pick this back up I'll investigate and give this a go. Thank you!
When I pass multiple CaseIDs via the
it
block, the result posted to testrail is an AND of all test case results (E.g. all true results in TestRail report showing all true, any failed = all failed, all failed = all failed).Image showing test output + testrail's test case test results.
Spec used: (Note: the forEach is just looping through
en-us, es-us, en-ca, and fr-ca
, andCommand
is just a helper class)