Protractor with selenium grid

廉价感情. 提交于 2019-12-10 23:34:32

问题


Could anyone please advice how to setup protractor to run tests remotely ?

My protractor.conf.js:

exports.config = {
    chromeOnly: true,
    chromeDriver: '../node_modules/.bin/chromedriver',
    framework: 'jasmine2',
    capabilities: {
        'browserName': 'chrome',
        shardTestFiles: true,
        maxInstances: 3
    },
    specs: ['../e2e/protractor/spec/*.js'],
    jasmineNodeOpts: {
        showColors: true,
        defaultTimeoutInterval: 30000
    },
    jasmineNodeOpts: {
        isVerbose: true
    },
    onPrepare: function () {
        global.dv = browser.driver;
        browser.ignoreSynchronization = true;
    },
    seleniumServerJar: '../node_modules/selenium-server/lib/runner/selenium-server-standalone-2.47.1.jar',
    baseUrl: 'www.google.com'
};

My protractor.json:

{
  "options": {
    "configFile": "./config/protractor.conf.js",
    "noColor": false,
    "args": {},
    "webdriverManagerUpdate": true
  },
  "e2e": {
    "options": {
      "keepAlive": false
    }
  },
  "continuous": {
    "options": {
      "keepAlive": true
    }
  }
}

For now I am running tests locally from ./config location by command protractor protractor.conf.js . I have already selenium grid configured with vm's and hosts. Have as well IP address which I'll be using to connect with host.


回答1:


You just need to setup seleniumAddress: 'http://<IP>:4444/wd/hub', inside either protractor.conf.js, or your grunt/gulp runner.

All settings is here: https://github.com/angular/protractor/blob/master/lib/config.ts#L89



来源:https://stackoverflow.com/questions/33010305/protractor-with-selenium-grid

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!