2017-04-11 77 views
2

我使用Homestead 版本1.0.1Laravel版本5.4.16。我通过阅读the documentation来设置Laravel黄昏。在宅基上运行Laravel黄昏

但是,当我运行php artisan dusk ssh到我的家园。我得到了如下错误

PHPUnit 5.7.17 by Sebastian Bergmann and contributors.

E 1 /1 (100%)

Time: 2.52 minutes, Memory: 10.00MB

There was 1 error:

1) Tests\Browser\ExampleTest::testBasicExample Facebook\WebDriver\Exception\WebDriverCurlException: Curl error thrown for http POST to /session with params: {"desiredCapabilities":{"browserName":"chrome","platform":"ANY","chromeOptions":{"binary":"","args":["no-first-run"]}}}

Operation timed out after 30001 milliseconds with 0 bytes received

有没有办法解决这个问题?

回答

3

是的,它可以在黄昏的github页面找到。这是一个已知的问题,他们正在努力更新下一个家园箱。

The basic issue is that the homestead box has no visual interface and that dusk runs a real browser, so you have to install a chromedriver if you want to use it.

但现在这个工作对我来说: https://github.com/laravel/dusk/issues/50#issuecomment-275155974

不包括在该职位,但有必要对我来说: 请确保您有下列权限设置为从GitHub的后cd vendor/laravel/dusk/bin; chmod 775 *

步骤: 首先,要求在客户操作系统中安装google-chrome:

$ wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add - 
$ sudo sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list' 
$ sudo apt-get update && sudo apt-get install -y google-chrome-stable 

接下来的事情就是xvfb的:

$ sudo apt-get install -y xvfb 

尝试启动./vendor/laravel/dusk/bin/chromedriver-linux --port=8888.如果您有关于装载库(libnss3.so,libgconf-2.so.4)一些错误,试试这个:

$ sudo apt-get install -y libnss3-dev libxi6 libgconf-2-4 

当你看到

$ ./vendor/laravel/dusk/bin/chromedriver-linux --port=8888 
Starting ChromeDriver 2.25.426924 (649f9b868f6783ec9de71c123212b908bf3b232e) on port 8888 
Only local connections are allowed. 
this means ChromeDriver can be started (so SupportsChrome trait should be able to start it too). You can stop this process for now (Ctrl+C). 

运行

$ Xvfb :0 -screen 0 1280x960x24 & 
in a separate terminal window. 

另外,您可能还想将您的开发域添加到guest虚拟机的/ etc/hosts文件中: 127.0.0.1 domain.dev。

This issue is to add the chromedriver to homestead by default and will be solved mid April. https://github.com/laravel/homestead/issues/516

+0

我已经安装了google-chrome-stable作为建议,让事情运行而不抱怨依赖关系,用你的确切参数启动xvfb命令,但我仍然得到超时错误...我试图在MacOS主机上的Debian jessie容器中运行Dusk。在主机操作系统中,Dusk可以启动浏览器。容器中的chromedriver-linux的权限是755。 –

+0

该解决方案适用于Ubuntu的家园套装。不是debian – Christophvh