黄昏不能成为资产

时间:2019-04-12 06:17:27

标签: laravel testing laravel-dusk

我是黄昏的新手,我刚刚在一个新的laravel项目中安装了黄昏。 当我输入php artisan:dusk时,出现以下错误,尽管它在那里,但仍然无法在“ /”路径上看到文本“ Laravel”。 而且浏览器也不会打开。 在此先感谢:)

Warning: TTY mode is not supported on Windows platform.
PHPUnit 7.5.8 by Sebastian Bergmann and contributors.


DevTools listening on ws://127.0.0.1:11633/devtools/browser/aee653fc-733b-4f2d-af35-5b347d1a497d
[0411/230433.674:INFO:CONSOLE(5496)] "Uncaught SyntaxError: Unexpected token }", source: http://localhost/dashboard/javascripts/all.js (5496)
F                                                                   1 / 1 (100%)

Time: 6.62 seconds, Memory: 14.00 MB

There was 1 failure:

1) Tests\Browser\ExampleTest::testBasicExample
Did not see expected text [Laravel] within element [body].
Failed asserting that false is true.

C:\laravel\dusk\vendor\laravel\dusk\src\Concerns\MakesAssertions.php:173
C:\laravel\dusk\vendor\laravel\dusk\src\Concerns\MakesAssertions.php:144
C:\laravel\dusk\tests\Browser\ExampleTest.php:20
C:\laravel\dusk\vendor\laravel\dusk\src\Concerns\ProvidesBrowser.php:67
C:\laravel\dusk\tests\Browser\ExampleTest.php:21

FAILURES!
Tests: 1, Assertions: 1, Failures: 1.

1 个答案:

答案 0 :(得分:1)

您可以尝试以下几种方式:

1。确保复制“ .env”,重命名为“ .env.dusk.local”,然后更改APP_URL = {http://localhost:8000} //您服务2.运行php artisan服务3.运行php artisan黄昏时间: 2.17秒,内存:18.00 MB

OK(1个测试,1个断言) 调试:1.更改DuskTestCase.php以查看您浏览的网站页面http://localhost:9515,DesiredCapabilities :: chrome()

2。在测试文件中添加一行示例Test.php pause(1000) 所有代码都参考这里:github.com/laravel/dusk/issues/488