drsdvwsvo78320812
2016-07-11 20:54
浏览 41
已采纳

Laravel AngularJS量角器 - 测试时Chrome浏览器无法启动

And I'm running Laravel AngularJs in dockervel docker environment .

I'm using this docker image for protractor https://hub.docker.com/r/webnicer/protractor-headless/. I have pulled the image in MyApp/e2e_test folder and I have there spec.js and conf.js files.

spec.js

describe('Protractor Demo App', function() {
  it('should fill the form', function() {
    browser.get('http://localhost/');
    browser.debugger();
    //browser.pause();
    element(by.model('user1Data.name')).sendKeys('haja');
    element(by.model('user1Data.email')).sendKeys('haja@ds.com');
    element(by.model('user1Data.phone_number')).sendKeys('12345');
    element(by.id('register')).click();

    expect(element(by.id('thank')).isDisplayed()).toBe(true); 

  });
});

conf.js

exports.config = {
  framework: 'jasmine',
    capabilities: {
    'browserName': 'chrome'
  },
  specs: ['spec.js']
}

console autput:

docker run -it --privileged --rm --net=host -v /dev/shm:/dev/shm -v $(pwd):/protractor webnicer/protractor-headless conf.js
[20:43:27] I/local - Starting selenium standalone server...
[20:43:27] I/launcher - Running 1 instances of WebDriver
[20:43:28] I/local - Selenium standalone server started at http://192.168.1.69:34981/wd/hub
Started
.



1 spec, 0 failures
Finished in 3.843 seconds
[20:43:40] I/local - Shutting down selenium standalone server.
[20:43:40] I/launcher - 0 instance(s) of WebDriver still running
[20:43:40] I/launcher - chrome #01 passed

CHROME BROWSER DOESN'T APPEAR.

图片转代码服务由CSDN问答提供 功能建议

我在 dockervel docker environment。

我正在使用此泊坞窗图像进行量角器 https://hub.docker.com/r/webnicer/protractor-headless/ 。 我已将图像拉到MyApp / e2e_test文件夹中,我有spec.js和conf.js文件。

spec.js

  describe('Protractor Demo App',function(){
 it('应填写表单',function(){
 browser.get('http:// localhost /')  ; 
 browser.debugger(); 
 //browser.pause();
 element(by.model('user1Data.name'))。sendKeys('haja'); 
 element(by.model(  'user1Data.email'))。sendKeys('haja@ds.com'); 
 element(by.model('user1Data.phone_number'))。sendKeys('12345'); 
 element(by.id(  'register'))。click(); 
 
 expect(element(by.id('thank'))。isDisplayed())。toBe(true); 
 
}}; 
});  
   
 
 

conf.js

  exports.config = {
 framework:'jasmine',
 capabilities  :{
'browserName':'chrome'
},
 specs:['spec.js'] 
} 
   
 
 

console autput:< / p>

  docker run -it --privileged --rm --net = host -v / dev / shm:/ dev / shm -v $(pwd):/ protractor webnicer / 量角器无头conf.js 
 [20:43:27] 我/本地 - 启动selenium独立服务器... 
 [20:43:27] I / launcher  - 运行1个WebDriver实例
 [20:43:28] I / local  -  Selenium独立服务器从http:/开始 /192.168.1.69:34981/wd/hub
Started
.
nnnn1规范,0次失败
完成3.843秒
 [20:43:40] I / local  - 关闭selenium独立服务器 。
 [20:43:40] I / launcher  -  WebDriver的0个实例仍在运行
 [20:43:40] I / launcher  -  chrome#01传递
    
 
 

CHROME BROWSER不会出现。

  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • duangangpin078794 2016-07-27 06:46
    已采纳

    There is nothing wrong. All and everything is working as advertised!

    Why?

    Headless means there is no (real) display at all. More percisely: It is a virtual in-memory display.

    If you really must look at the display, look for Docker images that provide VNC access.

    已采纳该答案
    打赏 评论

相关推荐 更多相似问题