@@ -5,17 +5,6 @@ title: Commands - Codeception - Documentation
55
66# Console Commands
77
8- ## GherkinSteps
9-
10- Prints all steps from all Gherkin contexts for a specific suite
11-
12- {% highlight yaml %}
13- codecept gherkin: steps Acceptance
14-
15- {% endhighlight %}
16-
17-
18-
198## GenerateStepObject
209
2110Generates StepObject class. You will be asked for steps you want to implement.
@@ -26,20 +15,21 @@ Generates StepObject class. You will be asked for steps you want to implement.
2615
2716
2817
29- ## Bootstrap
18+ ## GenerateHelper
3019
31- Creates default config, tests directory and sample suites for current project.
32- Use this command to start building a test suite.
20+ Creates empty Helper class.
3321
34- By default, it will create 3 suites ** Acceptance** , ** Functional** , and ** Unit** .
22+ * ` codecept g:helper MyHelper `
23+ * ` codecept g:helper "My\Helper" `
3524
36- * ` codecept bootstrap ` - creates ` tests ` dir and ` codeception.yml ` in current dir.
37- * ` codecept bootstrap --empty ` - creates ` tests ` dir without suites
38- * ` codecept bootstrap --namespace Frontend ` - creates tests, and use ` Frontend ` namespace for actor classes and helpers.
39- * ` codecept bootstrap --actor Wizard ` - sets actor as Wizard, to have ` TestWizard ` actor in tests.
40- * ` codecept bootstrap path/to/the/project ` - provide different path to a project, where tests should be placed
4125
4226
27+ ## GenerateGroup
28+
29+ Creates empty GroupObject - extension which handles all group events.
30+
31+ * ` codecept g:group Admin `
32+
4333
4434
4535## GherkinSnippets
@@ -56,6 +46,62 @@ Usage:
5646
5747
5848
49+ ## Clean
50+
51+ Recursively cleans ` output ` directory and generated code.
52+
53+ * ` codecept clean `
54+
55+
56+
57+
58+ ## Console
59+
60+ Try to execute test commands in run-time. You may try commands before writing the test.
61+
62+ * ` codecept console Acceptance ` - starts acceptance suite environment. If you use WebDriver you can manipulate browser with Codeception commands.
63+
64+
65+
66+ ## CompletionFallback
67+
68+
69+
70+ ## GenerateSnapshot
71+
72+ Generates Snapshot.
73+ Snapshot can be used to test dynamical data.
74+ If suite name is provided, an actor class will be included into placeholder
75+
76+ * ` codecept g:snapshot UserEmails `
77+ * ` codecept g:snapshot Products `
78+ * ` codecept g:snapshot Acceptance UserEmails `
79+
80+
81+
82+
83+ ## GenerateScenarios
84+
85+ Generates user-friendly text scenarios from scenario-driven tests (Cest).
86+
87+ * ` codecept g:scenarios Acceptance ` - for all acceptance tests
88+ * ` codecept g:scenarios Acceptance --format html ` - in html format
89+ * ` codecept g:scenarios Acceptance --path doc ` - generate scenarios to ` doc ` dir
90+
91+
92+
93+ ## GenerateCest
94+
95+ Generates Cest (scenario-driven object-oriented test) file:
96+
97+ * ` codecept generate:cest suite Login `
98+ * ` codecept g:cest suite subdir/subdir/testnameCest.php `
99+ * ` codecept g:cest suite LoginCest -c path/to/project `
100+ * ` codecept g:cest "App\Login" `
101+
102+
103+
104+
59105## Run
60106
61107Executes tests.
@@ -149,24 +195,18 @@ Options:
149195
150196
151197
152- ## GenerateCest
153-
154- Generates Cest (scenario-driven object-oriented test) file:
155-
156- * ` codecept generate:cest suite Login `
157- * ` codecept g:cest suite subdir/subdir/testnameCest.php `
158- * ` codecept g:cest suite LoginCest -c path/to/project `
159- * ` codecept g:cest "App\Login" `
160-
161-
162-
198+ ## Bootstrap
163199
164- ## GenerateHelper
200+ Creates default config, tests directory and sample suites for current project.
201+ Use this command to start building a test suite.
165202
166- Creates empty Helper class .
203+ By default, it will create 3 suites ** Acceptance ** , ** Functional ** , and ** Unit ** .
167204
168- * ` codecept g:helper MyHelper `
169- * ` codecept g:helper "My\Helper" `
205+ * ` codecept bootstrap ` - creates ` tests ` dir and ` codeception.yml ` in current dir.
206+ * ` codecept bootstrap --empty ` - creates ` tests ` dir without suites
207+ * ` codecept bootstrap --namespace Frontend ` - creates tests, and use ` Frontend ` namespace for actor classes and helpers.
208+ * ` codecept bootstrap --actor Wizard ` - sets actor as Wizard, to have ` TestWizard ` actor in tests.
209+ * ` codecept bootstrap path/to/the/project ` - provide different path to a project, where tests should be placed
170210
171211
172212
@@ -193,16 +233,6 @@ Starting from Codeception 2.0 actor classes are auto-generated. Use this command
193233
194234
195235
196- ## GenerateEnvironment
197-
198- Generates empty environment configuration file into envs dir:
199-
200- * ` codecept g:env firefox `
201-
202- Required to have ` envs ` path to be specified in ` codeception.yml `
203-
204-
205-
206236## SelfUpdate
207237
208238Auto-updates phar archive from official site: 'https://codeception.com/codecept.phar ' .
@@ -213,103 +243,85 @@ Auto-updates phar archive from official site: 'https://codeception.com/codecept.
213243
214244
215245
216- ## DryRun
217-
218- Shows step-by-step execution process for scenario driven tests without actually running them.
219-
220- * ` codecept dry-run Acceptance `
221- * ` codecept dry-run Acceptance MyCest `
222- * ` codecept dry-run Acceptance checkout.feature `
223- * ` codecept dry-run tests/Acceptance/MyCest.php `
224-
225-
226-
227-
228- ## ConfigValidate
229-
230- Validates and prints Codeception config.
231- Use it do debug Yaml configs
232-
233- Check config:
234-
235- * ` codecept config ` : check global config
236- * ` codecept config Unit ` : check suite config
237-
238- Load config:
239-
240- * ` codecept config:validate -c path/to/another/config ` : from another dir
241- * ` codecept config:validate -c another_config.yml ` : from another config file
242-
243- Check overriding config values (like in ` run ` command)
246+ ## GherkinSteps
244247
245- * ` codecept config:validate -o "settings: shuffle: true" ` : enable shuffle
246- * ` codecept config:validate -o "settings: lint: false" ` : disable linting
247- * ` codecept config:validate -o "reporters: report: \Custom\Reporter" --report ` : use custom reporter
248+ Prints all steps from all Gherkin contexts for a specific suite
248249
250+ {% highlight yaml %}
251+ codecept gherkin: steps Acceptance
249252
253+ {% endhighlight %}
250254
251255
252- ## Init
253256
257+ ## GenerateSuite
254258
259+ Create new test suite. Requires suite name and actor name
255260
256- ## CompletionFallback
261+ * ``
262+ * ` codecept g:suite Api ` -> api + ApiTester
263+ * ` codecept g:suite Integration Code ` -> integration + CodeTester
264+ * ` codecept g:suite Frontend Front ` -> frontend + FrontTester
257265
258266
259267
260- ## GenerateScenarios
261268
262- Generates user-friendly text scenarios from scenario-driven tests (Cest).
269+ ## GenerateEnvironment
263270
264- * ` codecept g:scenarios Acceptance ` - for all acceptance tests
265- * ` codecept g:scenarios Acceptance --format html ` - in html format
266- * ` codecept g:scenarios Acceptance --path doc ` - generate scenarios to ` doc ` dir
271+ Generates empty environment configuration file into envs dir:
267272
273+ * ` codecept g:env firefox `
268274
275+ Required to have ` envs ` path to be specified in ` codeception.yml `
269276
270- ## Console
271277
272- Try to execute test commands in run-time. You may try commands before writing the test.
273278
274- * ` codecept console Acceptance ` - starts acceptance suite environment. If you use WebDriver you can manipulate browser with Codeception commands.
279+ ## Init
275280
276281
277282
278- ## Clean
283+ ## GenerateTest
279284
280- Recursively cleans ` output ` directory and generated code .
285+ Generates skeleton for Unit Test that extends ` Codeception\TestCase\Test ` .
281286
282- * ` codecept clean `
287+ * ` codecept g:test Unit User `
288+ * ` codecept g:test Unit "App\User" `
283289
284290
285291
292+ ## DryRun
286293
287- ## GenerateSuite
294+ Shows step-by-step execution process for scenario driven tests without actually running them.
288295
289- Create new test suite. Requires suite name and actor name
296+ * ` codecept dry-run Acceptance `
297+ * ` codecept dry-run Acceptance MyCest `
298+ * ` codecept dry-run Acceptance checkout.feature `
299+ * ` codecept dry-run tests/Acceptance/MyCest.php `
290300
291- * ``
292- * ` codecept g:suite Api ` -> api + ApiTester
293- * ` codecept g:suite Integration Code ` -> integration + CodeTester
294- * ` codecept g:suite Frontend Front ` -> frontend + FrontTester
295301
296302
297303
304+ ## ConfigValidate
298305
299- ## GenerateGroup
306+ Validates and prints Codeception config.
307+ Use it do debug Yaml configs
300308
301- Creates empty GroupObject - extension which handles all group events.
309+ Check config:
302310
303- * ` codecept g:group Admin `
311+ * ` codecept config ` : check global config
312+ * ` codecept config Unit ` : check suite config
304313
314+ Load config:
305315
316+ * ` codecept config:validate -c path/to/another/config ` : from another dir
317+ * ` codecept config:validate -c another_config.yml ` : from another config file
306318
307- ## GenerateTest
319+ Check overriding config values (like in ` run ` command)
308320
309- Generates skeleton for Unit Test that extends ` Codeception\TestCase\Test ` .
321+ * ` codecept config:validate -o "settings: shuffle: true" ` : enable shuffle
322+ * ` codecept config:validate -o "settings: lint: false" ` : disable linting
323+ * ` codecept config:validate -o "reporters: report: \Custom\Reporter" --report ` : use custom reporter
310324
311- * ` codecept g:test Unit User `
312- * ` codecept g:test Unit "App\User" `
313325
314326
315327
@@ -324,15 +336,3 @@ Generates Feature file (in Gherkin):
324336
325337
326338
327- ## GenerateSnapshot
328-
329- Generates Snapshot.
330- Snapshot can be used to test dynamical data.
331- If suite name is provided, an actor class will be included into placeholder
332-
333- * ` codecept g:snapshot UserEmails `
334- * ` codecept g:snapshot Products `
335- * ` codecept g:snapshot Acceptance UserEmails `
336-
337-
338-
0 commit comments