@@ -5,38 +5,39 @@ title: Commands - Codeception - Documentation
55
66# Console Commands
77
8- ## GenerateSuite
9-
10- Create new test suite. Requires suite name and actor name
11-
12- * ``
13- * ` codecept g:suite api ` -> api + ApiTester
14- * ` codecept g:suite integration Code ` -> integration + CodeTester
15- * ` codecept g:suite frontend Front ` -> frontend + FrontTester
16-
17-
8+ ## DryRun
189
10+ Shows step by step execution process for scenario driven tests without actually running them.
1911
20- ## CompletionFallback
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 `
2116
2217
2318
24- ## GenerateStepObject
2519
26- Generates StepObject class. You will be asked for steps you want to implement.
20+ ## GenerateCest
2721
28- * ` codecept g:stepobject acceptance AdminSteps `
29- * ` codecept g:stepobject acceptance UserSteps --silent ` - skip action questions
22+ Generates Cest (scenario-driven object-oriented test) file:
3023
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" `
3128
3229
3330
34- ## Clean
3531
36- Recursively cleans ` output ` directory and generated code.
32+ ## GenerateSnapshot
3733
38- * ` codecept clean `
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
3937
38+ * ` codecept g:snapshot UserEmails `
39+ * ` codecept g:snapshot Products `
40+ * ` codecept g:snapshot acceptance UserEmails `
4041
4142
4243
@@ -60,50 +61,54 @@ Generates user-friendly text scenarios from scenario-driven tests (Cest).
6061
6162
6263
63- ## Bootstrap
64+ ## GenerateEnvironment
6465
65- Creates default config, tests directory and sample suites for current project.
66- Use this command to start building a test suite.
66+ Generates empty environment configuration file into envs dir:
6767
68- By default it will create 3 suites ** Acceptance ** , ** Functional ** , and ** Unit ** .
68+ * ` codecept g:env firefox `
6969
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
70+ Required to have ` envs ` path to be specified in ` codeception.yml `
7571
7672
7773
74+ ## GherkinSnippets
7875
79- ## Console
76+ Generates code snippets for matched feature files in a suite.
77+ Code snippets are expected to be implemented in Actor or PageObjects
8078
81- Try to execute test commands in run-time. You may try commands before writing the test.
79+ Usage:
8280
83- * ` codecept console acceptance ` - starts acceptance suite environment. If you use WebDriver you can manipulate browser with Codeception commands.
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
8485
8586
8687
87- ## Build
88+ ## GenerateFeature
8889
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.
90+ Generates Feature file (in Gherkin):
9191
92- * ` codecept build `
93- * ` codecept build path/to/project `
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 `
9495
9596
9697
9798
98- ## GenerateGroup
99+ ## Console
99100
100- Creates empty GroupObject - extension which handles all group events .
101+ Try to execute test commands in run-time. You may try commands before writing the test .
101102
102- * ` codecept g:group Admin `
103+ * ` codecept console acceptance ` - starts acceptance suite environment. If you use WebDriver you can manipulate browser with Codeception commands.
103104
104105
105106
106- ## Init
107+ ## Clean
108+
109+ Recursively cleans ` output ` directory and generated code.
110+
111+ * ` codecept clean `
107112
108113
109114
@@ -119,27 +124,42 @@ If PageObject is generated globally it will act as UIMap, without any logic in i
119124
120125
121126
122- ## GenerateSnapshot
127+ ## GenerateStepObject
123128
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
129+ Generates StepObject class. You will be asked for steps you want to implement.
127130
128- * ` codecept g:snapshot UserEmails `
129- * ` codecept g:snapshot Products `
130- * ` codecept g:snapshot acceptance UserEmails `
131+ * ` codecept g:stepobject acceptance AdminSteps `
132+ * ` codecept g:stepobject acceptance UserSteps --silent ` - skip action questions
131133
132134
133135
134- ## DryRun
135136
136- Shows step by step execution process for scenario driven tests without actually running them.
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+
137145
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 `
142146
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
143163
144164
145165
@@ -231,52 +251,12 @@ Options:
231251
232252
233253
234- ## GenerateCest
235-
236- Generates Cest (scenario-driven object-oriented test) file:
237-
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
254+ ## GenerateTest
273255
274- Usage:
256+ Generates skeleton for Unit Test that extends ` Codeception\TestCase\Test ` .
275257
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
258+ * ` codecept g:test unit User `
259+ * ` codecept g:test unit "App\User" `
280260
281261
282262
@@ -304,32 +284,52 @@ Check overriding config values (like in `run` command)
304284
305285
306286
307- ## GenerateEnvironment
287+ ## GherkinSteps
308288
309- Generates empty environment configuration file into envs dir:
289+ Prints all steps from all Gherkin contexts for a specific suite
310290
311- * ` codecept g:env firefox `
291+ {% highlight yaml %}
292+ codecept gherkin: steps acceptance
312293
313- Required to have ` envs ` path to be specified in ` codeception.yml `
294+ {% endhighlight %}
314295
315296
316297
317- ## SelfUpdate
318298
319- Auto-updates phar archive from official site: ' https://codeception.com/codecept.phar ' .
299+ ## GenerateSuite
320300
321- * ` php codecept.phar self-update `
301+ Create new test suite. Requires suite name and actor name
322302
323- @author Franck Cassedanne
< [email protected] > 303+ * ``
304+ * ` codecept g:suite api ` -> api + ApiTester
305+ * ` codecept g:suite integration Code ` -> integration + CodeTester
306+ * ` codecept g:suite frontend Front ` -> frontend + FrontTester
324307
325308
326309
327- ## GenerateTest
328310
329- Generates skeleton for Unit Test that extends ` Codeception\TestCase\Test ` .
311+ ## Bootstrap
330312
331- * ` codecept g:test unit User `
332- * ` codecept g:test unit "App\User" `
313+ Creates default config, tests directory and sample suites for current project.
314+ Use this command to start building a test suite.
315+
316+ By default it will create 3 suites ** Acceptance** , ** Functional** , and ** Unit** .
317+
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
323+
324+
325+
326+
327+
328+ ## GenerateGroup
329+
330+ Creates empty GroupObject - extension which handles all group events.
331+
332+ * ` codecept g:group Admin `
333333
334334
335335
0 commit comments