Reputation: 83
I use a custom browser provider - saucelabs - I'd like my custom reporter to know in which remote browser it ran so I can properly correlate the saucelabs video with a failed test. This obviously is only an issue with concurrency > 1 :)
If a test fails which remote browser was it run in??? thanks!! Mark
Upvotes: 1
Views: 150
Reputation: 766
The reportTestDone
method of a reporter plugin is called after a test is done in all browsers. If testRunInfo.errs
array is empty, it means that the test passed in all browsers. If it is non-empty, every item has a userAgent
property, telling in which browser the error occurred.
So, if you need a list of browsers in which the test fails, you could use something like this: _.chain(testRunInfo.errs).map('userAgent').uniq().value()
.
I didn't find this in the official documentation, though.
Upvotes: 1