@@ -5,12 +5,25 @@ title: Commands - Codeception - Documentation
5
5
6
6
# Console Commands
7
7
8
- ## GenerateStepObject
8
+ ## DryRun
9
9
10
- Generates StepObject class. You will be asked for steps you want to implement .
10
+ Shows step-by-step execution process for scenario driven tests without actually running them .
11
11
12
- * ` codecept g:stepobject acceptance AdminSteps `
13
- * ` codecept g:stepobject acceptance UserSteps --silent ` - skip action questions
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 `
16
+
17
+
18
+
19
+
20
+ ## Build
21
+
22
+ Generates Actor classes (initially Guy classes) from suite configs.
23
+ Starting from Codeception 2.0 actor classes are auto-generated. Use this command to generate them manually.
24
+
25
+ * ` codecept build `
26
+ * ` codecept build path/to/project `
14
27
15
28
16
29
@@ -25,36 +38,93 @@ Generates user-friendly text scenarios from scenario-driven tests (Cest).
25
38
26
39
27
40
28
- ## GenerateSnapshot
29
41
30
- Generates Snapshot.
31
- Snapshot can be used to test dynamical data.
32
- If suite name is provided, an actor class will be included into placeholder
42
+ ## ConfigValidate
33
43
34
- * ` codecept g:snapshot UserEmails `
35
- * ` codecept g:snapshot Products `
36
- * ` codecept g:snapshot acceptance UserEmails `
44
+ Validates and prints Codeception config.
45
+ Use it do debug Yaml configs
37
46
47
+ Check config:
38
48
49
+ * ` codecept config ` : check global config
50
+ * ` codecept config unit ` : check suite config
39
51
40
- ## DryRun
52
+ Load config:
41
53
42
- Shows step-by-step execution process for scenario driven tests without actually running them.
54
+ * ` codecept config:validate -c path/to/another/config ` : from another dir
55
+ * ` codecept config:validate -c another_config.yml ` : from another config file
43
56
44
- * ` codecept dry-run acceptance `
45
- * ` codecept dry-run acceptance MyCest `
46
- * ` codecept dry-run acceptance checkout.feature `
47
- * ` codecept dry-run tests/acceptance/MyCest.php `
57
+ Check overriding config values (like in ` run ` command)
48
58
59
+ * ` codecept config:validate -o "settings: shuffle: true" ` : enable shuffle
60
+ * ` codecept config:validate -o "settings: lint: false" ` : disable linting
61
+ * ` codecept config:validate -o "reporters: report: \Custom\Reporter" --report ` : use custom reporter
49
62
50
63
51
64
52
- ## GenerateTest
53
65
54
- Generates skeleton for Unit Test that extends ` Codeception\TestCase\Test ` .
66
+ ## GenerateFeature
67
+
68
+ Generates Feature file (in Gherkin):
69
+
70
+ * ` codecept generate:feature suite Login `
71
+ * ` codecept g:feature suite subdir/subdir/login.feature `
72
+ * ` codecept g:feature suite login.feature -c path/to/project `
73
+
74
+
75
+
76
+
77
+ ## GherkinSteps
78
+
79
+ Prints all steps from all Gherkin contexts for a specific suite
80
+
81
+ {% highlight yaml %}
82
+ codecept gherkin: steps acceptance
83
+
84
+ {% endhighlight %}
85
+
86
+
87
+
88
+
89
+ ## GeneratePageObject
90
+
91
+ Generates PageObject. Can be generated either globally, or just for one suite.
92
+ If PageObject is generated globally it will act as UIMap, without any logic in it.
93
+
94
+ * ` codecept g:page Login `
95
+ * ` codecept g:page Registration `
96
+ * ` codecept g:page acceptance Login `
97
+
98
+
99
+
100
+ ## GenerateEnvironment
101
+
102
+ Generates empty environment configuration file into envs dir:
103
+
104
+ * ` codecept g:env firefox `
105
+
106
+ Required to have ` envs ` path to be specified in ` codeception.yml `
107
+
108
+
109
+
110
+ ## GenerateCest
111
+
112
+ Generates Cest (scenario-driven object-oriented test) file:
113
+
114
+ * ` codecept generate:cest suite Login `
115
+ * ` codecept g:cest suite subdir/subdir/testnameCest.php `
116
+ * ` codecept g:cest suite LoginCest -c path/to/project `
117
+ * ` codecept g:cest "App\Login" `
118
+
119
+
120
+
121
+
122
+ ## Clean
123
+
124
+ Recursively cleans ` output ` directory and generated code.
125
+
126
+ * ` codecept clean `
55
127
56
- * ` codecept g:test unit User `
57
- * ` codecept g:test unit "App\User" `
58
128
59
129
60
130
@@ -68,6 +138,42 @@ Creates empty Helper class.
68
138
69
139
70
140
141
+ ## GenerateSuite
142
+
143
+ Create new test suite. Requires suite name and actor name
144
+
145
+ * ``
146
+ * ` codecept g:suite api ` -> api + ApiTester
147
+ * ` codecept g:suite integration Code ` -> integration + CodeTester
148
+ * ` codecept g:suite frontend Front ` -> frontend + FrontTester
149
+
150
+
151
+
152
+
153
+ ## Console
154
+
155
+ Try to execute test commands in run-time. You may try commands before writing the test.
156
+
157
+ * ` codecept console acceptance ` - starts acceptance suite environment. If you use WebDriver you can manipulate browser with Codeception commands.
158
+
159
+
160
+
161
+ ## GenerateSnapshot
162
+
163
+ Generates Snapshot.
164
+ Snapshot can be used to test dynamical data.
165
+ If suite name is provided, an actor class will be included into placeholder
166
+
167
+ * ` codecept g:snapshot UserEmails `
168
+ * ` codecept g:snapshot Products `
169
+ * ` codecept g:snapshot acceptance UserEmails `
170
+
171
+
172
+
173
+ ## Init
174
+
175
+
176
+
71
177
## GherkinSnippets
72
178
73
179
Generates code snippets for matched feature files in a suite.
@@ -82,24 +188,42 @@ Usage:
82
188
83
189
84
190
85
- ## GeneratePageObject
191
+ ## GenerateStepObject
86
192
87
- Generates PageObject. Can be generated either globally, or just for one suite.
88
- If PageObject is generated globally it will act as UIMap, without any logic in it.
193
+ Generates StepObject class. You will be asked for steps you want to implement.
89
194
90
- * ` codecept g:page Login `
91
- * ` codecept g:page Registration `
92
- * ` codecept g:page acceptance Login `
195
+ * ` codecept g:stepobject acceptance AdminSteps `
196
+ * ` codecept g:stepobject acceptance UserSteps --silent ` - skip action questions
93
197
94
198
95
199
96
- ## GenerateEnvironment
97
200
98
- Generates empty environment configuration file into envs dir:
201
+ ## CompletionFallback
99
202
100
- * ` codecept g:env firefox `
101
203
102
- Required to have ` envs ` path to be specified in ` codeception.yml `
204
+
205
+ ## GenerateTest
206
+
207
+ Generates skeleton for Unit Test that extends ` Codeception\TestCase\Test ` .
208
+
209
+ * ` codecept g:test unit User `
210
+ * ` codecept g:test unit "App\User" `
211
+
212
+
213
+
214
+ ## Bootstrap
215
+
216
+ Creates default config, tests directory and sample suites for current project.
217
+ Use this command to start building a test suite.
218
+
219
+ By default, it will create 3 suites ** Acceptance** , ** Functional** , and ** Unit** .
220
+
221
+ * ` codecept bootstrap ` - creates ` tests ` dir and ` codeception.yml ` in current dir.
222
+ * ` codecept bootstrap --empty ` - creates ` tests ` dir without suites
223
+ * ` codecept bootstrap --namespace Frontend ` - creates tests, and use ` Frontend ` namespace for actor classes and helpers.
224
+ * ` codecept bootstrap --actor Wizard ` - sets actor as Wizard, to have ` TestWizard ` actor in tests.
225
+ * ` codecept bootstrap path/to/the/project ` - provide different path to a project, where tests should be placed
226
+
103
227
104
228
105
229
@@ -192,75 +316,6 @@ Options:
192
316
193
317
194
318
195
- ## CompletionFallback
196
-
197
-
198
-
199
- ## GherkinSteps
200
-
201
- Prints all steps from all Gherkin contexts for a specific suite
202
-
203
- {% highlight yaml %}
204
- codecept gherkin: steps acceptance
205
-
206
- {% endhighlight %}
207
-
208
-
209
-
210
-
211
- ## Clean
212
-
213
- Recursively cleans ` output ` directory and generated code.
214
-
215
- * ` codecept clean `
216
-
217
-
218
-
219
-
220
- ## Init
221
-
222
-
223
-
224
- ## GenerateCest
225
-
226
- Generates Cest (scenario-driven object-oriented test) file:
227
-
228
- * ` codecept generate:cest suite Login `
229
- * ` codecept g:cest suite subdir/subdir/testnameCest.php `
230
- * ` codecept g:cest suite LoginCest -c path/to/project `
231
- * ` codecept g:cest "App\Login" `
232
-
233
-
234
-
235
-
236
- ## Console
237
-
238
- Try to execute test commands in run-time. You may try commands before writing the test.
239
-
240
- * ` codecept console acceptance ` - starts acceptance suite environment. If you use WebDriver you can manipulate browser with Codeception commands.
241
-
242
-
243
-
244
- ## GenerateSuite
245
-
246
- Create new test suite. Requires suite name and actor name
247
-
248
- * ``
249
- * ` codecept g:suite api ` -> api + ApiTester
250
- * ` codecept g:suite integration Code ` -> integration + CodeTester
251
- * ` codecept g:suite frontend Front ` -> frontend + FrontTester
252
-
253
-
254
-
255
-
256
- ## GenerateGroup
257
-
258
- Creates empty GroupObject - extension which handles all group events.
259
-
260
- * ` codecept g:group Admin `
261
-
262
-
263
-
264
319
## SelfUpdate
265
320
266
321
Auto-updates phar archive from official site: 'https://codeception.com/codecept.phar ' .
@@ -271,66 +326,11 @@ Auto-updates phar archive from official site: 'https://codeception.com/codecept.
271
326
272
327
273
328
274
- ## Build
275
-
276
- Generates Actor classes (initially Guy classes) from suite configs.
277
- Starting from Codeception 2.0 actor classes are auto-generated. Use this command to generate them manually.
278
-
279
- * ` codecept build `
280
- * ` codecept build path/to/project `
281
-
282
-
283
-
284
-
285
- ## GenerateFeature
286
-
287
- Generates Feature file (in Gherkin):
288
-
289
- * ` codecept generate:feature suite Login `
290
- * ` codecept g:feature suite subdir/subdir/login.feature `
291
- * ` codecept g:feature suite login.feature -c path/to/project `
292
-
293
-
294
-
295
-
296
- ## Bootstrap
297
-
298
- Creates default config, tests directory and sample suites for current project.
299
- Use this command to start building a test suite.
300
-
301
- By default, it will create 3 suites ** Acceptance** , ** Functional** , and ** Unit** .
302
-
303
- * ` codecept bootstrap ` - creates ` tests ` dir and ` codeception.yml ` in current dir.
304
- * ` codecept bootstrap --empty ` - creates ` tests ` dir without suites
305
- * ` codecept bootstrap --namespace Frontend ` - creates tests, and use ` Frontend ` namespace for actor classes and helpers.
306
- * ` codecept bootstrap --actor Wizard ` - sets actor as Wizard, to have ` TestWizard ` actor in tests.
307
- * ` codecept bootstrap path/to/the/project ` - provide different path to a project, where tests should be placed
308
-
309
-
310
-
311
-
312
- ## ConfigValidate
313
-
314
- Validates and prints Codeception config.
315
- Use it do debug Yaml configs
316
-
317
- Check config:
318
-
319
- * ` codecept config ` : check global config
320
- * ` codecept config unit ` : check suite config
321
-
322
- Load config:
323
-
324
- * ` codecept config:validate -c path/to/another/config ` : from another dir
325
- * ` codecept config:validate -c another_config.yml ` : from another config file
326
-
327
- Check overriding config values (like in ` run ` command)
328
-
329
- * ` codecept config:validate -o "settings: shuffle: true" ` : enable shuffle
330
- * ` codecept config:validate -o "settings: lint: false" ` : disable linting
331
- * ` codecept config:validate -o "reporters: report: \Custom\Reporter" --report ` : use custom reporter
329
+ ## GenerateGroup
332
330
331
+ Creates empty GroupObject - extension which handles all group events.
333
332
333
+ * ` codecept g:group Admin `
334
334
335
335
336
336
0 commit comments