Configure Polymer web-component-tester to use a Selenium Grid server
Asked Answered
C

3

9

I need to configure the Polymer web-component-tester to use a Selenium Grid running at http://jenkins.myapp.corp.web:4444/wd/hub so I can run my tests on Jenkins. What is the Grunt config for this? I guessing something like this:

'wct-test': {
  local: {
    options: {
      activeBrowsers: [{
        browserName: 'chrome',
        url: 'http://jenkins.myapp.corp.web:4444/wd/hub'
      }]
    }
  }
}
Cordless answered 6/2, 2015 at 20:9 Comment(0)
C
4

It turns out there was a bug with web-component-tester that has been fixed in the latest release. We ended up getting it working with our grid using this config:

var os = require('os');
...

'wct-test': {
  local: {
    options: {
      remote: false,
      activeBrowsers: [{
        browserName: "chrome",
        url: "http://jenkins.myapp.corp.web:4444/wd/hub"
      }],
      webserver: {
        hostname: os.hostname()
      }
    }
  }
}
Cordless answered 5/3, 2015 at 20:3 Comment(0)
W
2

It seems that you can modify your wct.conf.js and set your grid configuration:

    module.exports = {
            // See https://github.com/Polymer/web-component-tester/blob/master/runner/config.js#L47-54
            activeBrowsers: [
              {
                // Accepts anything wd does: https://github.com/admc/wd#browser-initialization
                url: 'http://user:[email protected]/wd/hub',
                // ... any other capabilities you like:
                browserName: 'theBrowser',
              }
            ],
            plugins: {
              local: false,
              sauce: false,
            }
          };
Warfarin answered 25/2, 2015 at 10:7 Comment(0)
A
0

The correct configuration for wct.conf.json should be as follows. You should change url of the sample to your selenium grid url.

{
  "....":"....",
  "activeBrowsers": [{
    "browserName": "chrome",
    "url": "http://selenium-hub-selenium.apps.com.tr/wd/hub"
  }],
  "plugins": {
    "local": {
      "disabled": true
    },
    "sauce":{
      "disabled": true
    }
  }
}
Algology answered 13/11, 2019 at 12:51 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.