@@ -5,61 +5,6 @@ title: Commands - Codeception - Documentation
55
66# Console Commands
77
8- ## GeneratePageObject
9-
10- Generates PageObject. Can be generated either globally, or just for one suite.
11- If PageObject is generated globally it will act as UIMap, without any logic in it.
12-
13- * ` codecept g:page Login `
14- * ` codecept g:page Registration `
15- * ` codecept g:page acceptance Login `
16-
17-
18-
19- ## GherkinSnippets
20-
21- Generates code snippets for matched feature files in a suite.
22- Code snippets are expected to be implemented in Actor or PageObjects
23-
24- Usage:
25-
26- * ` codecept gherkin:snippets acceptance ` - snippets from all feature of acceptance tests
27- * ` codecept gherkin:snippets acceptance/feature/users ` - snippets from ` feature/users ` dir of acceptance tests
28- * ` codecept gherkin:snippets acceptance user_account.feature ` - snippets from a single feature file
29- * ` codecept gherkin:snippets acceptance/feature/users/user_accout.feature ` - snippets from feature file in a dir
30-
31-
32-
33- ## Console
34-
35- Try to execute test commands in run-time. You may try commands before writing the test.
36-
37- * ` codecept console acceptance ` - starts acceptance suite environment. If you use WebDriver you can manipulate browser with Codeception commands.
38-
39-
40-
41- ## GenerateSnapshot
42-
43- Generates Snapshot.
44- Snapshot can be used to test dynamical data.
45- If suite name is provided, an actor class will be included into placeholder
46-
47- * ` codecept g:snapshot UserEmails `
48- * ` codecept g:snapshot Products `
49- * ` codecept g:snapshot acceptance UserEmails `
50-
51-
52-
53- ## GenerateHelper
54-
55- Creates empty Helper class.
56-
57- * ` codecept g:helper MyHelper `
58- * ` codecept g:helper "My\Helper" `
59-
60-
61-
62-
638## Run
649
6510Executes tests.
@@ -148,6 +93,16 @@ Options:
14893
14994
15095
96+ ## GenerateScenarios
97+
98+ Generates user-friendly text scenarios from scenario-driven tests (Cest).
99+
100+ * ` codecept g:scenarios acceptance ` - for all acceptance tests
101+ * ` codecept g:scenarios acceptance --format html ` - in html format
102+ * ` codecept g:scenarios acceptance --path doc ` - generate scenarios to ` doc ` dir
103+
104+
105+
151106## Bootstrap
152107
153108Creates default config, tests directory and sample suites for current project.
@@ -164,21 +119,32 @@ By default it will create 3 suites **Acceptance**, **Functional**, and **Unit**.
164119
165120
166121
167- ## SelfUpdate
122+ ## Build
168123
169- Auto-updates phar archive from official site: 'https://codeception.com/codecept.phar ' .
124+ Generates Actor classes (initially Guy classes) from suite configs.
125+ Starting from Codeception 2.0 actor classes are auto-generated. Use this command to generate them manually.
170126
171- * ` php codecept.phar self-update `
127+ * ` codecept build `
128+ * ` codecept build path/to/project `
172129
173- @author Franck Cassedanne
< [email protected] > 174130
175131
176132
177- ## GenerateGroup
133+ ## GenerateTest
178134
179- Creates empty GroupObject - extension which handles all group events .
135+ Generates skeleton for Unit Test that extends ` Codeception\TestCase\Test ` .
180136
181- * ` codecept g:group Admin `
137+ * ` codecept g:test unit User `
138+ * ` codecept g:test unit "App\User" `
139+
140+
141+
142+ ## GenerateHelper
143+
144+ Creates empty Helper class.
145+
146+ * ` codecept g:helper MyHelper `
147+ * ` codecept g:helper "My\Helper" `
182148
183149
184150
@@ -195,27 +161,59 @@ codecept gherkin:steps acceptance
195161
196162
197163
198- ## Init
164+ ## GenerateSuite
199165
166+ Create new test suite. Requires suite name and actor name
200167
168+ * ``
169+ * ` codecept g:suite api ` -> api + ApiTester
170+ * ` codecept g:suite integration Code ` -> integration + CodeTester
171+ * ` codecept g:suite frontend Front ` -> frontend + FrontTester
201172
202- ## GenerateEnvironment
203173
204- Generates empty environment configuration file into envs dir:
205174
206- * ` codecept g:env firefox `
207175
208- Required to have ` envs ` path to be specified in ` codeception.yml `
176+ ## GenerateSnapshot
209177
178+ Generates Snapshot.
179+ Snapshot can be used to test dynamical data.
180+ If suite name is provided, an actor class will be included into placeholder
210181
182+ * ` codecept g:snapshot UserEmails `
183+ * ` codecept g:snapshot Products `
184+ * ` codecept g:snapshot acceptance UserEmails `
211185
212- ## GenerateScenarios
213186
214- Generates user-friendly text scenarios from scenario-driven tests (Cest).
215187
216- * ` codecept g:scenarios acceptance ` - for all acceptance tests
217- * ` codecept g:scenarios acceptance --format html ` - in html format
218- * ` codecept g:scenarios acceptance --path doc ` - generate scenarios to ` doc ` dir
188+ ## GenerateGroup
189+
190+ Creates empty GroupObject - extension which handles all group events.
191+
192+ * ` codecept g:group Admin `
193+
194+
195+
196+ ## GherkinSnippets
197+
198+ Generates code snippets for matched feature files in a suite.
199+ Code snippets are expected to be implemented in Actor or PageObjects
200+
201+ Usage:
202+
203+ * ` codecept gherkin:snippets acceptance ` - snippets from all feature of acceptance tests
204+ * ` codecept gherkin:snippets acceptance/feature/users ` - snippets from ` feature/users ` dir of acceptance tests
205+ * ` codecept gherkin:snippets acceptance user_account.feature ` - snippets from a single feature file
206+ * ` codecept gherkin:snippets acceptance/feature/users/user_accout.feature ` - snippets from feature file in a dir
207+
208+
209+
210+ ## SelfUpdate
211+
212+ Auto-updates phar archive from official site: 'https://codeception.com/codecept.phar ' .
213+
214+ * ` php codecept.phar self-update `
215+
216+ @author Franck Cassedanne
< [email protected] > 219217
220218
221219
@@ -229,59 +227,58 @@ Generates StepObject class. You will be asked for steps you want to implement.
229227
230228
231229
232- ## GenerateTest
230+ ## Console
233231
234- Generates skeleton for Unit Test that extends ` Codeception\TestCase\Test ` .
232+ Try to execute test commands in run-time. You may try commands before writing the test .
235233
236- * ` codecept g:test unit User `
237- * ` codecept g:test unit "App\User" `
234+ * ` codecept console acceptance ` - starts acceptance suite environment. If you use WebDriver you can manipulate browser with Codeception commands.
238235
239236
240237
241- ## ConfigValidate
238+ ## GenerateEnvironment
242239
243- Validates and prints Codeception config.
244- Use it do debug Yaml configs
240+ Generates empty environment configuration file into envs dir:
245241
246- Check config:
242+ * ` codecept g:env firefox `
247243
248- * ` codecept config ` : check global config
249- * ` codecept config unit ` : check suite config
244+ Required to have ` envs ` path to be specified in ` codeception.yml `
250245
251- Load config:
252246
253- * ` codecept config:validate -c path/to/another/config ` : from another dir
254- * ` codecept config:validate -c another_config.yml ` : from another config file
255247
256- Check overriding config values (like in ` run ` command)
248+ ## Clean
257249
258- * ` codecept config:validate -o "settings: shuffle: true" ` : enable shuffle
259- * ` codecept config:validate -o "settings: lint: false" ` : disable linting
260- * ` codecept config:validate -o "reporters: report: \Custom\Reporter" --report ` : use custom reporter
250+ Recursively cleans ` output ` directory and generated code.
261251
252+ * ` codecept clean `
262253
263254
264255
265- ## Build
266256
267- Generates Actor classes (initially Guy classes) from suite configs.
268- Starting from Codeception 2.0 actor classes are auto-generated. Use this command to generate them manually.
257+ ## GenerateCest
269258
270- * ` codecept build `
271- * ` codecept build path/to/project `
259+ Generates Cest (scenario-driven object-oriented test) file:
272260
261+ * ` codecept generate:cest suite Login `
262+ * ` codecept g:cest suite subdir/subdir/testnameCest.php `
263+ * ` codecept g:cest suite LoginCest -c path/to/project `
264+ * ` codecept g:cest "App\Login" `
273265
274266
275267
276- ## GenerateSuite
277268
278- Create new test suite. Requires suite name and actor name
279269
280- * ``
281- * ` codecept g:suite api ` -> api + ApiTester
282- * ` codecept g:suite integration Code ` -> integration + CodeTester
283- * ` codecept g:suite frontend Front ` -> frontend + FrontTester
270+ ## GeneratePageObject
284271
272+ Generates PageObject. Can be generated either globally, or just for one suite.
273+ If PageObject is generated globally it will act as UIMap, without any logic in it.
274+
275+ * ` codecept g:page Login `
276+ * ` codecept g:page Registration `
277+ * ` codecept g:page acceptance Login `
278+
279+
280+
281+ ## Init
285282
286283
287284
@@ -296,35 +293,38 @@ Generates Feature file (in Gherkin):
296293
297294
298295
299- ## DryRun
300-
301- Shows step by step execution process for scenario driven tests without actually running them.
296+ ## ConfigValidate
302297
303- * ` codecept dry-run acceptance `
304- * ` codecept dry-run acceptance MyCest `
305- * ` codecept dry-run acceptance checkout.feature `
306- * ` codecept dry-run tests/acceptance/MyCest.php `
298+ Validates and prints Codeception config.
299+ Use it do debug Yaml configs
307300
301+ Check config:
308302
303+ * ` codecept config ` : check global config
304+ * ` codecept config unit ` : check suite config
309305
306+ Load config:
310307
311- ## Clean
308+ * ` codecept config:validate -c path/to/another/config ` : from another dir
309+ * ` codecept config:validate -c another_config.yml ` : from another config file
312310
313- Recursively cleans ` output ` directory and generated code.
311+ Check overriding config values (like in ` run ` command)
314312
315- * ` codecept clean `
313+ * ` codecept config:validate -o "settings: shuffle: true" ` : enable shuffle
314+ * ` codecept config:validate -o "settings: lint: false" ` : disable linting
315+ * ` codecept config:validate -o "reporters: report: \Custom\Reporter" --report ` : use custom reporter
316316
317317
318318
319319
320- ## GenerateCest
320+ ## DryRun
321321
322- Generates Cest ( scenario- driven object-oriented test) file:
322+ Shows step by step execution process for scenario driven tests without actually running them.
323323
324- * ` codecept generate:cest suite Login `
325- * ` codecept g:cest suite subdir/subdir/testnameCest.php `
326- * ` codecept g:cest suite LoginCest -c path/to/project `
327- * ` codecept g:cest "App\Login" `
324+ * ` codecept dry-run acceptance `
325+ * ` codecept dry-run acceptance MyCest `
326+ * ` codecept dry-run acceptance checkout.feature `
327+ * ` codecept dry-run tests/acceptance/MyCest.php `
328328
329329
330330
0 commit comments