@@ -5,70 +5,11 @@ 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-
19-
20- ## DryRun
21-
22- Shows step-by-step execution process for scenario driven tests without actually running them.
23-
24- * ` codecept dry-run acceptance `
25- * ` codecept dry-run acceptance MyCest `
26- * ` codecept dry-run acceptance checkout.feature `
27- * ` codecept dry-run tests/acceptance/MyCest.php `
28-
29-
30-
31-
328## Init
339
3410
3511
36- ## GenerateCest
37-
38- Generates Cest (scenario-driven object-oriented test) file:
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" `
44-
45-
46-
47-
48- ## SelfUpdate
49-
50- Auto-updates phar archive from official site: 'https://codeception.com/codecept.phar ' .
51-
52- * ` php codecept.phar self-update `
53-
54- @author Franck Cassedanne
< [email protected] > 55-
56-
57-
58- ## GenerateTest
59-
60- Generates skeleton for Unit Test that extends ` Codeception\TestCase\Test ` .
61-
62- * ` codecept g:test unit User `
63- * ` codecept g:test unit "App\User" `
64-
65-
66-
67- ## GenerateGroup
68-
69- Creates empty GroupObject - extension which handles all group events.
70-
71- * ` codecept g:group Admin `
12+ ## CompletionFallback
7213
7314
7415
@@ -161,50 +102,102 @@ Options:
161102
162103
163104
164- ## CompletionFallback
105+ ## Clean
106+
107+ Recursively cleans ` output ` directory and generated code.
165108
109+ * ` codecept clean `
166110
167111
168- ## GenerateStepObject
169112
170- Generates StepObject class. You will be asked for steps you want to implement.
171113
172- * ` codecept g:stepobject acceptance AdminSteps `
173- * ` codecept g:stepobject acceptance UserSteps --silent ` - skip action questions
114+ ## Console
174115
116+ Try to execute test commands in run-time. You may try commands before writing the test.
175117
118+ * ` codecept console acceptance ` - starts acceptance suite environment. If you use WebDriver you can manipulate browser with Codeception commands.
176119
177120
178- ## GenerateSnapshot
179121
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
122+ ## GenerateGroup
183123
184- * ` codecept g:snapshot UserEmails `
185- * ` codecept g:snapshot Products `
186- * ` codecept g:snapshot acceptance UserEmails `
124+ Creates empty GroupObject - extension which handles all group events.
187125
126+ * ` codecept g:group Admin `
188127
189128
190- ## GenerateScenarios
191129
192- Generates user-friendly text scenarios from scenario-driven tests (Cest).
130+ ## GherkinSnippets
193131
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
132+ Generates code snippets for matched feature files in a suite.
133+ Code snippets are expected to be implemented in Actor or PageObjects
197134
135+ Usage:
198136
137+ * ` codecept gherkin:snippets acceptance ` - snippets from all feature of acceptance tests
138+ * ` codecept gherkin:snippets acceptance/feature/users ` - snippets from ` feature/users ` dir of acceptance tests
139+ * ` codecept gherkin:snippets acceptance user_account.feature ` - snippets from a single feature file
140+ * ` codecept gherkin:snippets acceptance/feature/users/user_accout.feature ` - snippets from feature file in a dir
199141
200- ## GeneratePageObject
201142
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.
204143
205- * ` codecept g:page Login `
206- * ` codecept g:page Registration `
207- * ` codecept g:page acceptance Login `
144+ ## GenerateCest
145+
146+ Generates Cest (scenario-driven object-oriented test) file:
147+
148+ * ` codecept generate:cest suite Login `
149+ * ` codecept g:cest suite subdir/subdir/testnameCest.php `
150+ * ` codecept g:cest suite LoginCest -c path/to/project `
151+ * ` codecept g:cest "App\Login" `
152+
153+
154+
155+
156+ ## Bootstrap
157+
158+ Creates default config, tests directory and sample suites for current project.
159+ Use this command to start building a test suite.
160+
161+ By default, it will create 3 suites ** Acceptance** , ** Functional** , and ** Unit** .
162+
163+ * ` codecept bootstrap ` - creates ` tests ` dir and ` codeception.yml ` in current dir.
164+ * ` codecept bootstrap --empty ` - creates ` tests ` dir without suites
165+ * ` codecept bootstrap --namespace Frontend ` - creates tests, and use ` Frontend ` namespace for actor classes and helpers.
166+ * ` codecept bootstrap --actor Wizard ` - sets actor as Wizard, to have ` TestWizard ` actor in tests.
167+ * ` codecept bootstrap path/to/the/project ` - provide different path to a project, where tests should be placed
168+
169+
170+
171+
172+ ## GenerateFeature
173+
174+ Generates Feature file (in Gherkin):
175+
176+ * ` codecept generate:feature suite Login `
177+ * ` codecept g:feature suite subdir/subdir/login.feature `
178+ * ` codecept g:feature suite login.feature -c path/to/project `
179+
180+
181+
182+
183+ ## GenerateTest
184+
185+ Generates skeleton for Unit Test that extends ` Codeception\TestCase\Test ` .
186+
187+ * ` codecept g:test unit User `
188+ * ` codecept g:test unit "App\User" `
189+
190+
191+
192+ ## GenerateSnapshot
193+
194+ Generates Snapshot.
195+ Snapshot can be used to test dynamical data.
196+ If suite name is provided, an actor class will be included into placeholder
197+
198+ * ` codecept g:snapshot UserEmails `
199+ * ` codecept g:snapshot Products `
200+ * ` codecept g:snapshot acceptance UserEmails `
208201
209202
210203
@@ -232,104 +225,111 @@ Check overriding config values (like in `run` command)
232225
233226
234227
235- ## GenerateHelper
228+ ## GenerateSuite
236229
237- Creates empty Helper class.
230+ Create new test suite. Requires suite name and actor name
238231
239- * ` codecept g:helper MyHelper `
240- * ` codecept g:helper "My\Helper" `
232+ * ``
233+ * ` codecept g:suite api ` -> api + ApiTester
234+ * ` codecept g:suite integration Code ` -> integration + CodeTester
235+ * ` codecept g:suite frontend Front ` -> frontend + FrontTester
241236
242237
243238
244239
245- ## Bootstrap
240+ ## GherkinSteps
246241
247- Creates default config, tests directory and sample suites for current project.
248- Use this command to start building a test suite.
242+ Prints all steps from all Gherkin contexts for a specific suite
249243
250- By default, it will create 3 suites ** Acceptance** , ** Functional** , and ** Unit** .
244+ {% highlight yaml %}
245+ codecept gherkin: steps acceptance
251246
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
247+ {% endhighlight %}
257248
258249
259250
260251
261- ## GenerateEnvironment
252+ ## Build
262253
263- Generates empty environment configuration file into envs dir:
254+ Generates Actor classes (initially Guy classes) from suite configs.
255+ Starting from Codeception 2.0 actor classes are auto-generated. Use this command to generate them manually.
264256
265- * ` codecept g:env firefox `
257+ * ` codecept build `
258+ * ` codecept build path/to/project `
266259
267- Required to have ` envs ` path to be specified in ` codeception.yml `
268260
269261
270262
271- ## Console
263+ ## DryRun
272264
273- Try to execute test commands in run-time. You may try commands before writing the test .
265+ Shows step-by-step execution process for scenario driven tests without actually running them .
274266
275- * ` codecept console acceptance ` - starts acceptance suite environment. If you use WebDriver you can manipulate browser with Codeception commands.
267+ * ` codecept dry-run acceptance `
268+ * ` codecept dry-run acceptance MyCest `
269+ * ` codecept dry-run acceptance checkout.feature `
270+ * ` codecept dry-run tests/acceptance/MyCest.php `
276271
277272
278273
279- ## GenerateSuite
280274
281- Create new test suite. Requires suite name and actor name
275+ ## GenerateScenarios
282276
283- * ``
284- * ` codecept g:suite api ` -> api + ApiTester
285- * ` codecept g:suite integration Code ` -> integration + CodeTester
286- * ` codecept g:suite frontend Front ` -> frontend + FrontTester
277+ Generates user-friendly text scenarios from scenario-driven tests (Cest).
287278
279+ * ` codecept g:scenarios acceptance ` - for all acceptance tests
280+ * ` codecept g:scenarios acceptance --format html ` - in html format
281+ * ` codecept g:scenarios acceptance --path doc ` - generate scenarios to ` doc ` dir
288282
289283
290284
291- ## Build
285+ ## GenerateEnvironment
292286
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.
287+ Generates empty environment configuration file into envs dir:
295288
296- * ` codecept build `
297- * ` codecept build path/to/project `
289+ * ` codecept g:env firefox `
298290
291+ Required to have ` envs ` path to be specified in ` codeception.yml `
299292
300293
301294
302- ## Clean
295+ ## GeneratePageObject
303296
304- Recursively cleans ` output ` directory and generated code.
297+ Generates PageObject. Can be generated either globally, or just for one suite.
298+ If PageObject is generated globally it will act as UIMap, without any logic in it.
305299
306- * ` codecept clean `
300+ * ` codecept g:page Login `
301+ * ` codecept g:page Registration `
302+ * ` codecept g:page acceptance Login `
307303
308304
309305
306+ ## GenerateHelper
310307
308+ Creates empty Helper class.
311309
312- ## GherkinSnippets
310+ * ` codecept g:helper MyHelper `
311+ * ` codecept g:helper "My\Helper" `
313312
314- Generates code snippets for matched feature files in a suite.
315- Code snippets are expected to be implemented in Actor or PageObjects
316313
317- Usage:
318314
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
323315
324316
317+ ## SelfUpdate
325318
326- ## GenerateFeature
319+ Auto-updates phar archive from official site: ' https://codeception.com/codecept.phar ' .
327320
328- Generates Feature file (in Gherkin):
321+ * ` php codecept.phar self-update `
329322
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 `
323+ @author Franck Cassedanne
< [email protected] > 324+
325+
326+
327+ ## GenerateStepObject
328+
329+ Generates StepObject class. You will be asked for steps you want to implement.
330+
331+ * ` codecept g:stepobject acceptance AdminSteps `
332+ * ` codecept g:stepobject acceptance UserSteps --silent ` - skip action questions
333333
334334
335335
0 commit comments