在我的 mac 上运行带有自定义 url 的 Vagrant 框的黄昏问题。我不得不编辑DuskTestCase.php
并替换http://localhost:9515
为$this->local
= http://mysite.dev
。
$php artisan dusk tests/Browser/LoginTest.php
输出以下错误:
Tests\Browser\LoginTest::testLogin
TypeError: Argument 1 passed to Facebook\WebDriver\Remote\DesiredCapabilities::__construct() must be of the type array, null given, called in /Users/gmylonas/Vagrant Projects/mywebsite/vendor/facebook/webdriver/lib/Remote/RemoteWebDriver.php on line 127
/Users/gmylonas/Vagrant Projects/mywebsite/vendor/facebook/webdriver/lib/Remote/DesiredCapabilities.php:33
/Users/gmylonas/Vagrant Projects/mywebsite/vendor/facebook/webdriver/lib/Remote/RemoteWebDriver.php:127
/Users/gmylonas/Vagrant Projects/mywebsite/tests/DuskTestCase.php:46
/Users/gmylonas/Vagrant Projects/mywebsite/vendor/laravel/dusk/src/TestCase.php:210
/Users/gmylonas/Vagrant Projects/mywebsite/vendor/laravel/framework/src/Illuminate/Support/helpers.php:762
/Users/gmylonas/Vagrant Projects/mywebsite/vendor/laravel/dusk/src/TestCase.php:211
/Users/gmylonas/Vagrant Projects/mywebsite/vendor/laravel/dusk/src/TestCase.php:117
/Users/gmylonas/Vagrant Projects/mywebsite/vendor/laravel/dusk/src/TestCase.php:89
/Users/gmylonas/Vagrant Projects/mywebsite/tests/Browser/LoginTest.php:23
当我替换$this->local
=时http://www.google.com:80
,$browser->visit('/')->dump();
它会转储谷歌页面的内容!
$this->local
=http://localhost:9515
将转储空页
<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body></body></html>
:question: 为什么它在我的盒子 url 上不起作用以及如何解决它?
谢谢是提前。