@@ -5,14 +5,69 @@ title: Commands - Codeception - Documentation
55
66# Console Commands
77
8- ## GeneratePageObject
8+ ## DryRun
9+
10+ Shows step by step execution process for scenario driven tests without actually running them.
11+
12+ * ` codecept dry-run acceptance `
13+ * ` codecept dry-run acceptance MyCest `
14+ * ` codecept dry-run acceptance checkout.feature `
15+ * ` codecept dry-run tests/acceptance/MyCest.php `
916
10- Generates PageObject. Can be generated either globally, or just for one suite.
11- If PageObject is generated globally it will act as UIMap, without any logic in it.
1217
13- * ` codecept g:page Login `
14- * ` codecept g:page Registration `
15- * ` codecept g:page acceptance Login `
18+
19+
20+ ## GenerateCest
21+
22+ Generates Cest (scenario-driven object-oriented test) file:
23+
24+ * ` codecept generate:cest suite Login `
25+ * ` codecept g:cest suite subdir/subdir/testnameCest.php `
26+ * ` codecept g:cest suite LoginCest -c path/to/project `
27+ * ` codecept g:cest "App\Login" `
28+
29+
30+
31+
32+ ## GenerateSnapshot
33+
34+ Generates Snapshot.
35+ Snapshot can be used to test dynamical data.
36+ If suite name is provided, an actor class will be included into placeholder
37+
38+ * ` codecept g:snapshot UserEmails `
39+ * ` codecept g:snapshot Products `
40+ * ` codecept g:snapshot acceptance UserEmails `
41+
42+
43+
44+ ## GenerateHelper
45+
46+ Creates empty Helper class.
47+
48+ * ` codecept g:helper MyHelper `
49+ * ` codecept g:helper "My\Helper" `
50+
51+
52+
53+
54+ ## GenerateScenarios
55+
56+ Generates user-friendly text scenarios from scenario-driven tests (Cest).
57+
58+ * ` codecept g:scenarios acceptance ` - for all acceptance tests
59+ * ` codecept g:scenarios acceptance --format html ` - in html format
60+ * ` codecept g:scenarios acceptance --path doc ` - generate scenarios to ` doc ` dir
61+
62+
63+
64+ ## GenerateEnvironment
65+
66+ Generates empty environment configuration file into envs dir:
67+
68+ * ` codecept g:env firefox `
69+
70+ Required to have ` envs ` path to be specified in ` codeception.yml `
1671
1772
1873
@@ -30,6 +85,17 @@ Usage:
3085
3186
3287
88+ ## GenerateFeature
89+
90+ Generates Feature file (in Gherkin):
91+
92+ * ` codecept generate:feature suite Login `
93+ * ` codecept g:feature suite subdir/subdir/login.feature `
94+ * ` codecept g:feature suite login.feature -c path/to/project `
95+
96+
97+
98+
3399## Console
34100
35101Try to execute test commands in run-time. You may try commands before writing the test.
@@ -38,26 +104,63 @@ Try to execute test commands in run-time. You may try commands before writing th
38104
39105
40106
41- ## GenerateSnapshot
107+ ## Clean
42108
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
109+ Recursively cleans ` output ` directory and generated code.
46110
47- * ` codecept g:snapshot UserEmails `
48- * ` codecept g:snapshot Products `
49- * ` codecept g:snapshot acceptance UserEmails `
111+ * ` codecept clean `
50112
51113
52114
53- ## GenerateHelper
54115
55- Creates empty Helper class.
116+ ## GeneratePageObject
117+
118+ Generates PageObject. Can be generated either globally, or just for one suite.
119+ If PageObject is generated globally it will act as UIMap, without any logic in it.
120+
121+ * ` codecept g:page Login `
122+ * ` codecept g:page Registration `
123+ * ` codecept g:page acceptance Login `
56124
57- * ` codecept g:helper MyHelper `
58- * ` codecept g:helper "My\Helper" `
59125
60126
127+ ## GenerateStepObject
128+
129+ Generates StepObject class. You will be asked for steps you want to implement.
130+
131+ * ` codecept g:stepobject acceptance AdminSteps `
132+ * ` codecept g:stepobject acceptance UserSteps --silent ` - skip action questions
133+
134+
135+
136+
137+ ## SelfUpdate
138+
139+ Auto-updates phar archive from official site: 'https://codeception.com/codecept.phar ' .
140+
141+ * ` php codecept.phar self-update `
142+
143+ @author Franck Cassedanne
< [email protected] > 144+
145+
146+
147+ ## CompletionFallback
148+
149+
150+
151+ ## Build
152+
153+ Generates Actor classes (initially Guy classes) from suite configs.
154+ Starting from Codeception 2.0 actor classes are auto-generated. Use this command to generate them manually.
155+
156+ * ` codecept build `
157+ * ` codecept build path/to/project `
158+
159+
160+
161+
162+ ## Init
163+
61164
62165
63166## Run
@@ -148,87 +251,6 @@ Options:
148251
149252
150253
151- ## Bootstrap
152-
153- Creates default config, tests directory and sample suites for current project.
154- Use this command to start building a test suite.
155-
156- By default it will create 3 suites ** Acceptance** , ** Functional** , and ** Unit** .
157-
158- * ` codecept bootstrap ` - creates ` tests ` dir and ` codeception.yml ` in current dir.
159- * ` codecept bootstrap --empty ` - creates ` tests ` dir without suites
160- * ` codecept bootstrap --namespace Frontend ` - creates tests, and use ` Frontend ` namespace for actor classes and helpers.
161- * ` codecept bootstrap --actor Wizard ` - sets actor as Wizard, to have ` TestWizard ` actor in tests.
162- * ` codecept bootstrap path/to/the/project ` - provide different path to a project, where tests should be placed
163-
164-
165-
166-
167- ## SelfUpdate
168-
169- Auto-updates phar archive from official site: 'https://codeception.com/codecept.phar ' .
170-
171- * ` php codecept.phar self-update `
172-
173- @author Franck Cassedanne
< [email protected] > 174-
175-
176-
177- ## GenerateGroup
178-
179- Creates empty GroupObject - extension which handles all group events.
180-
181- * ` codecept g:group Admin `
182-
183-
184-
185-
186- ## GherkinSteps
187-
188- Prints all steps from all Gherkin contexts for a specific suite
189-
190- {% highlight yaml %}
191- codecept gherkin: steps acceptance
192-
193- {% endhighlight %}
194-
195-
196-
197-
198- ## Init
199-
200-
201-
202- ## GenerateEnvironment
203-
204- Generates empty environment configuration file into envs dir:
205-
206- * ` codecept g:env firefox `
207-
208- Required to have ` envs ` path to be specified in ` codeception.yml `
209-
210-
211-
212- ## GenerateScenarios
213-
214- Generates user-friendly text scenarios from scenario-driven tests (Cest).
215-
216- * ` codecept g:scenarios acceptance ` - for all acceptance tests
217- * ` codecept g:scenarios acceptance --format html ` - in html format
218- * ` codecept g:scenarios acceptance --path doc ` - generate scenarios to ` doc ` dir
219-
220-
221-
222- ## GenerateStepObject
223-
224- Generates StepObject class. You will be asked for steps you want to implement.
225-
226- * ` codecept g:stepobject acceptance AdminSteps `
227- * ` codecept g:stepobject acceptance UserSteps --silent ` - skip action questions
228-
229-
230-
231-
232254## GenerateTest
233255
234256Generates skeleton for Unit Test that extends ` Codeception\TestCase\Test ` .
@@ -262,13 +284,14 @@ Check overriding config values (like in `run` command)
262284
263285
264286
265- ## Build
287+ ## GherkinSteps
266288
267- Generates Actor classes (initially Guy classes) from suite configs.
268- Starting from Codeception 2.0 actor classes are auto-generated. Use this command to generate them manually.
289+ Prints all steps from all Gherkin contexts for a specific suite
269290
270- * ` codecept build `
271- * ` codecept build path/to/project `
291+ {% highlight yaml %}
292+ codecept gherkin: steps acceptance
293+
294+ {% endhighlight %}
272295
273296
274297
@@ -285,51 +308,28 @@ Create new test suite. Requires suite name and actor name
285308
286309
287310
288- ## GenerateFeature
289-
290- Generates Feature file (in Gherkin):
291-
292- * ` codecept generate:feature suite Login `
293- * ` codecept g:feature suite subdir/subdir/login.feature `
294- * ` codecept g:feature suite login.feature -c path/to/project `
295-
296-
297-
298-
299- ## DryRun
300-
301- Shows step by step execution process for scenario driven tests without actually running them.
302-
303- * ` codecept dry-run acceptance `
304- * ` codecept dry-run acceptance MyCest `
305- * ` codecept dry-run acceptance checkout.feature `
306- * ` codecept dry-run tests/acceptance/MyCest.php `
307-
308-
309-
310-
311- ## Clean
312-
313- Recursively cleans ` output ` directory and generated code.
314-
315- * ` codecept clean `
311+ ## Bootstrap
316312
313+ Creates default config, tests directory and sample suites for current project.
314+ Use this command to start building a test suite.
317315
316+ By default it will create 3 suites ** Acceptance** , ** Functional** , and ** Unit** .
318317
318+ * ` codecept bootstrap ` - creates ` tests ` dir and ` codeception.yml ` in current dir.
319+ * ` codecept bootstrap --empty ` - creates ` tests ` dir without suites
320+ * ` codecept bootstrap --namespace Frontend ` - creates tests, and use ` Frontend ` namespace for actor classes and helpers.
321+ * ` codecept bootstrap --actor Wizard ` - sets actor as Wizard, to have ` TestWizard ` actor in tests.
322+ * ` codecept bootstrap path/to/the/project ` - provide different path to a project, where tests should be placed
319323
320- ## GenerateCest
321324
322- Generates Cest (scenario-driven object-oriented test) file:
323325
324- * ` codecept generate:cest suite Login `
325- * ` codecept g:cest suite subdir/subdir/testnameCest.php `
326- * ` codecept g:cest suite LoginCest -c path/to/project `
327- * ` codecept g:cest "App\Login" `
328326
329327
328+ ## GenerateGroup
330329
330+ Creates empty GroupObject - extension which handles all group events.
331331
332- ## CompletionFallback
332+ * ` codecept g:group Admin `
333333
334334
335335
0 commit comments