- Make sure you have Composer & PHP installed!
- Open a terminal in the root folder and run
$ composer installand$ npm install. - Copy the
.env.examplefile and name the new file.env. - Make sure the database credentials in your new
.envfile match your actual credentials. - (on first time running) Run 'php artisan migrate:fresh --seed' to insert default data
- Run
$ php artisan servein your terminal. - Run
$ npm run hotin another terminal. - Voilà! View the project at http://localhost:8000
Browser tests are located in ~/tests/Browser/.
- Copy env file
$ cp .env .env.dusk.localand 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-autoloadin 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