@@ -5,7 +5,13 @@ title: Commands - Codeception - Documentation
55
66# Console Commands
77
8- ## Init
8+ ## GenerateScenarios
9+
10+ Generates user-friendly text scenarios from scenario-driven tests (Cest).
11+
12+ * ` codecept g:scenarios acceptance ` - for all acceptance tests
13+ * ` codecept g:scenarios acceptance --format html ` - in html format
14+ * ` codecept g:scenarios acceptance --path doc ` - generate scenarios to ` doc ` dir
915
1016
1117
@@ -23,76 +29,66 @@ Usage:
2329
2430
2531
26- ## Console
27-
28- Try to execute test commands in run-time. You may try commands before writing the test.
29-
30- * ` codecept console acceptance ` - starts acceptance suite environment. If you use WebDriver you can manipulate browser with Codeception commands.
31-
32+ ## GenerateTest
3233
34+ Generates skeleton for Unit Test that extends ` Codeception\TestCase\Test ` .
3335
34- ## ConfigValidate
36+ * ` codecept g:test unit User `
37+ * ` codecept g:test unit "App\User" `
3538
36- Validates and prints Codeception config.
37- Use it do debug Yaml configs
3839
39- Check config:
4040
41- * ` codecept config ` : check global config
42- * ` codecept config unit ` : check suite config
41+ ## SelfUpdate
4342
44- Load config:
43+ Auto-updates phar archive from official site: ' https://codeception.com/codecept.phar ' .
4544
46- * ` codecept config:validate -c path/to/another/config ` : from another dir
47- * ` codecept config:validate -c another_config.yml ` : from another config file
45+ * ` php codecept.phar self-update `
4846
49- Check overriding config values (like in ` run ` command)
47+ @ author Franck Cassedanne < franck@cassedanne.com >
5048
51- * ` codecept config:validate -o "settings: shuffle: true" ` : enable shuffle
52- * ` codecept config:validate -o "settings: lint: false" ` : disable linting
53- * ` codecept config:validate -o "reporters: report: \Custom\Reporter" --report ` : use custom reporter
5449
5550
51+ ## GenerateFeature
5652
53+ Generates Feature file (in Gherkin):
5754
58- ## Clean
55+ * ` codecept generate:feature suite Login `
56+ * ` codecept g:feature suite subdir/subdir/login.feature `
57+ * ` codecept g:feature suite login.feature -c path/to/project `
5958
60- Recursively cleans ` output ` directory and generated code.
6159
62- * ` codecept clean `
6360
6461
62+ ## CompletionFallback
6563
6664
67- ## GenerateSnapshot
6865
69- Generates Snapshot.
70- Snapshot can be used to test dynamical data.
71- If suite name is provided, an actor class will be included into placeholder
66+ ## Console
7267
73- * ` codecept g:snapshot UserEmails `
74- * ` codecept g:snapshot Products `
75- * ` codecept g:snapshot acceptance UserEmails `
68+ Try to execute test commands in run-time. You may try commands before writing the test.
7669
70+ * ` codecept console acceptance ` - starts acceptance suite environment. If you use WebDriver you can manipulate browser with Codeception commands.
7771
7872
79- ## Build
8073
81- Generates Actor classes (initially Guy classes) from suite configs.
82- Starting from Codeception 2.0 actor classes are auto-generated. Use this command to generate them manually.
74+ ## GeneratePageObject
8375
84- * ` codecept build `
85- * ` codecept build path/to/project `
76+ Generates PageObject. Can be generated either globally, or just for one suite.
77+ If PageObject is generated globally it will act as UIMap, without any logic in it.
8678
79+ * ` codecept g:page Login `
80+ * ` codecept g:page Registration `
81+ * ` codecept g:page acceptance Login `
8782
8883
8984
85+ ## GenerateStepObject
9086
91- ## GenerateGroup
87+ Generates StepObject class. You will be asked for steps you want to implement.
9288
93- Creates empty GroupObject - extension which handles all group events.
89+ * ` codecept g:stepobject acceptance AdminSteps `
90+ * ` codecept g:stepobject acceptance UserSteps --silent ` - skip action questions
9491
95- * ` codecept g:group Admin `
9692
9793
9894
@@ -184,44 +180,38 @@ Options:
184180
185181
186182
187- ## SelfUpdate
183+ ## GherkinSteps
188184
189- Auto-updates phar archive from official site: ' https://codeception.com/codecept.phar ' .
185+ Prints all steps from all Gherkin contexts for a specific suite
190186
191- * ` php codecept.phar self-update `
187+ {% highlight yaml %}
188+ codecept gherkin: steps acceptance
192189
193- @ author Franck Cassedanne < franck@cassedanne.com >
190+ {% endhighlight %}
194191
195192
196193
197- ## GenerateTest
198194
199- Generates skeleton for Unit Test that extends ` Codeception\TestCase\Test ` .
195+ ## Clean
200196
201- * ` codecept g:test unit User `
202- * ` codecept g:test unit "App\User" `
197+ Recursively cleans ` output ` directory and generated code.
203198
199+ * ` codecept clean `
204200
205201
206- ## GenerateSuite
207202
208- Create new test suite. Requires suite name and actor name
209203
210- * ``
211- * ` codecept g:suite api ` -> api + ApiTester
212- * ` codecept g:suite integration Code ` -> integration + CodeTester
213- * ` codecept g:suite frontend Front ` -> frontend + FrontTester
204+ ## GenerateHelper
214205
206+ Creates empty Helper class.
215207
208+ * ` codecept g:helper MyHelper `
209+ * ` codecept g:helper "My\Helper" `
216210
217211
218- ## GenerateScenarios
219212
220- Generates user-friendly text scenarios from scenario-driven tests (Cest).
221213
222- * ` codecept g:scenarios acceptance ` - for all acceptance tests
223- * ` codecept g:scenarios acceptance --format html ` - in html format
224- * ` codecept g:scenarios acceptance --path doc ` - generate scenarios to ` doc ` dir
214+ ## Init
225215
226216
227217
@@ -237,12 +227,37 @@ Generates Cest (scenario-driven object-oriented test) file:
237227
238228
239229
240- ## GenerateHelper
230+ ## ConfigValidate
241231
242- Creates empty Helper class.
232+ Validates and prints Codeception config.
233+ Use it do debug Yaml configs
243234
244- * ` codecept g:helper MyHelper `
245- * ` codecept g:helper "My\Helper" `
235+ Check config:
236+
237+ * ` codecept config ` : check global config
238+ * ` codecept config unit ` : check suite config
239+
240+ Load config:
241+
242+ * ` codecept config:validate -c path/to/another/config ` : from another dir
243+ * ` codecept config:validate -c another_config.yml ` : from another config file
244+
245+ Check overriding config values (like in ` run ` command)
246+
247+ * ` codecept config:validate -o "settings: shuffle: true" ` : enable shuffle
248+ * ` codecept config:validate -o "settings: lint: false" ` : disable linting
249+ * ` codecept config:validate -o "reporters: report: \Custom\Reporter" --report ` : use custom reporter
250+
251+
252+
253+
254+ ## Build
255+
256+ Generates Actor classes (initially Guy classes) from suite configs.
257+ Starting from Codeception 2.0 actor classes are auto-generated. Use this command to generate them manually.
258+
259+ * ` codecept build `
260+ * ` codecept build path/to/project `
246261
247262
248263
@@ -263,24 +278,24 @@ By default it will create 3 suites **acceptance**, **functional**, and **unit**.
263278
264279
265280
266- ## GenerateStepObject
281+ ## GenerateSuite
267282
268- Generates StepObject class. You will be asked for steps you want to implement.
283+ Create new test suite. Requires suite name and actor name
269284
270- * ` codecept g:stepobject acceptance AdminSteps `
271- * ` codecept g:stepobject acceptance UserSteps --silent ` - skip action questions
285+ * ``
286+ * ` codecept g:suite api ` -> api + ApiTester
287+ * ` codecept g:suite integration Code ` -> integration + CodeTester
288+ * ` codecept g:suite frontend Front ` -> frontend + FrontTester
272289
273290
274291
275292
276- ## GeneratePageObject
293+ ## GenerateGroup
277294
278- Generates PageObject. Can be generated either globally, or just for one suite.
279- If PageObject is generated globally it will act as UIMap, without any logic in it.
295+ Creates empty GroupObject - extension which handles all group events.
296+
297+ * ` codecept g:group Admin `
280298
281- * ` codecept g:page Login `
282- * ` codecept g:page Registration `
283- * ` codecept g:page acceptance Login `
284299
285300
286301
@@ -294,17 +309,6 @@ Required to have `envs` path to be specified in `codeception.yml`
294309
295310
296311
297- ## GenerateFeature
298-
299- Generates Feature file (in Gherkin):
300-
301- * ` codecept generate:feature suite Login `
302- * ` codecept g:feature suite subdir/subdir/login.feature `
303- * ` codecept g:feature suite login.feature -c path/to/project `
304-
305-
306-
307-
308312## DryRun
309313
310314Shows step by step execution process for scenario driven tests without actually running them.
@@ -317,19 +321,15 @@ Shows step by step execution process for scenario driven tests without actually
317321
318322
319323
320- ## GherkinSteps
321-
322- Prints all steps from all Gherkin contexts for a specific suite
323-
324- {% highlight yaml %}
325- codecept gherkin: steps acceptance
326-
327- {% endhighlight %}
328-
329-
324+ ## GenerateSnapshot
330325
326+ Generates Snapshot.
327+ Snapshot can be used to test dynamical data.
328+ If suite name is provided, an actor class will be included into placeholder
331329
332- ## CompletionFallback
330+ * ` codecept g:snapshot UserEmails `
331+ * ` codecept g:snapshot Products `
332+ * ` codecept g:snapshot acceptance UserEmails `
333333
334334
335335
0 commit comments