laradock/workspace
Taufek Johar 881cbfb8c2 Install Dependencies to Run Dusk Tests
**Why we need this change?**

Currently we are unable to run Dusk (Browser) tests in workspace container. This change,
is to allow us to install all dependencies needed to run Dust test which consists of

1. Linux packages such as xvfb (x-virtual frame buffer to run browser in headless container) and etc.
2. Chrome browser.
3. Chrome driver.

To install the Dusk dependencies.
1. Update `WORKSPACE_INSTALL_DUSK_DEPS` to true.
2. Run `docker-compose build workspace`.

I've also added couple of aliases to facilitate the preparation of test environment.

1. xvfb = `Xvfb -ac :0 -screen 0 1024x768x16 &` (run x-virtual frame buffer in the background)
2. serve = `php artisan serve --quiet &` (run laravel app in the background)

Once those are installed, we will need to update the default chrome driver argument in Laravel 5.5
from `--headless` to `sandbox`. Below are the steps to run Dusk in workspace.

1. `docker-compose run workspace bash` (get into workspace).
2. `laravel new dusk-test` (generate new lavarel app for testing purpose).
3. `cd dusk-test` (change directory to newly generate app folder).
4. `composer install --dev laravel/dusk` (install dusk via composer).
5. `php artisan dusk:install` (generate dusk files).
6. `sed -i '/APP_URL/d' .env` (remove APP_URL entry in .env)
7. `echo 'APP_URL=localhost:8000' >> .env` (add new APP_URL entry in .env)
8. `sed -i--'s/headless/no-sandbox/g' tests/DuskTestCase.php` (replace the default chrome driver argument).
9. `xvfb` (alias to run Xvfb instance in the background).
10. `serve` (alias to run laravel app in the background).
11. `dusk` (alias to run Dusk test).
2017-10-02 20:08:01 +08:00
..
crontab Updated Crontab for Workspace (#538) 2017-01-10 16:34:55 -05:00
mc Add Minio container 2017-03-05 15:06:22 +01:00
Dockerfile-56 Install Dependencies to Run Dusk Tests 2017-10-02 20:08:01 +08:00
Dockerfile-70 Install Dependencies to Run Dusk Tests 2017-10-02 20:08:01 +08:00
Dockerfile-71 Install Dependencies to Run Dusk Tests 2017-10-02 20:08:01 +08:00
aerospike.ini Add configuration to install aerospike php extension 2016-08-20 19:05:38 +01:00
aliases.sh Install Dependencies to Run Dusk Tests 2017-10-02 20:08:01 +08:00
composer.json add composer.json to install global composer dependencies 2016-07-25 07:00:50 +03:00
insecure_id_rsa ssh keys 2016-08-17 19:24:00 -06:00
insecure_id_rsa.ppk Expose port 22 for workspace ssh. Add private key for PHPStorm Windows users. 2016-08-27 17:00:01 -06:00
insecure_id_rsa.pub ssh keys 2016-08-17 19:24:00 -06:00
xdebug.ini disable xdebug remote by default 2016-10-09 20:47:08 -04:00