1
1
# Codeceptjs Docker
2
2
3
- CodeceptJS packed into container with the Nightmare, Protractor, and WebDriverIO drivers.
3
+ CodeceptJS packed into container with the Nightmare, Protractor, Puppeteer, and WebDriverIO drivers.
4
4
5
5
## How to Use
6
6
@@ -9,15 +9,26 @@ Mount in your CodeceptJS config directory into the `/tests` directory in the doc
9
9
10
10
Sample mount: ` -v path/to/codecept.json:/tests `
11
11
12
+ CodeceptJS runner is available inside container as ` codeceptjs ` .
13
+
12
14
### Locally
13
15
14
- You can execute CodeceptJS with Nightmare locally with no extra configuration.
16
+ You can execute CodeceptJS with Puppeteer or Nightmare locally with no extra configuration.
15
17
16
18
``` sh
17
19
docker run --net=host -v $PWD :/tests codeception/codeceptjs
18
20
```
19
21
20
- Nightmare helper must be enabled in codecept.json config.
22
+ To customize execution call ` codeceptjs ` command:
23
+
24
+ ``` sh
25
+ # run tests with steps
26
+ docker run --net=host -v $PWD :/tests codeception/codeceptjs codeceptjs run --steps
27
+
28
+ # run tests with @user in a name
29
+ docker run --net=host -v $PWD :/tests codeception/codeceptjs codeceptjs run --grep " @user"
30
+ ```
31
+
21
32
22
33
### Docker Compose
23
34
@@ -79,18 +90,28 @@ To build this image:
79
90
docker build -t codeception/codeceptjs .
80
91
` ` `
81
92
82
- # ## Debugging
83
- To pass arguments to `codecept run` command inside docker image you can set
84
- ` CODECEPT_ARGS` environment variable. For example to run your tests with debug
85
- and steps output :
93
+ * this directory will be added as `/codecept` insde container
94
+ * tests directory is expected to be mounted as `/tests`
95
+ * `codeceptjs` is a synlink to `/codecept/bin/codecept.js`
96
+
97
+ # ## Passing Options
98
+
99
+ Options can be passed by calling `codeceptjs` :
100
+
101
+ ` ` `
102
+ docker run -v $PWD:/tests codeception/codeceptjs codeceptjs run --debug
103
+ ` ` `
104
+
105
+ Alternatively arguments to `codecept run` command can be passed via `CODECEPT_ARGS` environment variable. For example to run your tests with debug
106
+ output :
86
107
87
108
` ` ` yaml
88
109
version: '2'
89
110
services:
90
111
codeceptjs:
91
112
image: codeception/codeceptjs
92
113
environment:
93
- - CODECEPT_ARGS=--debug --steps
114
+ - CODECEPT_ARGS=--debug
94
115
volumes:
95
116
- .:/tests
96
117
` ` `
0 commit comments