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