1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Laravel Duskの導入

Posted at

導入背景

 現在Laravelで作成したポートフォリオのテストをデフォルトで搭載されているテストディレクトリを使用して実行していたが、利用が簡単なブラウザの自動操作/テストAPIであるDuckの存在を知ったので使用してみた

導入方法

プロジェクトに移動し、パッケージを取得

cd (プロジェクト名)
composer require --dev laravel/dusk
php artisan dusk:install

上記後、プロジェクトのtestディレクトリ内にBrowserディレクトリが作成される

.envの変更

.envファイル内のAPP_URL環境変数を変更する。
値はブラウザからアクセスするアプリケーションで使用するURLと一致させます。
※ローカル環境の場合

//デフォルト)
APP_URL=http://localhost
↓
//変更後)
APP_URL=http://localhost:8000

参考文献

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?