Open tpronk opened 3 years ago
@tpronk the "name" capability you are referring to would allow you to set a name for the session on the browserstack dashboard and not in the console logs.
Hey @RohanImmanuel, thanks for your reply!
Yes, the line you and I mention at the bottom of my post can be used to set the name of a session on browserstack. The workaround I'm thinking of will use that and then obtain the name I'd like to have via the browserstack REST API.
If I set the displayName property of a customLauncher, I would have expected to end up in my local logs; if I use the chrome-launcher, for example, displayName ends up as name and fullname in my JSON logs, but not if I use the karma-browserstack-launcher.
I forked the repo and applied my workaround. It's not super-elegant, but it works :)
Hi!
Context I'm using BrowserStack both for e2e testing and unit testing. I'd like use a common naming scheme for identifying platforms in the logs of both e2e and unit tests. To achieve this on the karma side, I'm setting the
displayName
property of elements incustomLaunchers
in the karma configuration (see this page for reference). I'm logging the test results via karma-json-reporter.My issue When I run tests locally, I see the displayName showing up in my logs as the name property of a browser. Below are some config and output snippets as illustration...
When I run tests via the karma-browserstack-launcher, I don't get displayName in my logs. Below another config and output snippet to illustrate what I get instead.
What I tried so far I tried adjusting your
index.js
. I found out that I could obtain the displayName as a property ofargs
inthis.start
and use it to set the name used for the logs on BrowserStack by adjusting this line. I didn't manage to get it into the JSON logs though.Help :) Could you give me some pointers in how to get the displayName in the logs?
Thanks! Thomas