Skip to content

Commit 71a0843

Browse files
authored
Update master Readme (#1)
* Readme update
1 parent 1d9a82b commit 71a0843

File tree

1 file changed

+36
-38
lines changed

1 file changed

+36
-38
lines changed

README.md

Lines changed: 36 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,89 +1,87 @@
11
# This is docker image for running Laravel 5.5 Dusk tests
22

3-
[![Docker automated](https://img.shields.io/docker/automated/chilio/laravel-dusk-ci.svg)](https://hub.docker.com/r/chilio/laravel-dusk-ci) [![Docker build](https://img.shields.io/docker/build/chilio/laravel-dusk-ci.svg)](https://hub.docker.com/r/chilio/laravel-dusk-ci) [![Docker pulls](https://img.shields.io/docker/pulls/chilio/laravel-dusk-ci.svg)](https://hub.docker.com/r/chilio/laravel-dusk-ci) [![GitHub tag](https://img.shields.io/github/tag/chilio/laravel-dusk-ci.svg)](https://github.com/chilio/laravel-dusk-ci/tags) [![GitHub issues](https://img.shields.io/github/issues/chilio/laravel-dusk-ci.svg)](https://github.com/chilio/laravel-dusk-ci/issues) [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/chilio/test-dusk/master/LICENSE)
3+
[![Docker automated](https://img.shields.io/docker/automated/chilio/laravel-dusk-ci.svg)](https://hub.docker.com/r/chilio/laravel-dusk-ci) [![Docker build](https://img.shields.io/docker/build/chilio/laravel-dusk-ci.svg)](https://hub.docker.com/r/chilio/laravel-dusk-ci) [![Docker pulls](https://img.shields.io/docker/pulls/chilio/laravel-dusk-ci.svg)](https://hub.docker.com/r/chilio/laravel-dusk-ci) [![GitHub tag](https://img.shields.io/github/tag/chilio/laravel-dusk-ci.svg)](https://github.com/chilio/laravel-dusk-ci/tags) [![GitHub issues](https://img.shields.io/github/issues/chilio/laravel-dusk-ci.svg)](https://github.com/chilio/laravel-dusk-ci/issues) [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/chilio/laravel-dusk-ci/master/LICENSE)
44

5-
This is **complete** test suite for **Laravel 5.5** with **Dusk browser tests** enabled running on docker.
5+
This is **complete** test suite for **Laravel 5.5** with **Dusk browser tests** enabled running on docker.
66

7-
You can safely use this for testing purposes in **gitlab environments**, especially gitlab ci runners.
7+
You can safely use this for testing purposes in **gitlab ci environments**, especially via gitlab ci runners.
88

9-
##### **What's included?**
9+
### **What's included?**
1010

1111
| FRAMEWORK | VERSION |
1212
| --------- | ------- |
1313
| PHP | 7.1.9.1 |
14+
| Xdebug | 2.5.5 |
1415
| NGINX | 1.10.3 |
1516
| NODEJS | 6.11.3 |
1617
| NPM | 3.10.10 |
17-
| YARN | 1.0.2 |
18-
| BOWER | 1.8.0 |
19-
| PHPUNIT | 6.3.0 |
20-
| NODE-SASS | 4.3.0 |
18+
| YARN | 1.1.0 |
19+
| BOWER | 1.8.2 |
20+
| PHPUNIT | 6.3.1 |
21+
| NODE-SASS | 4.5.3 |
2122
| GULP | 3.9.1 |
2223

23-
##### **Available additional commands:**
24+
### **Available additional commands:**
2425

25-
`start-nginx-ci-project` - configures and starts nginx php-fpm
26+
`configure-laravel` - sets up file permissions, generates laravel key, migrates and seeds db
2627

27-
`configure-laravel` - runs laravel build routines (change path permissions, execute artisan commands)
28+
`start-nginx-ci-project` - configures and starts nginx with php-fpm
2829

29-
##### **Note:**
30+
### **Databases:**
3031

31-
This build is tested with **mysql**, but probably works with other docker db engines
32+
This build is tested with **mysql**, but also works with other docker db engines
3233

3334
To successfully run mysql add to your test routine:
3435

35-
services:
36+
`services:`
3637

37-
- mysql:5.7
38+
`mysql:latest` #or specify version you need for example `mysql:5.7`
3839

39-
And in your .env mark mysql as the right resource
40+
And in your .env mark mysql as the corresponding resource (**DB_HOST=mysql**)
4041

41-
##### **Usage:**
42+
### **Usage:**
4243

4344
In your .gitlab-ci.yml use this image like:
4445

4546
`image: chilio/laravel-dusk-ci:stable`
4647

47-
add script line:
48+
add script lines:
4849

49-
`- start-nginx-ci-project` ***<-- THIS IS THE IMPORTANT POINT BEFORE RUNNING DUSK***
50+
`- cp .env.example .env` # remember to have **APP_URL=http://localhost** and **DB_HOST=mysql**
5051

51-
Finally you can run all your tests served by nginx | php-fpm.
52+
`- configure-laravel` # preparations to run project
53+
54+
`- start-nginx-ci-project` # Here we start webserver, so this is important before running dusk
55+
56+
Finally you can run all your tests served by nginx | php-fpm via:
57+
58+
`- php artisan dusk`
5259

5360
------
5461

55-
Further examples (use it if needed):
62+
#### Further example script commands (if needed in your case):
5663

5764
`- yarn --network-concurrency 1` # when you have problems with slow connection
5865

5966
`- composer install --prefer-dist --no-ansi --no-interaction --no-progress --no-scripts`
6067

61-
`- cp .env.example .env` ***<-- APP_URL=http://localhost AND DB_HOST=mysql***
6268

63-
64-
`- bower install --allow-root --quiet`
69+
`- bower install --quiet`
6570

6671
`- npm run dev ` or if you are on yarn registry `- yarn run dev `
6772

68-
`- configure-laravel`
69-
70-
`./vendor/phpunit/phpunit/phpunit -v --coverage-text --colors --stderr`
73+
`./vendor/phpunit/phpunit/phpunit -v --coverage-text --colors --stderr`# to run phpunit with version specified in your project
7174

72-
`- php artisan dusk`
75+
### **Examples:**
7376

74-
##### **Examples:**
77+
**[gitlab-ci.yml](examples/.gitlab-ci.yml)** with stages, cache, and artifacts, assuming you are using scripts like "dev" in package.json.
7578

76-
[**gitlab-ci.yml with stages and cache** (assuming you are on gitlab-multi-runner v9.5 and using scripts like "dev" in package.json):](examples/.gitlab-ci.yml)
79+
### **Caveats:**
7780

78-
##### **Caveats:**
81+
- In your dusk tests remember to use -**>waitFor()** to make sure page is rendered properly, before test fails.
82+
- This docker has been tested with **gitlab-multi-runner** 9.5.0 version
7983

80-
- In your dusk tests use ->waitFor() to make sure page is rendered properly
81-
- Remember to set up .env variables properly -> especially DB_HOST=mysql , APP_URL=http://localhost
82-
- **gitlab-multi-runner is evolving** (especially changes in cache functionality), in case of problems make sure you are using 9.5.0 version, which worked at this moment
8384

84-
##### **Updates**:
85+
- in my scenario using `yarn run dev` instead of `npm run dev` was much faster, but this might not work out of the box and you may need to adapt your project.
8586

86-
- bower does not need **--allow-root** anymore, in case you want to use it in this docker container
87-
- yarn does not need **--network-concurrency 1** anymore - you can always try if you experience problems
88-
- always better use `yarn run dev` instead of `npm run dev` if you have this script configured in package.json
8987

0 commit comments

Comments
 (0)