3

我使用 Homestead版本 1.0.1Laravel 版本 5.4.16我通过阅读文档设置了 Laravel 黄昏。

但是,当我php artisan dusk通过 ssh 运行到我的家园时。我收到如下错误

Sebastian Bergmann 和贡献者的 PHPUnit 5.7.17。

E 1 / 1 (100%)

时间:2.52 分钟,内存:10.00MB

有 1 个错误:

1) Tests\Browser\ExampleTest::testBasicExample Facebook\WebDriver\Exception\WebDriverCurlException: 使用参数将 http POST 抛出到 /session 的 Curl 错误:{"desiredCapabilities":{"browserName":"chrome","platform":"ANY ","chromeOptions":{"binary":"","args":["no-first-run"]}}}

操作在 30001 毫秒后超时,收到 0 个字节

有没有什么办法解决这一问题 ?

4

1 回答 1

5

是的,可以在 Dusk 的 github 页面上找到。这是一个已知问题,他们正在努力更新下一个宅基地框。

基本问题是宅基地盒子没有可视化界面,黄昏运行的是真正的浏览器,所以如果你想使用它,你必须安装一个chromedriver。

但现在这对我有用: https ://github.com/laravel/dusk/issues/50#issuecomment-275155974

未包含在该帖子中,但对我来说是必要的:确保您具有以下权限集cd vendor/laravel/dusk/bin; chmod 775 *

来自github帖子的步骤:首先,需要在guest OS中安装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.

此外,您可能希望在访客的 /etc/hosts 文件中添加您的开发域:127.0.0.1 domain.dev。

这个问题是默认添加chromedriver到homestead,4月中旬解决。https://github.com/laravel/homestead/issues/516

于 2017-04-11T07:28:33.700 回答