- Make sure you have Composer & PHP installed!
- Open a terminal in the root folder and run
$ composer install
and$ npm install
. - Copy the
.env.example
file and name the new file.env
. - Make sure the database credentials in your new
.env
file match your actual credentials. - (on first time running) Run 'php artisan migrate:fresh --seed' to insert default data
- Run
$ php artisan serve
in your terminal. - Run
$ npm run hot
in another terminal. - Voilà! View the project at http://localhost:8000
Browser tests are located in ~/tests/Browser/
.
- Copy env file
$ cp .env .env.dusk.local
and edit DB_DATABASE, DB_USERNAME, DB_PASSWORD - Create a testing database with a testing user according to .env.dusk.local
- Build Vue assets:
$ npm run production
- Serve the project in testing mode:
$ php artisan serve --env=dusk.local
- Running tests:
- Running all browser tests:
$ php artisan dusk
. - Running a specific test:
$ php artisan dusk [file]
e.g.$ php artisan dusk tests/Browser/MapTest.php
For more information about browser testing, read the Dusk documentation.
$ npm run lint
Due to PHP being PHP, there are some common issues we will face which are resolved pretty easily.
- Target class does not exist.
- Run
$ composer dump-autoload
in your terminal.
- Generic NPM errors
- Remove
/node_modules
. - Run
$ npm ci
.
- Generic Composer errors
- Remove
/vendor
. - Run
$ composer install
.
- Running tests: 'Facebook\WebDriver\Exception\SessionNotCreatedException: session not created: Chrome version must be between 70 and 73'
- php artisan dusk:chrome-driver 72