2017-04-11 61 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