量角器在不打开浏览器

时间:2015-10-29 06:32:21

标签: protractor

我下载了一个新的离子项目,我试图测试标题包含这些元素""

我的配置文件是

exports.config = {
  framework: 'jasmine2',
  seleniumAddress: 'http://localhost:4444/wd/hub',
  specs: ['../www/head.spec.js'],
  multiCapabilities: [
  {
    browserName: 'chrome'
  }]
}

将其命名为e2e.js

我的测试用例文件是

    describe('header Module', function(){

        var header;      

       beforeEach(function() {
             header = element(by.css('title'));             
        });

it('should check title text',function(){
            expect(header.getText()).toContain('Ionic Blank Starter');

        });
    });

我把它命名为head.spec.js

我的问题是,我可以看到浏览器打开,我的量角器发送错误消息

  

empresss-Mac-mini:myApp admin $ protractor test / e2e.js   在http://localhost:4444/wd/hub使用selenium服务器   [launcher]运行WebDriver的1个实例

     

/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/http/index.js:172         回调(new Error(message));                  ^   错误:ECONNREFUSED连接ECONNREFUSED 127.0.0.1:4444       在ClientRequest。 (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/http/index.js:172:16)       在emitOne(events.js:77:13)       在ClientRequest.emit(events.js:169:7)       在Socket.socketErrorListener(_http_client.js:259:9)       在emitOne(events.js:77:13)       在Socket.emit(events.js:169:7)       在emitErrorNT(net.js:1253:8)       at doNTCallback2(node.js:439:9)       在进程中。 tickCallback(node.js:353:17)   来自:任务:WebDriver.createSession()       在Function.webdriver.WebDriver.acquireSession (/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/webdriver.js:157:22)       在Function.webdriver.WebDriver.createSession(/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/webdriver.js:131:30)       at [object Object] .Builder.build(/usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/builder.js:445:22)       at [object Object] .DriverProvider.getNewDriver(/usr/local/lib/node_modules/protractor/lib/driverProviders/driverProvider.js:38:7)       at [object Object] .Runner.createBrowser(/usr/local/lib/node_modules/protractor/lib/runner.js:182:37)       at /usr/local/lib/node_modules/protractor/lib/runner.js:263:21       在_fulfilled(/usr/local/lib/node_modules/protractor/node_modules/q/q.js:797:54)       at self.promiseDispatch.done(/usr/local/lib/node_modules/protractor/node_modules/q/q.js:826:30)       在Promise.promise.promiseDispatch(/usr/local/lib/node_modules/protractor/node_modules/q/q.js:759:13)       at /usr/local/lib/node_modules/protractor/node_modules/q/q.js:525:49   [launcher]进程已退出,错误代码为1

有人可以帮助解决这个问题

当我尝试webdriver-manager更新错误信息时显示

empresss-Mac-mini:~ admin$ webdriver-manager update
fs.js:799
  return binding.mkdir(pathModule._makeLong(path),
                 ^

Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/protractor/selenium'
    at Error (native)
    at Object.fs.mkdirSync (fs.js:799:18)
    at Object.<anonymous> (/usr/local/lib/node_modules/protractor/bin/webdriver-manager:126:6)
    at Module._compile (module.js:435:26)
    at Object.Module._extensions..js (module.js:442:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:311:12)
    at Function.Module.runMain (module.js:467:10)
    at startup (node.js:134:18)
    at node.js:961:3
empresss-Mac-mini:~ admin$ 

0 个答案:

没有答案