@@ -5,47 +5,33 @@ title: Commands - Codeception - Documentation
5
5
6
6
# Console Commands
7
7
8
- ## GherkinSnippets
9
-
10
- Generates code snippets for matched feature files in a suite.
11
- Code snippets are expected to be implemented in Actor or PageObjects
12
-
13
- Usage:
14
-
15
- * ` codecept gherkin:snippets acceptance ` - snippets from all feature of acceptance tests
16
- * ` codecept gherkin:snippets acceptance/feature/users ` - snippets from ` feature/users ` dir of acceptance tests
17
- * ` codecept gherkin:snippets acceptance user_account.feature ` - snippets from a single feature file
18
- * ` codecept gherkin:snippets acceptance/feature/users/user_accout.feature ` - snippets from feature file in a dir
19
-
20
-
21
-
22
- ## GenerateFeature
8
+ ## GenerateCest
23
9
24
- Generates Feature file (in Gherkin) :
10
+ Generates Cest (scenario-driven object-oriented test) file :
25
11
26
- * ` codecept generate:feature suite Login `
27
- * ` codecept g:feature suite subdir/subdir/login.feature `
28
- * ` codecept g:feature suite login.feature -c path/to/project `
12
+ * ` codecept generate:cest suite Login `
13
+ * ` codecept g:cest suite subdir/subdir/testnameCest.php `
14
+ * ` codecept g:cest suite LoginCest -c path/to/project `
15
+ * ` codecept g:cest "App\Login" `
29
16
30
17
31
18
32
19
33
- ## GenerateEnvironment
20
+ ## GenerateGroup
34
21
35
- Generates empty environment configuration file into envs dir:
22
+ Creates empty GroupObject - extension which handles all group events.
36
23
37
- * ` codecept g:env firefox `
24
+ * ` codecept g:group Admin `
38
25
39
- Required to have ` envs ` path to be specified in ` codeception.yml `
40
26
41
27
28
+ ## GenerateStepObject
42
29
43
- ## GenerateTest
30
+ Generates StepObject class. You will be asked for steps you want to implement.
44
31
45
- Generates skeleton for Unit Test that extends ` Codeception\TestCase\Test ` .
32
+ * ` codecept g:stepobject acceptance AdminSteps `
33
+ * ` codecept g:stepobject acceptance UserSteps --silent ` - skip action questions
46
34
47
- * ` codecept g:test unit User `
48
- * ` codecept g:test unit "App\User" `
49
35
50
36
51
37
@@ -61,31 +47,25 @@ If suite name is provided, an actor class will be included into placeholder
61
47
62
48
63
49
64
- ## Init
65
-
66
-
67
-
68
- ## ConfigValidate
50
+ ## GenerateFeature
69
51
70
- Validates and prints Codeception config.
71
- Use it do debug Yaml configs
52
+ Generates Feature file (in Gherkin):
72
53
73
- Check config:
54
+ * ` codecept generate:feature suite Login `
55
+ * ` codecept g:feature suite subdir/subdir/login.feature `
56
+ * ` codecept g:feature suite login.feature -c path/to/project `
74
57
75
- * ` codecept config ` : check global config
76
- * ` codecept config unit ` : check suite config
77
58
78
- Load config:
79
59
80
- * ` codecept config:validate -c path/to/another/config ` : from another dir
81
- * ` codecept config:validate -c another_config.yml ` : from another config file
82
60
83
- Check overriding config values (like in ` run ` command)
61
+ ## GeneratePageObject
84
62
85
- * ` codecept config:validate -o "settings: shuffle: true" ` : enable shuffle
86
- * ` codecept config:validate -o "settings: lint: false" ` : disable linting
87
- * ` codecept config:validate -o "reporters: report: \Custom\Reporter" --report ` : use custom reporter
63
+ Generates PageObject. Can be generated either globally, or just for one suite.
64
+ If PageObject is generated globally it will act as UIMap, without any logic in it.
88
65
66
+ * ` codecept g:page Login `
67
+ * ` codecept g:page Registration `
68
+ * ` codecept g:page acceptance Login `
89
69
90
70
91
71
@@ -105,11 +85,72 @@ By default it will create 3 suites **acceptance**, **functional**, and **unit**.
105
85
106
86
107
87
108
- ## GenerateGroup
88
+ ## GenerateHelper
109
89
110
- Creates empty GroupObject - extension which handles all group events .
90
+ Creates empty Helper class .
111
91
112
- * ` codecept g:group Admin `
92
+ * ` codecept g:helper MyHelper `
93
+ * ` codecept g:helper "My\Helper" `
94
+
95
+
96
+
97
+
98
+ ## Build
99
+
100
+ Generates Actor classes (initially Guy classes) from suite configs.
101
+ Starting from Codeception 2.0 actor classes are auto-generated. Use this command to generate them manually.
102
+
103
+ * ` codecept build `
104
+ * ` codecept build path/to/project `
105
+
106
+
107
+
108
+
109
+ ## CompletionFallback
110
+
111
+
112
+
113
+ ## Console
114
+
115
+ Try to execute test commands in run-time. You may try commands before writing the test.
116
+
117
+ * ` codecept console acceptance ` - starts acceptance suite environment. If you use WebDriver you can manipulate browser with Codeception commands.
118
+
119
+
120
+
121
+ ## GenerateTest
122
+
123
+ Generates skeleton for Unit Test that extends ` Codeception\TestCase\Test ` .
124
+
125
+ * ` codecept g:test unit User `
126
+ * ` codecept g:test unit "App\User" `
127
+
128
+
129
+
130
+ ## SelfUpdate
131
+
132
+ Auto-updates phar archive from official site: 'https://codeception.com/codecept.phar ' .
133
+
134
+ * ` php codecept.phar self-update `
135
+
136
+ @author Franck Cassedanne < franck@cassedanne.com >
137
+
138
+
139
+
140
+
141
+ ## DryRun
142
+
143
+ Shows step by step execution process for scenario driven tests without actually running them.
144
+
145
+ * ` codecept dry-run acceptance `
146
+ * ` codecept dry-run acceptance MyCest `
147
+ * ` codecept dry-run acceptance checkout.feature `
148
+ * ` codecept dry-run tests/acceptance/MyCest.php `
149
+
150
+
151
+
152
+
153
+ ## Init
113
154
114
155
115
156
@@ -213,90 +254,38 @@ Create new test suite. Requires suite name and actor name
213
254
214
255
215
256
216
- ## GenerateCest
217
-
218
- Generates Cest (scenario-driven object-oriented test) file:
219
-
220
- * ` codecept generate:cest suite Login `
221
- * ` codecept g:cest suite subdir/subdir/testnameCest.php `
222
- * ` codecept g:cest suite LoginCest -c path/to/project `
223
- * ` codecept g:cest "App\Login" `
224
-
225
-
226
-
227
-
228
- ## GeneratePageObject
229
-
230
- Generates PageObject. Can be generated either globally, or just for one suite.
231
- If PageObject is generated globally it will act as UIMap, without any logic in it.
232
-
233
- * ` codecept g:page Login `
234
- * ` codecept g:page Registration `
235
- * ` codecept g:page acceptance Login `
236
-
237
-
238
-
239
- ## Clean
240
-
241
- Recursively cleans ` output ` directory and generated code.
242
-
243
- * ` codecept clean `
244
-
245
-
246
-
247
-
248
- ## GenerateHelper
249
-
250
- Creates empty Helper class.
251
-
252
- * ` codecept g:helper MyHelper `
253
- * ` codecept g:helper "My\Helper" `
254
-
255
-
256
-
257
-
258
-
259
- ## Console
260
-
261
- Try to execute test commands in run-time. You may try commands before writing the test.
262
-
263
- * ` codecept console acceptance ` - starts acceptance suite environment. If you use WebDriver you can manipulate browser with Codeception commands.
264
-
265
-
266
-
267
- ## SelfUpdate
268
-
269
- Auto-updates phar archive from official site: 'https://codeception.com/codecept.phar ' .
270
-
271
- * ` php codecept.phar self-update `
257
+ ## GenerateEnvironment
272
258
273
- @ author Franck Cassedanne < franck@cassedanne.com >
259
+ Generates empty environment configuration file into envs dir:
274
260
261
+ * ` codecept g:env firefox `
275
262
263
+ Required to have ` envs ` path to be specified in ` codeception.yml `
276
264
277
- ## CompletionFallback
278
265
279
266
267
+ ## GherkinSnippets
280
268
281
- ## Build
269
+ Generates code snippets for matched feature files in a suite.
270
+ Code snippets are expected to be implemented in Actor or PageObjects
282
271
283
- Generates Actor classes (initially Guy classes) from suite configs.
284
- Starting from Codeception 2.0 actor classes are auto-generated. Use this command to generate them manually.
272
+ Usage:
285
273
286
- * ` codecept build `
287
- * ` codecept build path/to/project `
274
+ * ` codecept gherkin:snippets acceptance ` - snippets from all feature of acceptance tests
275
+ * ` codecept gherkin:snippets acceptance/feature/users ` - snippets from ` feature/users ` dir of acceptance tests
276
+ * ` codecept gherkin:snippets acceptance user_account.feature ` - snippets from a single feature file
277
+ * ` codecept gherkin:snippets acceptance/feature/users/user_accout.feature ` - snippets from feature file in a dir
288
278
289
279
290
280
281
+ ## GherkinSteps
291
282
292
- ## DryRun
283
+ Prints all steps from all Gherkin contexts for a specific suite
293
284
294
- Shows step by step execution process for scenario driven tests without actually running them.
285
+ {% highlight yaml %}
286
+ codecept gherkin: steps acceptance
295
287
296
- * ` codecept dry-run acceptance `
297
- * ` codecept dry-run acceptance MyCest `
298
- * ` codecept dry-run acceptance checkout.feature `
299
- * ` codecept dry-run tests/acceptance/MyCest.php `
288
+ {% endhighlight %}
300
289
301
290
302
291
@@ -311,24 +300,35 @@ Generates user-friendly text scenarios from scenario-driven tests (Cest).
311
300
312
301
313
302
314
- ## GenerateStepObject
303
+ ## Clean
315
304
316
- Generates StepObject class. You will be asked for steps you want to implement .
305
+ Recursively cleans ` output ` directory and generated code .
317
306
318
- * ` codecept g:stepobject acceptance AdminSteps `
319
- * ` codecept g:stepobject acceptance UserSteps --silent ` - skip action questions
307
+ * ` codecept clean `
320
308
321
309
322
310
323
311
324
- ## GherkinSteps
312
+ ## ConfigValidate
325
313
326
- Prints all steps from all Gherkin contexts for a specific suite
314
+ Validates and prints Codeception config.
315
+ Use it do debug Yaml configs
327
316
328
- {% highlight yaml %}
329
- codecept gherkin: steps acceptance
317
+ Check config:
330
318
331
- {% endhighlight %}
319
+ * ` codecept config ` : check global config
320
+ * ` codecept config unit ` : check suite config
321
+
322
+ Load config:
323
+
324
+ * ` codecept config:validate -c path/to/another/config ` : from another dir
325
+ * ` codecept config:validate -c another_config.yml ` : from another config file
326
+
327
+ Check overriding config values (like in ` run ` command)
328
+
329
+ * ` codecept config:validate -o "settings: shuffle: true" ` : enable shuffle
330
+ * ` codecept config:validate -o "settings: lint: false" ` : disable linting
331
+ * ` codecept config:validate -o "reporters: report: \Custom\Reporter" --report ` : use custom reporter
332
332
333
333
334
334
0 commit comments