Closed bksglatz closed 1 year ago
There's nothing built in, but here's a dirty tunnel:
// jasmine-browser.json
{
"reporters": ["./browserInfoReporter.js"],
// ...
}
// spec/reportBrowserSpec.js
describe('Reporting browser info', function() {
it('reports the user agent', function() {
setSuiteProperty('browser', navigator.userAgent.toString());
});
});
// browserInfoReporter.js
class BrowserInfoReporter {
suiteDone(event) {
if (event.properties?.browser) {
console.log('Browser:', event.properties.browser);
}
}
};
module.exports = BrowserInfoReporter;
Thx. That will do it.
I wonder if there is any interface (or maybe a dirty tunnel ;)) that would allow me to get information about the browser running the tests into my custom reporter. Any advice would be appreciated :)