@@ -5,6 +5,69 @@ 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
+
8
71
## GherkinSnippets
9
72
10
73
Generates code snippets for matched feature files in a suite.
@@ -19,14 +82,25 @@ Usage:
19
82
20
83
21
84
22
- ## GenerateHelper
85
+ ## GeneratePageObject
23
86
24
- Creates empty Helper class.
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 `
25
93
26
- * ` codecept g:helper MyHelper `
27
- * ` codecept g:helper "My\Helper" `
28
94
29
95
96
+ ## GenerateEnvironment
97
+
98
+ Generates empty environment configuration file into envs dir:
99
+
100
+ * ` codecept g:env firefox `
101
+
102
+ Required to have ` envs ` path to be specified in ` codeception.yml `
103
+
30
104
31
105
32
106
## Run
@@ -118,64 +192,32 @@ Options:
118
192
119
193
120
194
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
-
144
195
## CompletionFallback
145
196
146
197
147
198
148
- ## GenerateScenarios
149
-
150
- Generates user-friendly text scenarios from scenario-driven tests (Cest).
199
+ ## GherkinSteps
151
200
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
201
+ Prints all steps from all Gherkin contexts for a specific suite
155
202
203
+ {% highlight yaml %}
204
+ codecept gherkin: steps acceptance
156
205
206
+ {% endhighlight %}
157
207
158
- ## Bootstrap
159
208
160
- Creates default config, tests directory and sample suites for current project.
161
- Use this command to start building a test suite.
162
209
163
- By default, it will create 3 suites ** Acceptance** , ** Functional** , and ** Unit** .
164
210
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
211
+ ## Clean
170
212
213
+ Recursively cleans ` output ` directory and generated code.
171
214
215
+ * ` codecept clean `
172
216
173
217
174
- ## GenerateGroup
175
218
176
- Creates empty GroupObject - extension which handles all group events.
177
219
178
- * ` codecept g:group Admin `
220
+ ## Init
179
221
180
222
181
223
@@ -191,35 +233,31 @@ Generates Cest (scenario-driven object-oriented test) file:
191
233
192
234
193
235
194
- ## GherkinSteps
195
-
196
- Prints all steps from all Gherkin contexts for a specific suite
197
-
198
- {% highlight yaml %}
199
- codecept gherkin: steps acceptance
200
-
201
- {% endhighlight %}
236
+ ## Console
202
237
238
+ Try to execute test commands in run-time. You may try commands before writing the test.
203
239
240
+ * ` codecept console acceptance ` - starts acceptance suite environment. If you use WebDriver you can manipulate browser with Codeception commands.
204
241
205
242
206
- ## GenerateFeature
207
243
208
- Generates Feature file (in Gherkin):
244
+ ## GenerateSuite
209
245
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 `
246
+ Create new test suite. Requires suite name and actor name
213
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
214
252
215
253
216
254
217
- ## Clean
218
255
219
- Recursively cleans ` output ` directory and generated code.
256
+ ## GenerateGroup
220
257
221
- * ` codecept clean `
258
+ Creates empty GroupObject - extension which handles all group events.
222
259
260
+ * ` codecept g:group Admin `
223
261
224
262
225
263
@@ -233,56 +271,41 @@ Auto-updates phar archive from official site: 'https://codeception.com/codecept.
233
271
234
272
235
273
236
- ## GenerateEnvironment
237
-
238
- Generates empty environment configuration file into envs dir:
239
-
240
- * ` codecept g:env firefox `
241
-
242
- Required to have ` envs ` path to be specified in ` codeception.yml `
243
-
244
-
245
-
246
- ## GenerateStepObject
247
-
248
- Generates StepObject class. You will be asked for steps you want to implement.
249
-
250
- * ` codecept g:stepobject acceptance AdminSteps `
251
- * ` codecept g:stepobject acceptance UserSteps --silent ` - skip action questions
252
-
253
-
254
-
255
-
256
- ## Init
274
+ ## Build
257
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.
258
278
279
+ * ` codecept build `
280
+ * ` codecept build path/to/project `
259
281
260
- ## GenerateSuite
261
282
262
- Create new test suite. Requires suite name and actor name
263
283
264
- * ``
265
- * ` codecept g:suite api ` -> api + ApiTester
266
- * ` codecept g:suite integration Code ` -> integration + CodeTester
267
- * ` codecept g:suite frontend Front ` -> frontend + FrontTester
268
284
285
+ ## GenerateFeature
269
286
287
+ Generates Feature file (in Gherkin):
270
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 `
271
292
272
- ## GenerateTest
273
293
274
- Generates skeleton for Unit Test that extends ` Codeception\TestCase\Test ` .
275
294
276
- * ` codecept g:test unit User `
277
- * ` codecept g:test unit "App\User" `
278
295
296
+ ## Bootstrap
279
297
298
+ Creates default config, tests directory and sample suites for current project.
299
+ Use this command to start building a test suite.
280
300
281
- ## Console
301
+ By default, it will create 3 suites ** Acceptance ** , ** Functional ** , and ** Unit ** .
282
302
283
- Try to execute test commands in run-time. You may try commands before writing the test.
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
284
308
285
- * ` codecept console acceptance ` - starts acceptance suite environment. If you use WebDriver you can manipulate browser with Codeception commands.
286
309
287
310
288
311
@@ -310,27 +333,4 @@ Check overriding config values (like in `run` command)
310
333
311
334
312
335
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