@@ -5,29 +5,30 @@ title: Commands - Codeception - Documentation
5
5
6
6
# Console Commands
7
7
8
- ## GenerateSuite
8
+ ## CompletionFallback
9
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
10
17
11
12
+ ## DryRun
18
13
14
+ Shows step by step execution process for scenario driven tests without actually running them.
19
15
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 `
21
20
22
21
23
22
24
- ## GenerateStepObject
25
23
26
- Generates StepObject class. You will be asked for steps you want to implement.
24
+ ## GeneratePageObject
27
25
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.
30
28
29
+ * ` codecept g:page Login `
30
+ * ` codecept g:page Registration `
31
+ * ` codecept g:page acceptance Login `
31
32
32
33
33
34
@@ -40,12 +41,25 @@ Recursively cleans `output` directory and generated code.
40
41
41
42
42
43
43
- ## GenerateHelper
44
+ ## GenerateSuite
44
45
45
- Creates empty Helper class.
46
+ Create new test suite. Requires suite name and actor name
46
47
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 `
49
63
50
64
51
65
@@ -60,37 +74,52 @@ Generates user-friendly text scenarios from scenario-driven tests (Cest).
60
74
61
75
62
76
63
- ## Bootstrap
77
+ ## GenerateCest
64
78
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:
67
80
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" `
69
85
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
75
86
76
87
77
88
89
+ ## GherkinSnippets
78
90
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
80
93
81
- Try to execute test commands in run-time. You may try commands before writing the test.
94
+ Usage:
82
95
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
84
100
85
101
86
102
87
- ## Build
103
+ ## ConfigValidate
88
104
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
91
107
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
94
123
95
124
96
125
@@ -103,19 +132,69 @@ Creates empty GroupObject - extension which handles all group events.
103
132
104
133
105
134
106
- ## Init
135
+ ## GenerateStepObject
107
136
137
+ Generates StepObject class. You will be asked for steps you want to implement.
108
138
139
+ * ` codecept g:stepobject acceptance AdminSteps `
140
+ * ` codecept g:stepobject acceptance UserSteps --silent ` - skip action questions
109
141
110
142
111
- ## GeneratePageObject
112
143
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.
115
144
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
< [email protected] >
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
119
198
120
199
121
200
@@ -131,14 +210,11 @@ If suite name is provided, an actor class will be included into placeholder
131
210
132
211
133
212
134
- ## DryRun
213
+ ## Console
135
214
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 .
137
216
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.
142
218
143
219
144
220
@@ -231,75 +307,18 @@ Options:
231
307
232
308
233
309
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
294
311
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.
297
314
298
- Check overriding config values (like in ` run ` command)
315
+ By default it will create 3 suites ** Acceptance ** , ** Functional ** , and ** Unit ** .
299
316
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
303
322
304
323
305
324
@@ -314,22 +333,3 @@ Required to have `envs` path to be specified in `codeception.yml`
314
333
315
334
316
335
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
< [email protected] >
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