@@ -5,30 +5,29 @@ title: Commands - Codeception - Documentation
55
66# Console Commands
77
8- ## CompletionFallback
8+ ## GenerateSuite
99
10+ Create new test suite. Requires suite name and actor name
1011
12+ * ``
13+ * ` codecept g:suite api ` -> api + ApiTester
14+ * ` codecept g:suite integration Code ` -> integration + CodeTester
15+ * ` codecept g:suite frontend Front ` -> frontend + FrontTester
1116
12- ## DryRun
1317
14- Shows step by step execution process for scenario driven tests without actually running them.
1518
16- * ` codecept dry-run acceptance `
17- * ` codecept dry-run acceptance MyCest `
18- * ` codecept dry-run acceptance checkout.feature `
19- * ` codecept dry-run tests/acceptance/MyCest.php `
2019
20+ ## CompletionFallback
2121
2222
2323
24- ## GeneratePageObject
24+ ## GenerateStepObject
2525
26- Generates PageObject. Can be generated either globally, or just for one suite.
27- If PageObject is generated globally it will act as UIMap, without any logic in it.
26+ Generates StepObject class. You will be asked for steps you want to implement.
27+
28+ * ` codecept g:stepobject acceptance AdminSteps `
29+ * ` codecept g:stepobject acceptance UserSteps --silent ` - skip action questions
2830
29- * ` codecept g:page Login `
30- * ` codecept g:page Registration `
31- * ` codecept g:page acceptance Login `
3231
3332
3433
@@ -41,25 +40,12 @@ Recursively cleans `output` directory and generated code.
4140
4241
4342
44- ## GenerateSuite
45-
46- Create new test suite. Requires suite name and actor name
47-
48- * ``
49- * ` codecept g:suite api ` -> api + ApiTester
50- * ` codecept g:suite integration Code ` -> integration + CodeTester
51- * ` codecept g:suite frontend Front ` -> frontend + FrontTester
52-
53-
54-
55-
56- ## GenerateFeature
43+ ## GenerateHelper
5744
58- Generates Feature file (in Gherkin):
45+ Creates empty Helper class.
5946
60- * ` codecept generate:feature suite Login `
61- * ` codecept g:feature suite subdir/subdir/login.feature `
62- * ` codecept g:feature suite login.feature -c path/to/project `
47+ * ` codecept g:helper MyHelper `
48+ * ` codecept g:helper "My\Helper" `
6349
6450
6551
@@ -74,52 +60,37 @@ Generates user-friendly text scenarios from scenario-driven tests (Cest).
7460
7561
7662
77- ## GenerateCest
78-
79- Generates Cest (scenario-driven object-oriented test) file:
80-
81- * ` codecept generate:cest suite Login `
82- * ` codecept g:cest suite subdir/subdir/testnameCest.php `
83- * ` codecept g:cest suite LoginCest -c path/to/project `
84- * ` codecept g:cest "App\Login" `
85-
86-
87-
63+ ## Bootstrap
8864
89- ## GherkinSnippets
65+ Creates default config, tests directory and sample suites for current project.
66+ Use this command to start building a test suite.
9067
91- Generates code snippets for matched feature files in a suite.
92- Code snippets are expected to be implemented in Actor or PageObjects
68+ By default it will create 3 suites ** Acceptance** , ** Functional** , and ** Unit** .
9369
94- Usage:
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
9575
96- * ` codecept gherkin:snippets acceptance ` - snippets from all feature of acceptance tests
97- * ` codecept gherkin:snippets acceptance/feature/users ` - snippets from ` feature/users ` dir of acceptance tests
98- * ` codecept gherkin:snippets acceptance user_account.feature ` - snippets from a single feature file
99- * ` codecept gherkin:snippets acceptance/feature/users/user_accout.feature ` - snippets from feature file in a dir
10076
10177
10278
103- ## ConfigValidate
79+ ## Console
10480
105- Validates and prints Codeception config.
106- Use it do debug Yaml configs
81+ Try to execute test commands in run-time. You may try commands before writing the test.
10782
108- Check config:
83+ * ` codecept console acceptance ` - starts acceptance suite environment. If you use WebDriver you can manipulate browser with Codeception commands.
10984
110- * ` codecept config ` : check global config
111- * ` codecept config unit ` : check suite config
11285
113- Load config:
11486
115- * ` codecept config:validate -c path/to/another/config ` : from another dir
116- * ` codecept config:validate -c another_config.yml ` : from another config file
87+ ## Build
11788
118- Check overriding config values (like in ` run ` command)
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.
11991
120- * ` codecept config:validate -o "settings: shuffle: true" ` : enable shuffle
121- * ` codecept config:validate -o "settings: lint: false" ` : disable linting
122- * ` codecept config:validate -o "reporters: report: \Custom\Reporter" --report ` : use custom reporter
92+ * ` codecept build `
93+ * ` codecept build path/to/project `
12394
12495
12596
@@ -132,69 +103,19 @@ Creates empty GroupObject - extension which handles all group events.
132103
133104
134105
135- ## GenerateStepObject
136-
137- Generates StepObject class. You will be asked for steps you want to implement.
138-
139- * ` codecept g:stepobject acceptance AdminSteps `
140- * ` codecept g:stepobject acceptance UserSteps --silent ` - skip action questions
141-
142-
143-
144-
145- ## SelfUpdate
146-
147- Auto-updates phar archive from official site: 'https://codeception.com/codecept.phar ' .
148-
149- * ` php codecept.phar self-update `
150-
151- @author Franck Cassedanne < franck@cassedanne.com >
152-
153-
154-
155- ## GherkinSteps
156-
157- Prints all steps from all Gherkin contexts for a specific suite
158-
159- {% highlight yaml %}
160- codecept gherkin: steps acceptance
161-
162- {% endhighlight %}
163-
164-
165-
166-
167- ## GenerateHelper
168-
169- Creates empty Helper class.
170-
171- * ` codecept g:helper MyHelper `
172- * ` codecept g:helper "My\Helper" `
173-
174-
175-
176-
177- ## Build
178-
179- Generates Actor classes (initially Guy classes) from suite configs.
180- Starting from Codeception 2.0 actor classes are auto-generated. Use this command to generate them manually.
181-
182- * ` codecept build `
183- * ` codecept build path/to/project `
184-
106+ ## Init
185107
186108
187109
188- ## GenerateTest
189-
190- Generates skeleton for Unit Test that extends ` Codeception\TestCase\Test ` .
191-
192- * ` codecept g:test unit User `
193- * ` codecept g:test unit "App\User" `
194110
111+ ## GeneratePageObject
195112
113+ Generates PageObject. Can be generated either globally, or just for one suite.
114+ If PageObject is generated globally it will act as UIMap, without any logic in it.
196115
197- ## Init
116+ * ` codecept g:page Login `
117+ * ` codecept g:page Registration `
118+ * ` codecept g:page acceptance Login `
198119
199120
200121
@@ -210,11 +131,14 @@ If suite name is provided, an actor class will be included into placeholder
210131
211132
212133
213- ## Console
134+ ## DryRun
214135
215- Try to execute test commands in run-time. You may try commands before writing the test .
136+ Shows step by step execution process for scenario driven tests without actually running them .
216137
217- * ` codecept console acceptance ` - starts acceptance suite environment. If you use WebDriver you can manipulate browser with Codeception commands.
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 `
218142
219143
220144
@@ -307,18 +231,75 @@ Options:
307231
308232
309233
310- ## Bootstrap
234+ ## GenerateCest
311235
312- Creates default config, tests directory and sample suites for current project.
313- Use this command to start building a test suite.
236+ Generates Cest (scenario-driven object-oriented test) file:
314237
315- By default it will create 3 suites ** Acceptance** , ** Functional** , and ** Unit** .
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" `
316242
317- * ` codecept bootstrap ` - creates ` tests ` dir and ` codeception.yml ` in current dir.
318- * ` codecept bootstrap --empty ` - creates ` tests ` dir without suites
319- * ` codecept bootstrap --namespace Frontend ` - creates tests, and use ` Frontend ` namespace for actor classes and helpers.
320- * ` codecept bootstrap --actor Wizard ` - sets actor as Wizard, to have ` TestWizard ` actor in tests.
321- * ` codecept bootstrap path/to/the/project ` - provide different path to a project, where tests should be placed
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
280+
281+
282+
283+ ## ConfigValidate
284+
285+ Validates and prints Codeception config.
286+ Use it do debug Yaml configs
287+
288+ Check config:
289+
290+ * ` codecept config ` : check global config
291+ * ` codecept config unit ` : check suite config
292+
293+ Load config:
294+
295+ * ` codecept config:validate -c path/to/another/config ` : from another dir
296+ * ` codecept config:validate -c another_config.yml ` : from another config file
297+
298+ Check overriding config values (like in ` run ` command)
299+
300+ * ` codecept config:validate -o "settings: shuffle: true" ` : enable shuffle
301+ * ` codecept config:validate -o "settings: lint: false" ` : disable linting
302+ * ` codecept config:validate -o "reporters: report: \Custom\Reporter" --report ` : use custom reporter
322303
323304
324305
@@ -333,3 +314,22 @@ Required to have `envs` path to be specified in `codeception.yml`
333314
334315
335316
317+ ## SelfUpdate
318+
319+ Auto-updates phar archive from official site: 'https://codeception.com/codecept.phar ' .
320+
321+ * ` php codecept.phar self-update `
322+
323+ @author Franck Cassedanne < franck@cassedanne.com >
324+
325+
326+
327+ ## GenerateTest
328+
329+ Generates skeleton for Unit Test that extends ` Codeception\TestCase\Test ` .
330+
331+ * ` codecept g:test unit User `
332+ * ` codecept g:test unit "App\User" `
333+
334+
335+
0 commit comments