带硒栅的量角器

Mic*_*hal 2 javascript configuration selenium-grid selenium-webdriver 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'
};
Run Code Online (Sandbox Code Playgroud)

我的量角器.json:

{
  "options": {
    "configFile": "./config/protractor.conf.js",
    "noColor": false,
    "args": {},
    "webdriverManagerUpdate": true
  },
  "e2e": {
    "options": {
      "keepAlive": false
    }
  },
  "continuous": {
    "options": {
      "keepAlive": true
    }
  }
}
Run Code Online (Sandbox Code Playgroud)

现在我正在通过 command 从 ./config 位置本地运行测试protractor protractor.conf.js。我已经配置了虚拟机和主机的硒网格。还有我将用来连接主机的 IP 地址。

cva*_*tho 5

您只需要seleniumAddress: 'http://<IP>:4444/wd/hub',在 protractor.conf.js 或 grunt/gulp 运行器中进行设置。

所有设置都在这里: https ://github.com/angular/protractor/blob/master/lib/config.ts#L89