2016-03-07 44 views
1

我无法在Sauce Lab上运行量角器测试。我在企业防火墙后面,并且使用Sauce Connect有活动的Tunnel to Sauce Lab。下面是我的量角器conf.js在Sauce实验室的企业防火墙后面运行Angular Protractor测试存在问题?

var HttpsProxyAgent = require("https-proxy-agent"); 
var agent = new HttpsProxyAgent('http://userName:[email protected]:8099'); 

// An example configuration file. 
exports.config = { 
    agent: agent, 
    sauceUser: process.env.SAUCE_USERNAME, 
    sauceKey: process.env.SAUCE_ACCESS_KEY, 
    directConnect: false, 

    // Capabilities to be passed to the webdriver instance. 
    capabilities: { 
    'browserName': 'chrome', 
    'proxy': { 
     'proxyType': 'manual', 
     'httpProxy': 'http://userName:[email protected]:8099' 
    } 
    }, 

    // Framework to use. Jasmine is recommended. 
    framework: 'jasmine', 

    // Spec patterns are relative to the current working directly when 
    // protractor is called. 
    specs: ['tests/specs/*-spec.js'], 

    // Options to be passed to Jasmine. 
    jasmineNodeOpts: { 
    showColors: true, 
    defaultTimeoutInterval: 30000 
    } 
}; 

我收到以下错误,当我运行node_modules /量角器/斌/量角器conf.js

Error: ETIMEDOUT connect ETIMEDOUT 151.444.33.22:80 
    at ClientRequest.<anonymous> (/Users/user123/Desktop/Sample/example-sandbox/node_modules/protractor/node_modules/selenium-webdriver/http/index.js:174:16) 
    at emitOne (events.js:77:13) 
    at ClientRequest.emit (events.js:169:7) 
    at Socket.socketErrorListener (_http_client.js:259:9) 
    at emitOne (events.js:77:13) 
    at Socket.emit (events.js:169:7) 
    at emitErrorNT (net.js:1253:8) 
    at doNTCallback2 (node.js:439:9) 
    at process._tickCallback (node.js:353:17) 
From: Task: WebDriver.createSession() 
    at Function.webdriver.WebDriver.acquireSession_ (/Users/user123/Desktop/Sample/example-sandbox/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/webdriver.js:157:22) 
    at Function.webdriver.WebDriver.createSession (/Users/user123/Desktop/Sample/example-sandbox/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/webdriver.js:131:30) 
    at [object Object].Builder.build (/Users/user123/Desktop/Sample/example-sandbox/node_modules/protractor/node_modules/selenium-webdriver/builder.js:445:22) 
    at [object Object].DriverProvider.getNewDriver (/Users/user123/Desktop/Sample/example-sandbox/node_modules/protractor/lib/driverProviders/driverProvider.js:42:27) 
    at [object Object].Runner.createBrowser (/Users/user123/Desktop/Sample/example-sandbox/node_modules/protractor/lib/runner.js:190:37) 
    at /Users/user123/Desktop/Sample/example-sandbox/node_modules/protractor/lib/runner.js:280:21 
    at _fulfilled (/Users/user123/Desktop/Sample/example-sandbox/node_modules/protractor/node_modules/q/q.js:834:54) 
    at self.promiseDispatch.done (/Users/user123/Desktop/Sample/example-sandbox/node_modules/protractor/node_modules/q/q.js:863:30) 
    at Promise.promise.promiseDispatch (/Users/user123/Desktop/Sample/example-sandbox/node_modules/protractor/node_modules/q/q.js:796:13) 
    at /Users/user123/Desktop/Sample/example-sandbox/node_modules/protractor/node_modules/q/q.js:556:49 
[launcher] Process exited with error code 1 

回答

2

关键字来代理进入酱实验室通过量角器sauceAgent。尝试以下方法,看看你是否有更好的运气。

var HttpsProxyAgent = require("https-proxy-agent"); 
var agent = new HttpsProxyAgent('http://userName:[email protected]:8099'); 

// An example configuration file. 
exports.config = { 
    sauceAgent: agent, 
    sauceUser: process.env.SAUCE_USERNAME, 
    sauceKey: process.env.SAUCE_ACCESS_KEY, 
相关问题