@@ -5,22 +5,32 @@ title: Commands - Codeception - Documentation
55
66# Console Commands
77
8- ## Build
8+ ## GenerateHelper
99
10- Generates Actor classes (initially Guy classes) from suite configs.
11- Starting from Codeception 2.0 actor classes are auto-generated. Use this command to generate them manually.
10+ Creates empty Helper class.
1211
13- * ` codecept build `
14- * ` codecept build path/to/project `
12+ * ` codecept g:helper MyHelper `
13+ * ` codecept g:helper "My\Helper" `
1514
1615
1716
17+ ## GenerateTest
1818
19- ## Console
19+ Generates skeleton for Unit Test that extends ` Codeception\TestCase\Test ` .
20+
21+ * ` codecept g:test Unit User `
22+ * ` codecept g:test Unit "App\User" `
2023
21- Try to execute test commands in run-time. You may try commands before writing the test.
2224
23- * ` codecept console Acceptance ` - starts acceptance suite environment. If you use WebDriver you can manipulate browser with Codeception commands.
25+
26+ ## Build
27+
28+ Generates Actor classes (initially Guy classes) from suite configs.
29+ Starting from Codeception 2.0 actor classes are auto-generated. Use this command to generate them manually.
30+
31+ * ` codecept build `
32+ * ` codecept build path/to/project `
33+
2434
2535
2636
@@ -38,93 +48,27 @@ Usage:
3848
3949
4050
41- ## GenerateSnapshot
42-
43- Generates Snapshot.
44- Snapshot can be used to test dynamical data.
45- If suite name is provided, an actor class will be included into placeholder
46-
47- * ` codecept g:snapshot UserEmails `
48- * ` codecept g:snapshot Products `
49- * ` codecept g:snapshot Acceptance UserEmails `
50-
51-
52-
53- ## GenerateFeature
54-
55- Generates Feature file (in Gherkin):
56-
57- * ` codecept generate:feature suite Login `
58- * ` codecept g:feature suite subdir/subdir/login.feature `
59- * ` codecept g:feature suite login.feature -c path/to/project `
60-
61-
62-
63-
64- ## GherkinSteps
65-
66- Prints all steps from all Gherkin contexts for a specific suite
67-
68- {% highlight yaml %}
69- codecept gherkin: steps Acceptance
70-
71- {% endhighlight %}
72-
73-
74-
75- ## CompletionFallback
76-
77-
78-
79- ## GenerateStepObject
80-
81- Generates StepObject class. You will be asked for steps you want to implement.
82-
83- * ` codecept g:stepobject Acceptance AdminSteps `
84- * ` codecept g:stepobject Acceptance UserSteps --silent ` - skip action questions
85-
86-
87-
88-
89- ## GenerateHelper
90-
91- Creates empty Helper class.
92-
93- * ` codecept g:helper MyHelper `
94- * ` codecept g:helper "My\Helper" `
95-
96-
97-
98-
99- ## GenerateEnvironment
100-
101- Generates empty environment configuration file into envs dir:
102-
103- * ` codecept g:env firefox `
104-
105- Required to have ` envs ` path to be specified in ` codeception.yml `
106-
107-
108-
109- ## DryRun
51+ ## ConfigValidate
11052
111- Shows step-by-step execution process for scenario driven tests without actually running them.
53+ Validates and prints Codeception config.
54+ Use it do debug Yaml configs
11255
113- * ` codecept dry-run Acceptance `
114- * ` codecept dry-run Acceptance MyCest `
115- * ` codecept dry-run Acceptance checkout.feature `
116- * ` codecept dry-run tests/Acceptance/MyCest.php `
56+ Check config:
11757
58+ * ` codecept config ` : check global config
59+ * ` codecept config Unit ` : check suite config
11860
61+ Load config:
11962
63+ * ` codecept config:validate -c path/to/another/config ` : from another dir
64+ * ` codecept config:validate -c another_config.yml ` : from another config file
12065
121- ## GenerateScenarios
66+ Check overriding config values (like in ` run ` command)
12267
123- Generates user-friendly text scenarios from scenario-driven tests (Cest).
68+ * ` codecept config:validate -o "settings: shuffle: true" ` : enable shuffle
69+ * ` codecept config:validate -o "settings: lint: false" ` : disable linting
70+ * ` codecept config:validate -o "reporters: report: \Custom\Reporter" --report ` : use custom reporter
12471
125- * ` codecept g:scenarios Acceptance ` - for all acceptance tests
126- * ` codecept g:scenarios Acceptance --format html ` - in html format
127- * ` codecept g:scenarios Acceptance --path doc ` - generate scenarios to ` doc ` dir
12872
12973
13074
@@ -221,46 +165,57 @@ Options:
221165
222166
223167
224- ## ConfigValidate
168+ ## GenerateSuite
225169
226- Validates and prints Codeception config.
227- Use it do debug Yaml configs
170+ Create new test suite. Requires suite name and actor name
228171
229- Check config:
172+ * ``
173+ * ` codecept g:suite Api ` -> api + ApiTester
174+ * ` codecept g:suite Integration Code ` -> integration + CodeTester
175+ * ` codecept g:suite Frontend Front ` -> frontend + FrontTester
230176
231- * ` codecept config ` : check global config
232- * ` codecept config Unit ` : check suite config
233177
234- Load config:
235178
236- * ` codecept config:validate -c path/to/another/config ` : from another dir
237- * ` codecept config:validate -c another_config.yml ` : from another config file
238179
239- Check overriding config values (like in ` run ` command)
180+ ## Clean
240181
241- * ` codecept config:validate -o "settings: shuffle: true" ` : enable shuffle
242- * ` codecept config:validate -o "settings: lint: false" ` : disable linting
243- * ` codecept config:validate -o "reporters: report: \Custom\Reporter" --report ` : use custom reporter
182+ Recursively cleans ` output ` directory and generated code.
244183
184+ * ` codecept clean `
245185
246186
247187
248- ## GeneratePageObject
249188
250- Generates PageObject. Can be generated either globally, or just for one suite.
251- If PageObject is generated globally it will act as UIMap, without any logic in it.
252189
253- * ` codecept g:page Login `
254- * ` codecept g:page Registration `
255- * ` codecept g:page Acceptance Login `
190+ ## GenerateEnvironment
256191
192+ Generates empty environment configuration file into envs dir:
257193
194+ * ` codecept g:env firefox `
258195
259- ## GenerateGroup
196+ Required to have ` envs ` path to be specified in ` codeception.yml `
260197
261- Creates empty GroupObject - extension which handles all group events.
262198
263- * ` codecept g:group Admin `
199+
200+ ## Init
201+
202+
203+
204+ ## Console
205+
206+ Try to execute test commands in run-time. You may try commands before writing the test.
207+
208+ * ` codecept console Acceptance ` - starts acceptance suite environment. If you use WebDriver you can manipulate browser with Codeception commands.
209+
210+
211+
212+ ## SelfUpdate
213+
214+ Auto-updates phar archive from official site: 'https://codeception.com/codecept.phar ' .
215+
216+ * ` php codecept.phar self-update `
217+
218+ @author Franck Cassedanne < franck@cassedanne.com >
264219
265220
266221
@@ -280,58 +235,103 @@ By default, it will create 3 suites **Acceptance**, **Functional**, and **Unit**
280235
281236
282237
283- ## Init
238+ ## GenerateStepObject
284239
240+ Generates StepObject class. You will be asked for steps you want to implement.
285241
242+ * ` codecept g:stepobject Acceptance AdminSteps `
243+ * ` codecept g:stepobject Acceptance UserSteps --silent ` - skip action questions
286244
287- ## SelfUpdate
288245
289- Auto-updates phar archive from official site: 'https://codeception.com/codecept.phar ' .
290246
291- * ` php codecept.phar self-update `
292247
293- @ author Franck Cassedanne < franck@cassedanne.com >
248+ ## DryRun
294249
250+ Shows step-by-step execution process for scenario driven tests without actually running them.
295251
252+ * ` codecept dry-run Acceptance `
253+ * ` codecept dry-run Acceptance MyCest `
254+ * ` codecept dry-run Acceptance checkout.feature `
255+ * ` codecept dry-run tests/Acceptance/MyCest.php `
296256
297- ## GenerateTest
298257
299- Generates skeleton for Unit Test that extends ` Codeception\TestCase\Test ` .
300258
301- * ` codecept g:test Unit User `
302- * ` codecept g:test Unit "App\User" `
303259
260+ ## GenerateSnapshot
304261
262+ Generates Snapshot.
263+ Snapshot can be used to test dynamical data.
264+ If suite name is provided, an actor class will be included into placeholder
305265
306- ## GenerateCest
266+ * ` codecept g:snapshot UserEmails `
267+ * ` codecept g:snapshot Products `
268+ * ` codecept g:snapshot Acceptance UserEmails `
307269
308- Generates Cest (scenario-driven object-oriented test) file:
309270
310- * ` codecept generate:cest suite Login `
311- * ` codecept g:cest suite subdir/subdir/testnameCest.php `
312- * ` codecept g:cest suite LoginCest -c path/to/project `
313- * ` codecept g:cest "App\Login" `
314271
272+ ## CompletionFallback
315273
316274
317275
318- ## GenerateSuite
276+ ## GenerateScenarios
319277
320- Create new test suite. Requires suite name and actor name
278+ Generates user-friendly text scenarios from scenario-driven tests (Cest).
321279
322- * ``
323- * ` codecept g:suite Api ` -> api + ApiTester
324- * ` codecept g:suite Integration Code ` -> integration + CodeTester
325- * ` codecept g:suite Frontend Front ` -> frontend + FrontTester
280+ * ` codecept g:scenarios Acceptance ` - for all acceptance tests
281+ * ` codecept g:scenarios Acceptance --format html ` - in html format
282+ * ` codecept g:scenarios Acceptance --path doc ` - generate scenarios to ` doc ` dir
326283
327284
328285
286+ ## GenerateGroup
329287
330- ## Clean
288+ Creates empty GroupObject - extension which handles all group events.
331289
332- Recursively cleans ` output ` directory and generated code.
290+ * ` codecept g:group Admin `
333291
334- * ` codecept clean `
292+
293+
294+ ## GeneratePageObject
295+
296+ Generates PageObject. Can be generated either globally, or just for one suite.
297+ If PageObject is generated globally it will act as UIMap, without any logic in it.
298+
299+ * ` codecept g:page Login `
300+ * ` codecept g:page Registration `
301+ * ` codecept g:page Acceptance Login `
302+
303+
304+
305+ ## GherkinSteps
306+
307+ Prints all steps from all Gherkin contexts for a specific suite
308+
309+ {% highlight yaml %}
310+ codecept gherkin: steps Acceptance
311+
312+ {% endhighlight %}
313+
314+
315+
316+ ## GenerateCest
317+
318+ Generates Cest (scenario-driven object-oriented test) file:
319+
320+ * ` codecept generate:cest suite Login `
321+ * ` codecept g:cest suite subdir/subdir/testnameCest.php `
322+ * ` codecept g:cest suite LoginCest -c path/to/project `
323+ * ` codecept g:cest "App\Login" `
324+
325+
326+
327+
328+ ## GenerateFeature
329+
330+ Generates Feature file (in Gherkin):
331+
332+ * ` codecept generate:feature suite Login `
333+ * ` codecept g:feature suite subdir/subdir/login.feature `
334+ * ` codecept g:feature suite login.feature -c path/to/project `
335335
336336
337337
0 commit comments