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