@@ -5,14 +5,69 @@ title: Commands - Codeception - Documentation
5
5
6
6
# Console Commands
7
7
8
- ## GeneratePageObject
8
+ ## DryRun
9
+
10
+ Shows step by step execution process for scenario driven tests without actually running them.
11
+
12
+ * ` codecept dry-run acceptance `
13
+ * ` codecept dry-run acceptance MyCest `
14
+ * ` codecept dry-run acceptance checkout.feature `
15
+ * ` codecept dry-run tests/acceptance/MyCest.php `
9
16
10
- Generates PageObject. Can be generated either globally, or just for one suite.
11
- If PageObject is generated globally it will act as UIMap, without any logic in it.
12
17
13
- * ` codecept g:page Login `
14
- * ` codecept g:page Registration `
15
- * ` codecept g:page acceptance Login `
18
+
19
+
20
+ ## GenerateCest
21
+
22
+ Generates Cest (scenario-driven object-oriented test) file:
23
+
24
+ * ` codecept generate:cest suite Login `
25
+ * ` codecept g:cest suite subdir/subdir/testnameCest.php `
26
+ * ` codecept g:cest suite LoginCest -c path/to/project `
27
+ * ` codecept g:cest "App\Login" `
28
+
29
+
30
+
31
+
32
+ ## GenerateSnapshot
33
+
34
+ Generates Snapshot.
35
+ Snapshot can be used to test dynamical data.
36
+ If suite name is provided, an actor class will be included into placeholder
37
+
38
+ * ` codecept g:snapshot UserEmails `
39
+ * ` codecept g:snapshot Products `
40
+ * ` codecept g:snapshot acceptance UserEmails `
41
+
42
+
43
+
44
+ ## GenerateHelper
45
+
46
+ Creates empty Helper class.
47
+
48
+ * ` codecept g:helper MyHelper `
49
+ * ` codecept g:helper "My\Helper" `
50
+
51
+
52
+
53
+
54
+ ## GenerateScenarios
55
+
56
+ Generates user-friendly text scenarios from scenario-driven tests (Cest).
57
+
58
+ * ` codecept g:scenarios acceptance ` - for all acceptance tests
59
+ * ` codecept g:scenarios acceptance --format html ` - in html format
60
+ * ` codecept g:scenarios acceptance --path doc ` - generate scenarios to ` doc ` dir
61
+
62
+
63
+
64
+ ## GenerateEnvironment
65
+
66
+ Generates empty environment configuration file into envs dir:
67
+
68
+ * ` codecept g:env firefox `
69
+
70
+ Required to have ` envs ` path to be specified in ` codeception.yml `
16
71
17
72
18
73
@@ -30,6 +85,17 @@ Usage:
30
85
31
86
32
87
88
+ ## GenerateFeature
89
+
90
+ Generates Feature file (in Gherkin):
91
+
92
+ * ` codecept generate:feature suite Login `
93
+ * ` codecept g:feature suite subdir/subdir/login.feature `
94
+ * ` codecept g:feature suite login.feature -c path/to/project `
95
+
96
+
97
+
98
+
33
99
## Console
34
100
35
101
Try to execute test commands in run-time. You may try commands before writing the test.
@@ -38,26 +104,63 @@ Try to execute test commands in run-time. You may try commands before writing th
38
104
39
105
40
106
41
- ## GenerateSnapshot
107
+ ## Clean
42
108
43
- Generates Snapshot.
44
- Snapshot can be used to test dynamical data.
45
- If suite name is provided, an actor class will be included into placeholder
109
+ Recursively cleans ` output ` directory and generated code.
46
110
47
- * ` codecept g:snapshot UserEmails `
48
- * ` codecept g:snapshot Products `
49
- * ` codecept g:snapshot acceptance UserEmails `
111
+ * ` codecept clean `
50
112
51
113
52
114
53
- ## GenerateHelper
54
115
55
- Creates empty Helper class.
116
+ ## GeneratePageObject
117
+
118
+ Generates PageObject. Can be generated either globally, or just for one suite.
119
+ If PageObject is generated globally it will act as UIMap, without any logic in it.
120
+
121
+ * ` codecept g:page Login `
122
+ * ` codecept g:page Registration `
123
+ * ` codecept g:page acceptance Login `
56
124
57
- * ` codecept g:helper MyHelper `
58
- * ` codecept g:helper "My\Helper" `
59
125
60
126
127
+ ## GenerateStepObject
128
+
129
+ Generates StepObject class. You will be asked for steps you want to implement.
130
+
131
+ * ` codecept g:stepobject acceptance AdminSteps `
132
+ * ` codecept g:stepobject acceptance UserSteps --silent ` - skip action questions
133
+
134
+
135
+
136
+
137
+ ## SelfUpdate
138
+
139
+ Auto-updates phar archive from official site: 'https://codeception.com/codecept.phar ' .
140
+
141
+ * ` php codecept.phar self-update `
142
+
143
+ @author Franck Cassedanne
< [email protected] >
144
+
145
+
146
+
147
+ ## CompletionFallback
148
+
149
+
150
+
151
+ ## Build
152
+
153
+ Generates Actor classes (initially Guy classes) from suite configs.
154
+ Starting from Codeception 2.0 actor classes are auto-generated. Use this command to generate them manually.
155
+
156
+ * ` codecept build `
157
+ * ` codecept build path/to/project `
158
+
159
+
160
+
161
+
162
+ ## Init
163
+
61
164
62
165
63
166
## Run
@@ -148,87 +251,6 @@ Options:
148
251
149
252
150
253
151
- ## Bootstrap
152
-
153
- Creates default config, tests directory and sample suites for current project.
154
- Use this command to start building a test suite.
155
-
156
- By default it will create 3 suites ** Acceptance** , ** Functional** , and ** Unit** .
157
-
158
- * ` codecept bootstrap ` - creates ` tests ` dir and ` codeception.yml ` in current dir.
159
- * ` codecept bootstrap --empty ` - creates ` tests ` dir without suites
160
- * ` codecept bootstrap --namespace Frontend ` - creates tests, and use ` Frontend ` namespace for actor classes and helpers.
161
- * ` codecept bootstrap --actor Wizard ` - sets actor as Wizard, to have ` TestWizard ` actor in tests.
162
- * ` codecept bootstrap path/to/the/project ` - provide different path to a project, where tests should be placed
163
-
164
-
165
-
166
-
167
- ## SelfUpdate
168
-
169
- Auto-updates phar archive from official site: 'https://codeception.com/codecept.phar ' .
170
-
171
- * ` php codecept.phar self-update `
172
-
173
- @author Franck Cassedanne
< [email protected] >
174
-
175
-
176
-
177
- ## GenerateGroup
178
-
179
- Creates empty GroupObject - extension which handles all group events.
180
-
181
- * ` codecept g:group Admin `
182
-
183
-
184
-
185
-
186
- ## GherkinSteps
187
-
188
- Prints all steps from all Gherkin contexts for a specific suite
189
-
190
- {% highlight yaml %}
191
- codecept gherkin: steps acceptance
192
-
193
- {% endhighlight %}
194
-
195
-
196
-
197
-
198
- ## Init
199
-
200
-
201
-
202
- ## GenerateEnvironment
203
-
204
- Generates empty environment configuration file into envs dir:
205
-
206
- * ` codecept g:env firefox `
207
-
208
- Required to have ` envs ` path to be specified in ` codeception.yml `
209
-
210
-
211
-
212
- ## GenerateScenarios
213
-
214
- Generates user-friendly text scenarios from scenario-driven tests (Cest).
215
-
216
- * ` codecept g:scenarios acceptance ` - for all acceptance tests
217
- * ` codecept g:scenarios acceptance --format html ` - in html format
218
- * ` codecept g:scenarios acceptance --path doc ` - generate scenarios to ` doc ` dir
219
-
220
-
221
-
222
- ## GenerateStepObject
223
-
224
- Generates StepObject class. You will be asked for steps you want to implement.
225
-
226
- * ` codecept g:stepobject acceptance AdminSteps `
227
- * ` codecept g:stepobject acceptance UserSteps --silent ` - skip action questions
228
-
229
-
230
-
231
-
232
254
## GenerateTest
233
255
234
256
Generates skeleton for Unit Test that extends ` Codeception\TestCase\Test ` .
@@ -262,13 +284,14 @@ Check overriding config values (like in `run` command)
262
284
263
285
264
286
265
- ## Build
287
+ ## GherkinSteps
266
288
267
- Generates Actor classes (initially Guy classes) from suite configs.
268
- Starting from Codeception 2.0 actor classes are auto-generated. Use this command to generate them manually.
289
+ Prints all steps from all Gherkin contexts for a specific suite
269
290
270
- * ` codecept build `
271
- * ` codecept build path/to/project `
291
+ {% highlight yaml %}
292
+ codecept gherkin: steps acceptance
293
+
294
+ {% endhighlight %}
272
295
273
296
274
297
@@ -285,51 +308,28 @@ Create new test suite. Requires suite name and actor name
285
308
286
309
287
310
288
- ## GenerateFeature
289
-
290
- Generates Feature file (in Gherkin):
291
-
292
- * ` codecept generate:feature suite Login `
293
- * ` codecept g:feature suite subdir/subdir/login.feature `
294
- * ` codecept g:feature suite login.feature -c path/to/project `
295
-
296
-
297
-
298
-
299
- ## DryRun
300
-
301
- Shows step by step execution process for scenario driven tests without actually running them.
302
-
303
- * ` codecept dry-run acceptance `
304
- * ` codecept dry-run acceptance MyCest `
305
- * ` codecept dry-run acceptance checkout.feature `
306
- * ` codecept dry-run tests/acceptance/MyCest.php `
307
-
308
-
309
-
310
-
311
- ## Clean
312
-
313
- Recursively cleans ` output ` directory and generated code.
314
-
315
- * ` codecept clean `
311
+ ## Bootstrap
316
312
313
+ Creates default config, tests directory and sample suites for current project.
314
+ Use this command to start building a test suite.
317
315
316
+ By default it will create 3 suites ** Acceptance** , ** Functional** , and ** Unit** .
318
317
318
+ * ` codecept bootstrap ` - creates ` tests ` dir and ` codeception.yml ` in current dir.
319
+ * ` codecept bootstrap --empty ` - creates ` tests ` dir without suites
320
+ * ` codecept bootstrap --namespace Frontend ` - creates tests, and use ` Frontend ` namespace for actor classes and helpers.
321
+ * ` codecept bootstrap --actor Wizard ` - sets actor as Wizard, to have ` TestWizard ` actor in tests.
322
+ * ` codecept bootstrap path/to/the/project ` - provide different path to a project, where tests should be placed
319
323
320
- ## GenerateCest
321
324
322
- Generates Cest (scenario-driven object-oriented test) file:
323
325
324
- * ` codecept generate:cest suite Login `
325
- * ` codecept g:cest suite subdir/subdir/testnameCest.php `
326
- * ` codecept g:cest suite LoginCest -c path/to/project `
327
- * ` codecept g:cest "App\Login" `
328
326
329
327
328
+ ## GenerateGroup
330
329
330
+ Creates empty GroupObject - extension which handles all group events.
331
331
332
- ## CompletionFallback
332
+ * ` codecept g:group Admin `
333
333
334
334
335
335
0 commit comments