带有硒网格的量角器

Protractor with selenium grid

本文关键字:量角器 网格      更新时间:2023-09-26

谁能建议如何设置量角器远程运行测试?

我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'
};
我protractor.json

:

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

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

你只需要在protractor.conf.js或grunt/gulp runner中设置seleniumAddress: 'http://<IP>:4444/wd/hub',

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