Skip to content

Commit 91a839b

Browse files
github-actions[bot]github-actions[bot]
authored andcommitted
updated
1 parent 6947dfd commit 91a839b

File tree

1 file changed

+138
-138
lines changed

1 file changed

+138
-138
lines changed

docs/reference/Commands.md

Lines changed: 138 additions & 138 deletions
Original file line numberDiff line numberDiff line change
@@ -5,69 +5,14 @@ title: Commands - Codeception - Documentation
55

66
# Console Commands
77

8-
## DryRun
9-
10-
Shows step by step execution process for scenario driven tests without actually running them.
11-
12-
* `codecept dry-run acceptance`
13-
* `codecept dry-run acceptance MyCest`
14-
* `codecept dry-run acceptance checkout.feature`
15-
* `codecept dry-run tests/acceptance/MyCest.php`
16-
17-
18-
19-
20-
## GenerateCest
21-
22-
Generates Cest (scenario-driven object-oriented test) file:
23-
24-
* `codecept generate:cest suite Login`
25-
* `codecept g:cest suite subdir/subdir/testnameCest.php`
26-
* `codecept g:cest suite LoginCest -c path/to/project`
27-
* `codecept g:cest "App\Login"`
28-
29-
30-
31-
32-
## GenerateSnapshot
33-
34-
Generates Snapshot.
35-
Snapshot can be used to test dynamical data.
36-
If suite name is provided, an actor class will be included into placeholder
37-
38-
* `codecept g:snapshot UserEmails`
39-
* `codecept g:snapshot Products`
40-
* `codecept g:snapshot acceptance UserEmails`
41-
42-
43-
44-
## GenerateHelper
45-
46-
Creates empty Helper class.
47-
48-
* `codecept g:helper MyHelper`
49-
* `codecept g:helper "My\Helper"`
50-
51-
52-
53-
54-
## GenerateScenarios
55-
56-
Generates user-friendly text scenarios from scenario-driven tests (Cest).
57-
58-
* `codecept g:scenarios acceptance` - for all acceptance tests
59-
* `codecept g:scenarios acceptance --format html` - in html format
60-
* `codecept g:scenarios acceptance --path doc` - generate scenarios to `doc` dir
61-
62-
63-
64-
## GenerateEnvironment
65-
66-
Generates empty environment configuration file into envs dir:
8+
## GeneratePageObject
679

68-
* `codecept g:env firefox`
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.
6912

70-
Required to have `envs` path to be specified in `codeception.yml`
13+
* `codecept g:page Login`
14+
* `codecept g:page Registration`
15+
* `codecept g:page acceptance Login`
7116

7217

7318

@@ -85,17 +30,6 @@ Usage:
8530

8631

8732

88-
## GenerateFeature
89-
90-
Generates Feature file (in Gherkin):
91-
92-
* `codecept generate:feature suite Login`
93-
* `codecept g:feature suite subdir/subdir/login.feature`
94-
* `codecept g:feature suite login.feature -c path/to/project`
95-
96-
97-
98-
9933
## Console
10034

10135
Try to execute test commands in run-time. You may try commands before writing the test.
@@ -104,62 +38,25 @@ Try to execute test commands in run-time. You may try commands before writing th
10438

10539

10640

107-
## Clean
108-
109-
Recursively cleans `output` directory and generated code.
110-
111-
* `codecept clean`
112-
113-
114-
115-
116-
## GeneratePageObject
117-
118-
Generates PageObject. Can be generated either globally, or just for one suite.
119-
If PageObject is generated globally it will act as UIMap, without any logic in it.
120-
121-
* `codecept g:page Login`
122-
* `codecept g:page Registration`
123-
* `codecept g:page acceptance Login`
124-
125-
126-
127-
## GenerateStepObject
128-
129-
Generates StepObject class. You will be asked for steps you want to implement.
130-
131-
* `codecept g:stepobject acceptance AdminSteps`
132-
* `codecept g:stepobject acceptance UserSteps --silent` - skip action questions
133-
134-
135-
136-
137-
## SelfUpdate
138-
139-
Auto-updates phar archive from official site: 'https://codeception.com/codecept.phar' .
140-
141-
* `php codecept.phar self-update`
142-
143-
@author Franck Cassedanne <[email protected]>
144-
145-
146-
147-
## CompletionFallback
148-
41+
## GenerateSnapshot
14942

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
15046

151-
## Build
47+
* `codecept g:snapshot UserEmails`
48+
* `codecept g:snapshot Products`
49+
* `codecept g:snapshot acceptance UserEmails`
15250

153-
Generates Actor classes (initially Guy classes) from suite configs.
154-
Starting from Codeception 2.0 actor classes are auto-generated. Use this command to generate them manually.
15551

156-
* `codecept build`
157-
* `codecept build path/to/project`
15852

53+
## GenerateHelper
15954

55+
Creates empty Helper class.
16056

57+
* `codecept g:helper MyHelper`
58+
* `codecept g:helper "My\Helper"`
16159

162-
## Init
16360

16461

16562

@@ -251,6 +148,87 @@ Options:
251148

252149

253150

151+
## Bootstrap
152+
153+
Creates default config, tests directory and sample suites for current project.
154+
Use this command to start building a test suite.
155+
156+
By default it will create 3 suites **Acceptance**, **Functional**, and **Unit**.
157+
158+
* `codecept bootstrap` - creates `tests` dir and `codeception.yml` in current dir.
159+
* `codecept bootstrap --empty` - creates `tests` dir without suites
160+
* `codecept bootstrap --namespace Frontend` - creates tests, and use `Frontend` namespace for actor classes and helpers.
161+
* `codecept bootstrap --actor Wizard` - sets actor as Wizard, to have `TestWizard` actor in tests.
162+
* `codecept bootstrap path/to/the/project` - provide different path to a project, where tests should be placed
163+
164+
165+
166+
167+
## SelfUpdate
168+
169+
Auto-updates phar archive from official site: 'https://codeception.com/codecept.phar' .
170+
171+
* `php codecept.phar self-update`
172+
173+
@author Franck Cassedanne <[email protected]>
174+
175+
176+
177+
## GenerateGroup
178+
179+
Creates empty GroupObject - extension which handles all group events.
180+
181+
* `codecept g:group Admin`
182+
183+
184+
185+
186+
## GherkinSteps
187+
188+
Prints all steps from all Gherkin contexts for a specific suite
189+
190+
{% highlight yaml %}
191+
codecept gherkin:steps acceptance
192+
193+
{% endhighlight %}
194+
195+
196+
197+
198+
## Init
199+
200+
201+
202+
## GenerateEnvironment
203+
204+
Generates empty environment configuration file into envs dir:
205+
206+
* `codecept g:env firefox`
207+
208+
Required to have `envs` path to be specified in `codeception.yml`
209+
210+
211+
212+
## GenerateScenarios
213+
214+
Generates user-friendly text scenarios from scenario-driven tests (Cest).
215+
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
219+
220+
221+
222+
## GenerateStepObject
223+
224+
Generates StepObject class. You will be asked for steps you want to implement.
225+
226+
* `codecept g:stepobject acceptance AdminSteps`
227+
* `codecept g:stepobject acceptance UserSteps --silent` - skip action questions
228+
229+
230+
231+
254232
## GenerateTest
255233

256234
Generates skeleton for Unit Test that extends `Codeception\TestCase\Test`.
@@ -284,14 +262,13 @@ Check overriding config values (like in `run` command)
284262

285263

286264

287-
## GherkinSteps
288-
289-
Prints all steps from all Gherkin contexts for a specific suite
265+
## Build
290266

291-
{% highlight yaml %}
292-
codecept gherkin:steps acceptance
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.
293269

294-
{% endhighlight %}
270+
* `codecept build`
271+
* `codecept build path/to/project`
295272

296273

297274

@@ -308,28 +285,51 @@ Create new test suite. Requires suite name and actor name
308285

309286

310287

311-
## Bootstrap
288+
## GenerateFeature
312289

313-
Creates default config, tests directory and sample suites for current project.
314-
Use this command to start building a test suite.
290+
Generates Feature file (in Gherkin):
315291

316-
By default it will create 3 suites **Acceptance**, **Functional**, and **Unit**.
292+
* `codecept generate:feature suite Login`
293+
* `codecept g:feature suite subdir/subdir/login.feature`
294+
* `codecept g:feature suite login.feature -c path/to/project`
317295

318-
* `codecept bootstrap` - creates `tests` dir and `codeception.yml` in current dir.
319-
* `codecept bootstrap --empty` - creates `tests` dir without suites
320-
* `codecept bootstrap --namespace Frontend` - creates tests, and use `Frontend` namespace for actor classes and helpers.
321-
* `codecept bootstrap --actor Wizard` - sets actor as Wizard, to have `TestWizard` actor in tests.
322-
* `codecept bootstrap path/to/the/project` - provide different path to a project, where tests should be placed
323296

324297

325298

299+
## DryRun
326300

301+
Shows step by step execution process for scenario driven tests without actually running them.
327302

328-
## GenerateGroup
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`
329307

330-
Creates empty GroupObject - extension which handles all group events.
331308

332-
* `codecept g:group Admin`
309+
310+
311+
## Clean
312+
313+
Recursively cleans `output` directory and generated code.
314+
315+
* `codecept clean`
316+
317+
318+
319+
320+
## GenerateCest
321+
322+
Generates Cest (scenario-driven object-oriented test) file:
323+
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"`
328+
329+
330+
331+
332+
## CompletionFallback
333333

334334

335335

0 commit comments

Comments
 (0)