gpt4 book ai didi

facebook - 在 Homestead 上运行 Laravel Dusk

转载 作者:行者123 更新时间:2023-12-01 12:22:09 34 4
gpt4 key购买 nike

我使用 Homestead 版本 1.0.1Laravel 版本 5.4.16。我通过阅读 the documentation 来设置 Laravel 黄昏.

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

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

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

最佳答案

是的,它可以在 Dusk 的 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

该帖子中没有包含但对我来说是必需的:确保你有以下权限集 cd vendor/laravel/dusk/bin; chmod 775 *

github 帖子中的步骤:首先,需要在客户操作系统中安装 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 域.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

关于facebook - 在 Homestead 上运行 Laravel Dusk,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43337644/

34 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com