- 追加された行はこの色です。
- 削除された行はこの色です。
#author("2022-06-28T01:38:39+00:00","default:admin","admin")
#author("2022-06-28T05:07:44+00:00","default:admin","admin")
*ユニットテスト [#u9c9b831]
*フィーチャーテスト [#y7e8cca0]
*ブラウザテスト [#cafd6c8e]
**Laravel Dusk [#vc70b159]
***インストール [#y768ab36]
*ブラウザテスト(Laravel Dusk) [#abf4ed1a]
-[[Laravel 8.x Laravel Dusk:https://readouble.com/laravel/8.x/ja/dusk.html]]
-[[Laravel DuskでE2Eテスト(インストール、使い方、Docker/Vagrant環境別のtipsなど):https://www.ritolab.com/entry/187]]
-[[LaravelのDuskで外部サイトをブラウザテスト:https://www.wetch.co.jp/laravel%E3%81%AEdusk%E3%81%A7%E5%A4%96%E9%83%A8%E3%82%B5%E3%82%A4%E3%83%88%E3%82%92%E3%83%96%E3%83%A9%E3%82%A6%E3%82%B6%E3%83%86%E3%82%B9%E3%83%88/]]
**インストール [#y768ab36]
$ sail composer require --dev laravel/dusk
$ sail artisan dusk:install
***テスト実行 [#l5ae780b]
**テスト実行 [#l5ae780b]
$ sail dusk
**.env編集 [#b043a2ba]
APP_URL=http://localhost
DUSK_DRIVER_URL=http://localhost
**トラブルシューティング [#a7ee8c84]
-[[DockerでつまづくLaravel Dusk何なのお前:https://qiita.com/layzy_glp/items/c4481c005d39b0225a73]]
-[[Laravel DuskをDockerコンテナ内で起動するまで:https://qiita.com/acro5piano/items/50aeb01e06f398bc0296]]
***Facebook\WebDriver\Exception\SessionNotCreatedException: Could not start a new session. Error while creating session with the driver service. Stopping driver service: Could not start a new session. Response code 500. Message: unknown error: Chrome failed to start: crashed. [#p991c26d]
% sail dusk
PHPUnit 9.5.21 #StandWithUkraine
E 1 / 1 (100%)
Time: 00:35.580, Memory: 22.00 MB
There was 1 error:
1) Tests\Browser\ExampleTest::testBasicExample
Facebook\WebDriver\Exception\SessionNotCreatedException: Could not start a new session. Error while creating session with the driver service. Stopping driver service: Could not start a new session. Response code 500. Message: unknown error: Chrome failed to start: crashed.
(chrome not reachable)
(The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
Build info: version: '4.2.2', revision: '683ccb65d6'
System info: host: '9132dedbda0e', ip: '172.19.0.3', os.name: 'Linux', os.arch: 'amd64', os.version: '5.10.104-linuxkit', java.version: '11.0.15'
Driver info: driver.version: unknown
Build info: version: '4.2.2', revision: '683ccb65d6'
System info: host: '9132dedbda0e', ip: '172.19.0.3', os.name: 'Linux', os.arch: 'amd64', os.version: '5.10.104-linuxkit', java.version: '11.0.15'
Driver info: driver.version: unknown
/var/www/html/vendor/php-webdriver/webdriver/lib/Exception/WebDriverException.php:125
/var/www/html/vendor/php-webdriver/webdriver/lib/Remote/HttpCommandExecutor.php:372
/var/www/html/vendor/php-webdriver/webdriver/lib/Remote/RemoteWebDriver.php:131
/var/www/html/tests/DuskTestCase.php:46
/var/www/html/vendor/laravel/dusk/src/Concerns/ProvidesBrowser.php:219
/var/www/html/vendor/laravel/framework/src/Illuminate/Support/helpers.php:243
/var/www/html/vendor/laravel/dusk/src/Concerns/ProvidesBrowser.php:220
/var/www/html/vendor/laravel/dusk/src/Concerns/ProvidesBrowser.php:98
/var/www/html/vendor/laravel/dusk/src/Concerns/ProvidesBrowser.php:66
/var/www/html/tests/Browser/ExampleTest.php:21
ERRORS!
Tests: 1, Assertions: 0, Errors: 1.
-[[Laravel + sail + dusk => Error: Could not start a new session [...] Chrome failed to start:https://stackoverflow.com/questions/71693626/laravel-sail-dusk-error-could-not-start-a-new-session-chrome-faile]]
-アプリケーションの.envファイルにAPP_URL環境変数を設定
***Facebook\WebDriver\Exception\WebDriverCurlException: Curl error thrown for http POST to /session with params: [#k475da70]
-[[LaradockでLaravel Duskを動かすメモ:https://qiita.com/uenoryo/items/bdded2dc6f8e5f2075cc]]
***Failed to connect to localhost port 4444: Connection refused [#j1803e57]