@@ -5,29 +5,30 @@ title: Commands - Codeception - Documentation
55
66# Console Commands
77
8- ## GenerateSuite
8+ ## CompletionFallback
99
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
1610
1711
12+ ## DryRun
1813
14+ Shows step by step execution process for scenario driven tests without actually running them.
1915
20- ## CompletionFallback
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 `
2120
2221
2322
24- ## GenerateStepObject
2523
26- Generates StepObject class. You will be asked for steps you want to implement.
24+ ## GeneratePageObject
2725
28- * ` codecept g:stepobject acceptance AdminSteps `
29- * ` codecept g:stepobject acceptance UserSteps --silent ` - skip action questions
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.
3028
29+ * ` codecept g:page Login `
30+ * ` codecept g:page Registration `
31+ * ` codecept g:page acceptance Login `
3132
3233
3334
@@ -40,12 +41,25 @@ Recursively cleans `output` directory and generated code.
4041
4142
4243
43- ## GenerateHelper
44+ ## GenerateSuite
4445
45- Creates empty Helper class.
46+ Create new test suite. Requires suite name and actor name
4647
47- * ` codecept g:helper MyHelper `
48- * ` codecept g:helper "My\Helper" `
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
57+
58+ Generates Feature file (in Gherkin):
59+
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 `
4963
5064
5165
@@ -60,37 +74,52 @@ Generates user-friendly text scenarios from scenario-driven tests (Cest).
6074
6175
6276
63- ## Bootstrap
77+ ## GenerateCest
6478
65- Creates default config, tests directory and sample suites for current project.
66- Use this command to start building a test suite.
79+ Generates Cest (scenario-driven object-oriented test) file:
6780
68- By default it will create 3 suites ** Acceptance** , ** Functional** , and ** Unit** .
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" `
6985
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
7586
7687
7788
89+ ## GherkinSnippets
7890
79- ## Console
91+ Generates code snippets for matched feature files in a suite.
92+ Code snippets are expected to be implemented in Actor or PageObjects
8093
81- Try to execute test commands in run-time. You may try commands before writing the test.
94+ Usage:
8295
83- * ` codecept console acceptance ` - starts acceptance suite environment. If you use WebDriver you can manipulate browser with Codeception commands.
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
84100
85101
86102
87- ## Build
103+ ## ConfigValidate
88104
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.
105+ Validates and prints Codeception config .
106+ Use it do debug Yaml configs
91107
92- * ` codecept build `
93- * ` codecept build path/to/project `
108+ Check config:
109+
110+ * ` codecept config ` : check global config
111+ * ` codecept config unit ` : check suite config
112+
113+ Load config:
114+
115+ * ` codecept config:validate -c path/to/another/config ` : from another dir
116+ * ` codecept config:validate -c another_config.yml ` : from another config file
117+
118+ Check overriding config values (like in ` run ` command)
119+
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
94123
95124
96125
@@ -103,19 +132,69 @@ Creates empty GroupObject - extension which handles all group events.
103132
104133
105134
106- ## Init
135+ ## GenerateStepObject
107136
137+ Generates StepObject class. You will be asked for steps you want to implement.
108138
139+ * ` codecept g:stepobject acceptance AdminSteps `
140+ * ` codecept g:stepobject acceptance UserSteps --silent ` - skip action questions
109141
110142
111- ## GeneratePageObject
112143
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.
115144
116- * ` codecept g:page Login `
117- * ` codecept g:page Registration `
118- * ` codecept g:page acceptance Login `
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+
185+
186+
187+
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" `
194+
195+
196+
197+ ## Init
119198
120199
121200
@@ -131,14 +210,11 @@ If suite name is provided, an actor class will be included into placeholder
131210
132211
133212
134- ## DryRun
213+ ## Console
135214
136- Shows step by step execution process for scenario driven tests without actually running them .
215+ Try to execute test commands in run-time. You may try commands before writing the test .
137216
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 `
217+ * ` codecept console acceptance ` - starts acceptance suite environment. If you use WebDriver you can manipulate browser with Codeception commands.
142218
143219
144220
@@ -231,75 +307,18 @@ Options:
231307
232308
233309
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
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:
310+ ## Bootstrap
294311
295- * ` codecept config:validate -c path/to/another/config ` : from another dir
296- * ` codecept config:validate -c another_config.yml ` : from another config file
312+ Creates default config, tests directory and sample suites for current project.
313+ Use this command to start building a test suite.
297314
298- Check overriding config values (like in ` run ` command)
315+ By default it will create 3 suites ** Acceptance ** , ** Functional ** , and ** Unit ** .
299316
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
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
303322
304323
305324
@@ -314,22 +333,3 @@ Required to have `envs` path to be specified in `codeception.yml`
314333
315334
316335
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