@@ -5,61 +5,55 @@ title: Commands - Codeception - Documentation
5
5
6
6
# Console Commands
7
7
8
- ## CompletionFallback
9
-
10
-
11
-
12
- ## GenerateSnapshot
13
-
14
- Generates Snapshot.
15
- Snapshot can be used to test dynamical data.
16
- If suite name is provided, an actor class will be included into placeholder
17
-
18
- * ` codecept g:snapshot UserEmails `
19
- * ` codecept g:snapshot Products `
20
- * ` codecept g:snapshot acceptance UserEmails `
21
-
8
+ ## GenerateCest
22
9
10
+ Generates Cest (scenario-driven object-oriented test) file:
23
11
24
- ## GenerateFeature
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" `
25
16
26
- Generates Feature file (in Gherkin):
27
17
28
- * ` codecept generate:feature suite Login `
29
- * ` codecept g:feature suite subdir/subdir/login.feature `
30
- * ` codecept g:feature suite login.feature -c path/to/project `
31
18
32
19
20
+ ## GenerateGroup
33
21
22
+ Creates empty GroupObject - extension which handles all group events.
34
23
35
- ## Clean
24
+ * ` codecept g:group Admin `
36
25
37
- Recursively cleans ` output ` directory and generated code.
38
26
39
- * ` codecept clean `
40
27
28
+ ## GenerateStepObject
41
29
30
+ Generates StepObject class. You will be asked for steps you want to implement.
42
31
32
+ * ` codecept g:stepobject acceptance AdminSteps `
33
+ * ` codecept g:stepobject acceptance UserSteps --silent ` - skip action questions
43
34
44
- ## Init
45
35
46
36
47
37
48
- ## GenerateGroup
38
+ ## GenerateSnapshot
49
39
50
- Creates empty GroupObject - extension which handles all group events.
40
+ Generates Snapshot.
41
+ Snapshot can be used to test dynamical data.
42
+ If suite name is provided, an actor class will be included into placeholder
51
43
52
- * ` codecept g:group Admin `
44
+ * ` codecept g:snapshot UserEmails `
45
+ * ` codecept g:snapshot Products `
46
+ * ` codecept g:snapshot acceptance UserEmails `
53
47
54
48
55
49
56
- ## GenerateScenarios
50
+ ## GenerateFeature
57
51
58
- Generates user-friendly text scenarios from scenario-driven tests (Cest).
52
+ Generates Feature file (in Gherkin):
59
53
60
- * ` codecept g:scenarios acceptance ` - for all acceptance tests
61
- * ` codecept g:scenarios acceptance --format html ` - in html format
62
- * ` codecept g:scenarios acceptance --path doc ` - generate scenarios to ` doc ` dir
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 `
63
57
64
58
65
59
@@ -75,14 +69,28 @@ If PageObject is generated globally it will act as UIMap, without any logic in i
75
69
76
70
77
71
78
- ## GenerateSuite
72
+ ## Bootstrap
79
73
80
- Create new test suite. Requires suite name and actor name
74
+ Creates default config, tests directory and sample suites for current project.
75
+ Use this command to start building a test suite.
76
+
77
+ By default it will create 3 suites ** acceptance** , ** functional** , and ** unit** .
78
+
79
+ * ` codecept bootstrap ` - creates ` tests ` dir and ` codeception.yml ` in current dir.
80
+ * ` codecept bootstrap --empty ` - creates ` tests ` dir without suites
81
+ * ` codecept bootstrap --namespace Frontend ` - creates tests, and use ` Frontend ` namespace for actor classes and helpers.
82
+ * ` codecept bootstrap --actor Wizard ` - sets actor as Wizard, to have ` TestWizard ` actor in tests.
83
+ * ` codecept bootstrap path/to/the/project ` - provide different path to a project, where tests should be placed
81
84
82
- * ``
83
- * ` codecept g:suite api ` -> api + ApiTester
84
- * ` codecept g:suite integration Code ` -> integration + CodeTester
85
- * ` codecept g:suite frontend Front ` -> frontend + FrontTester
85
+
86
+
87
+
88
+ ## GenerateHelper
89
+
90
+ Creates empty Helper class.
91
+
92
+ * ` codecept g:helper MyHelper `
93
+ * ` codecept g:helper "My\Helper" `
86
94
87
95
88
96
@@ -98,49 +106,35 @@ Starting from Codeception 2.0 actor classes are auto-generated. Use this command
98
106
99
107
100
108
101
- ## GenerateEnvironment
102
-
103
- Generates empty environment configuration file into envs dir:
104
-
105
- * ` codecept g:env firefox `
106
-
107
- Required to have ` envs ` path to be specified in ` codeception.yml `
108
-
109
+ ## CompletionFallback
109
110
110
111
111
- ## GenerateStepObject
112
112
113
- Generates StepObject class. You will be asked for steps you want to implement.
113
+ ## Console
114
114
115
- * ` codecept g:stepobject acceptance AdminSteps `
116
- * ` codecept g:stepobject acceptance UserSteps --silent ` - skip action questions
115
+ Try to execute test commands in run-time. You may try commands before writing the test.
117
116
117
+ * ` codecept console acceptance ` - starts acceptance suite environment. If you use WebDriver you can manipulate browser with Codeception commands.
118
118
119
119
120
120
121
- ## GenerateCest
121
+ ## GenerateTest
122
122
123
- Generates Cest (scenario-driven object-oriented test) file:
123
+ Generates skeleton for Unit Test that extends ` Codeception\TestCase\Test ` .
124
124
125
- * ` codecept generate:cest suite Login `
126
- * ` codecept g:cest suite subdir/subdir/testnameCest.php `
127
- * ` codecept g:cest suite LoginCest -c path/to/project `
128
- * ` codecept g:cest "App\Login" `
125
+ * ` codecept g:test unit User `
126
+ * ` codecept g:test unit "App\User" `
129
127
130
128
131
129
130
+ ## SelfUpdate
132
131
133
- ## GherkinSnippets
132
+ Auto-updates phar archive from official site: ' https://codeception.com/codecept.phar ' .
134
133
135
- Generates code snippets for matched feature files in a suite.
136
- Code snippets are expected to be implemented in Actor or PageObjects
134
+ * ` php codecept.phar self-update `
137
135
138
- Usage:
136
+ @ author Franck Cassedanne < franck@cassedanne.com >
139
137
140
- * ` codecept gherkin:snippets acceptance ` - snippets from all feature of acceptance tests
141
- * ` codecept gherkin:snippets acceptance/feature/users ` - snippets from ` feature/users ` dir of acceptance tests
142
- * ` codecept gherkin:snippets acceptance user_account.feature ` - snippets from a single feature file
143
- * ` codecept gherkin:snippets acceptance/feature/users/user_accout.feature ` - snippets from feature file in a dir
144
138
145
139
146
140
@@ -156,6 +150,10 @@ Shows step by step execution process for scenario driven tests without actually
156
150
157
151
158
152
153
+ ## Init
154
+
155
+
156
+
159
157
## Run
160
158
161
159
Executes tests.
@@ -244,58 +242,69 @@ Options:
244
242
245
243
246
244
247
- ## SelfUpdate
245
+ ## GenerateSuite
248
246
249
- Auto-updates phar archive from official site: ' https://codeception.com/codecept.phar ' .
247
+ Create new test suite. Requires suite name and actor name
250
248
251
- * ` php codecept.phar self-update `
249
+ * ``
250
+ * ` codecept g:suite api ` -> api + ApiTester
251
+ * ` codecept g:suite integration Code ` -> integration + CodeTester
252
+ * ` codecept g:suite frontend Front ` -> frontend + FrontTester
252
253
253
- @author Franck Cassedanne < franck@cassedanne.com >
254
254
255
255
256
256
257
- ## Console
257
+ ## GenerateEnvironment
258
258
259
- Try to execute test commands in run-time. You may try commands before writing the test.
259
+ Generates empty environment configuration file into envs dir:
260
260
261
- * ` codecept console acceptance ` - starts acceptance suite environment. If you use WebDriver you can manipulate browser with Codeception commands.
261
+ * ` codecept g:env firefox `
262
262
263
+ Required to have ` envs ` path to be specified in ` codeception.yml `
263
264
264
265
265
- ## Bootstrap
266
266
267
- Creates default config, tests directory and sample suites for current project.
268
- Use this command to start building a test suite.
267
+ ## GherkinSnippets
269
268
270
- By default it will create 3 suites ** acceptance** , ** functional** , and ** unit** .
269
+ Generates code snippets for matched feature files in a suite.
270
+ Code snippets are expected to be implemented in Actor or PageObjects
271
271
272
- * ` codecept bootstrap ` - creates ` tests ` dir and ` codeception.yml ` in current dir.
273
- * ` codecept bootstrap --empty ` - creates ` tests ` dir without suites
274
- * ` codecept bootstrap --namespace Frontend ` - creates tests, and use ` Frontend ` namespace for actor classes and helpers.
275
- * ` codecept bootstrap --actor Wizard ` - sets actor as Wizard, to have ` TestWizard ` actor in tests.
276
- * ` codecept bootstrap path/to/the/project ` - provide different path to a project, where tests should be placed
272
+ Usage:
277
273
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
278
278
279
279
280
280
281
- ## GenerateHelper
281
+ ## GherkinSteps
282
282
283
- Creates empty Helper class.
283
+ Prints all steps from all Gherkin contexts for a specific suite
284
284
285
- * ` codecept g:helper MyHelper `
286
- * ` codecept g:helper "My\Helper" `
285
+ {% highlight yaml %}
286
+ codecept gherkin : steps acceptance
287
287
288
+ {% endhighlight %}
288
289
289
290
290
291
291
- ## GherkinSteps
292
292
293
- Prints all steps from all Gherkin contexts for a specific suite
293
+ ## GenerateScenarios
294
294
295
- {% highlight yaml %}
296
- codecept gherkin: steps acceptance
295
+ Generates user-friendly text scenarios from scenario-driven tests (Cest).
297
296
298
- {% endhighlight %}
297
+ * ` codecept g:scenarios acceptance ` - for all acceptance tests
298
+ * ` codecept g:scenarios acceptance --format html ` - in html format
299
+ * ` codecept g:scenarios acceptance --path doc ` - generate scenarios to ` doc ` dir
300
+
301
+
302
+
303
+ ## Clean
304
+
305
+ Recursively cleans ` output ` directory and generated code.
306
+
307
+ * ` codecept clean `
299
308
300
309
301
310
@@ -324,12 +333,3 @@ Check overriding config values (like in `run` command)
324
333
325
334
326
335
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