@@ -5,39 +5,38 @@ title: Commands - Codeception - Documentation
55
66# Console Commands
77
8- ## DryRun
8+ ## GenerateSuite
99
10- Shows step by step execution process for scenario driven tests without actually running them.
10+ Create new test suite. Requires suite name and actor name
1111
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 `
12+ * ``
13+ * ` codecept g:suite api ` -> api + ApiTester
14+ * ` codecept g:suite integration Code ` -> integration + CodeTester
15+ * ` codecept g:suite frontend Front ` -> frontend + FrontTester
1616
1717
1818
1919
20- ## GenerateCest
20+ ## CompletionFallback
2121
22- Generates Cest (scenario-driven object-oriented test) file:
2322
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" `
2823
24+ ## GenerateStepObject
2925
26+ Generates StepObject class. You will be asked for steps you want to implement.
3027
28+ * ` codecept g:stepobject acceptance AdminSteps `
29+ * ` codecept g:stepobject acceptance UserSteps --silent ` - skip action questions
3130
32- ## GenerateSnapshot
3331
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
3732
38- * ` codecept g:snapshot UserEmails `
39- * ` codecept g:snapshot Products `
40- * ` codecept g:snapshot acceptance UserEmails `
33+
34+ ## Clean
35+
36+ Recursively cleans ` output ` directory and generated code.
37+
38+ * ` codecept clean `
39+
4140
4241
4342
@@ -61,54 +60,50 @@ Generates user-friendly text scenarios from scenario-driven tests (Cest).
6160
6261
6362
64- ## GenerateEnvironment
65-
66- Generates empty environment configuration file into envs dir:
67-
68- * ` codecept g:env firefox `
63+ ## Bootstrap
6964
70- Required to have ` envs ` path to be specified in ` codeception.yml `
65+ Creates default config, tests directory and sample suites for current project.
66+ Use this command to start building a test suite.
7167
68+ By default it will create 3 suites ** Acceptance** , ** Functional** , and ** Unit** .
7269
70+ * ` codecept bootstrap ` - creates ` tests ` dir and ` codeception.yml ` in current dir.
71+ * ` codecept bootstrap --empty ` - creates ` tests ` dir without suites
72+ * ` codecept bootstrap --namespace Frontend ` - creates tests, and use ` Frontend ` namespace for actor classes and helpers.
73+ * ` codecept bootstrap --actor Wizard ` - sets actor as Wizard, to have ` TestWizard ` actor in tests.
74+ * ` codecept bootstrap path/to/the/project ` - provide different path to a project, where tests should be placed
7375
74- ## GherkinSnippets
7576
76- Generates code snippets for matched feature files in a suite.
77- Code snippets are expected to be implemented in Actor or PageObjects
7877
79- Usage:
8078
81- * ` codecept gherkin:snippets acceptance ` - snippets from all feature of acceptance tests
82- * ` codecept gherkin:snippets acceptance/feature/users ` - snippets from ` feature/users ` dir of acceptance tests
83- * ` codecept gherkin:snippets acceptance user_account.feature ` - snippets from a single feature file
84- * ` codecept gherkin:snippets acceptance/feature/users/user_accout.feature ` - snippets from feature file in a dir
79+ ## Console
8580
81+ Try to execute test commands in run-time. You may try commands before writing the test.
8682
83+ * ` codecept console acceptance ` - starts acceptance suite environment. If you use WebDriver you can manipulate browser with Codeception commands.
8784
88- ## GenerateFeature
8985
90- Generates Feature file (in Gherkin):
9186
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 `
87+ ## Build
9588
89+ Generates Actor classes (initially Guy classes) from suite configs.
90+ Starting from Codeception 2.0 actor classes are auto-generated. Use this command to generate them manually.
9691
92+ * ` codecept build `
93+ * ` codecept build path/to/project `
9794
9895
99- ## Console
10096
101- Try to execute test commands in run-time. You may try commands before writing the test.
10297
103- * ` codecept console acceptance ` - starts acceptance suite environment. If you use WebDriver you can manipulate browser with Codeception commands.
98+ ## GenerateGroup
10499
100+ Creates empty GroupObject - extension which handles all group events.
105101
102+ * ` codecept g:group Admin `
106103
107- ## Clean
108104
109- Recursively cleans ` output ` directory and generated code.
110105
111- * ` codecept clean `
106+ ## Init
112107
113108
114109
@@ -124,42 +119,27 @@ If PageObject is generated globally it will act as UIMap, without any logic in i
124119
125120
126121
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-
122+ ## GenerateSnapshot
149123
124+ Generates Snapshot.
125+ Snapshot can be used to test dynamical data.
126+ If suite name is provided, an actor class will be included into placeholder
150127
151- ## Build
128+ * ` codecept g:snapshot UserEmails `
129+ * ` codecept g:snapshot Products `
130+ * ` codecept g:snapshot acceptance UserEmails `
152131
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.
155132
156- * ` codecept build `
157- * ` codecept build path/to/project `
158133
134+ ## DryRun
159135
136+ Shows step by step execution process for scenario driven tests without actually running them.
160137
138+ * ` codecept dry-run acceptance `
139+ * ` codecept dry-run acceptance MyCest `
140+ * ` codecept dry-run acceptance checkout.feature `
141+ * ` codecept dry-run tests/acceptance/MyCest.php `
161142
162- ## Init
163143
164144
165145
@@ -251,12 +231,52 @@ Options:
251231
252232
253233
254- ## GenerateTest
234+ ## GenerateCest
255235
256- Generates skeleton for Unit Test that extends ` Codeception\TestCase\Test ` .
236+ Generates Cest (scenario-driven object-oriented test) file:
257237
258- * ` codecept g:test unit User `
259- * ` codecept g:test unit "App\User" `
238+ * ` codecept generate:cest suite Login `
239+ * ` codecept g:cest suite subdir/subdir/testnameCest.php `
240+ * ` codecept g:cest suite LoginCest -c path/to/project `
241+ * ` codecept g:cest "App\Login" `
242+
243+
244+
245+
246+ ## GherkinSteps
247+
248+ Prints all steps from all Gherkin contexts for a specific suite
249+
250+ {% highlight yaml %}
251+ codecept gherkin: steps acceptance
252+
253+ {% endhighlight %}
254+
255+
256+
257+
258+ ## GenerateFeature
259+
260+ Generates Feature file (in Gherkin):
261+
262+ * ` codecept generate:feature suite Login `
263+ * ` codecept g:feature suite subdir/subdir/login.feature `
264+ * ` codecept g:feature suite login.feature -c path/to/project `
265+
266+
267+
268+
269+ ## GherkinSnippets
270+
271+ Generates code snippets for matched feature files in a suite.
272+ Code snippets are expected to be implemented in Actor or PageObjects
273+
274+ Usage:
275+
276+ * ` codecept gherkin:snippets acceptance ` - snippets from all feature of acceptance tests
277+ * ` codecept gherkin:snippets acceptance/feature/users ` - snippets from ` feature/users ` dir of acceptance tests
278+ * ` codecept gherkin:snippets acceptance user_account.feature ` - snippets from a single feature file
279+ * ` codecept gherkin:snippets acceptance/feature/users/user_accout.feature ` - snippets from feature file in a dir
260280
261281
262282
@@ -284,52 +304,32 @@ Check overriding config values (like in `run` command)
284304
285305
286306
287- ## GherkinSteps
288-
289- Prints all steps from all Gherkin contexts for a specific suite
290-
291- {% highlight yaml %}
292- codecept gherkin: steps acceptance
293-
294- {% endhighlight %}
295-
296-
297-
298-
299- ## GenerateSuite
300-
301- Create new test suite. Requires suite name and actor name
302-
303- * ``
304- * ` codecept g:suite api ` -> api + ApiTester
305- * ` codecept g:suite integration Code ` -> integration + CodeTester
306- * ` codecept g:suite frontend Front ` -> frontend + FrontTester
307+ ## GenerateEnvironment
307308
309+ Generates empty environment configuration file into envs dir:
308310
311+ * ` codecept g:env firefox `
309312
313+ Required to have ` envs ` path to be specified in ` codeception.yml `
310314
311- ## Bootstrap
312315
313- Creates default config, tests directory and sample suites for current project.
314- Use this command to start building a test suite.
315316
316- By default it will create 3 suites ** Acceptance ** , ** Functional ** , and ** Unit ** .
317+ ## SelfUpdate
317318
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
319+ Auto-updates phar archive from official site: 'https://codeception.com/codecept.phar ' .
323320
321+ * ` php codecept.phar self-update `
324322
323+ @author Franck Cassedanne
< [email protected] > 325324
326325
327326
328- ## GenerateGroup
327+ ## GenerateTest
329328
330- Creates empty GroupObject - extension which handles all group events .
329+ Generates skeleton for Unit Test that extends ` Codeception\TestCase\Test ` .
331330
332- * ` codecept g:group Admin `
331+ * ` codecept g:test unit User `
332+ * ` codecept g:test unit "App\User" `
333333
334334
335335
0 commit comments