Search code examples
protractorbrowserstack

BrowserStack + Protractor getting the name of the tests to show up as session ID


I know that you could use browserstack before protractor 3.0 but they have added official support in 3.0 . I haven't been able to try that out yet so maybe that's the answer to my question? Currently don't have the ability to upgrade so if that's my answer then I will go through the proper channels to make that happen.

The problem I'm having with browser stack is that it names all the sessions random hashes. So I may have a suite of tests and I have no way to tell which session is which test. You can manually change the capabilities.name but then everything will have that name.

I know when I use saucelabs it will name everything after the name of the test file. so for example it will be sometest.js . I don't know if this is something protractor is doing or some node-module we're using that is doing the work behind the scenes and I don't know?

I just want to know how I can run my suite that runs all my smoketests and names each browserstack session after the actual name of the tests in the suite.

here is an example of what things look like on browserstack. I did manually set the capabilities.name to mytest for a few sessions.

enter image description here

here is how they look with sauce labs

enter image description here

Also here is my package.json file in case any of these modules might be making saucelabs name the jobs after the test file name

{
  "name": "protractor",
  "version": "1.0.0",
  "description": "Protractor protype",
  "main": "Gruntfile.js",
  "dependencies": {
    "grunt-sauce-tunnel": "^0.2.1",
    "jasmine-reporters": "^2.1.1",
    "lodash": "^3.2.0",
    "protractor": "2.5.1",
    "require-all": "2.0.0"
  },
  "devDependencies": {
    "chalk": "^1.1.1",
    "grunt": "^0.4.5",
    "grunt-env": "^0.4.2",
    "grunt-protractor-runner": "3.0.0",
    "grunt-sauce-connect-launcher": "^0.3.0",
    "jasmine-spec-reporter": "^2.2.3",
    "request-promise": "^1.0.2",
    "selenium-webdriver": "2.48.2",
    "xlsx-json": "^0.1.0"
  },
  "scripts": {
    "install": "node node_modules/protractor/bin/webdriver-manager update",
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "repository": {
    "type": "git",
    "url": "git:user/rwolfe/protractor"
  },
  "author": "",
  "license": "ISC"
}

Solution

  • So I don't know if this was due to upgrading to protractor 3.0 or not but apparently in the conf.js I saw that for sauce labs we were setting

    exports.config.capabilities.name = " ";
    

    and when I did that for browserstack now the names of the test show up how I would expect as below.

    enter image description here