Skip to content

Commit bfad340

Browse files
github-actions[bot]github-actions[bot]
authored andcommitted
updated
1 parent aef409f commit bfad340

File tree

1 file changed

+125
-125
lines changed

1 file changed

+125
-125
lines changed

docs/reference/Commands.md

Lines changed: 125 additions & 125 deletions
Original file line numberDiff line numberDiff line change
@@ -5,47 +5,33 @@ title: Commands - Codeception - Documentation
55

66
# Console Commands
77

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
239

24-
Generates Feature file (in Gherkin):
10+
Generates Cest (scenario-driven object-oriented test) file:
2511

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"`
2916

3017

3118

3219

33-
## GenerateEnvironment
20+
## GenerateGroup
3421

35-
Generates empty environment configuration file into envs dir:
22+
Creates empty GroupObject - extension which handles all group events.
3623

37-
* `codecept g:env firefox`
24+
* `codecept g:group Admin`
3825

39-
Required to have `envs` path to be specified in `codeception.yml`
4026

4127

28+
## GenerateStepObject
4229

43-
## GenerateTest
30+
Generates StepObject class. You will be asked for steps you want to implement.
4431

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
4634

47-
* `codecept g:test unit User`
48-
* `codecept g:test unit "App\User"`
4935

5036

5137

@@ -61,31 +47,25 @@ If suite name is provided, an actor class will be included into placeholder
6147

6248

6349

64-
## Init
65-
66-
67-
68-
## ConfigValidate
50+
## GenerateFeature
6951

70-
Validates and prints Codeception config.
71-
Use it do debug Yaml configs
52+
Generates Feature file (in Gherkin):
7253

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`
7457

75-
* `codecept config`: check global config
76-
* `codecept config unit`: check suite config
7758

78-
Load config:
7959

80-
* `codecept config:validate -c path/to/another/config`: from another dir
81-
* `codecept config:validate -c another_config.yml`: from another config file
8260

83-
Check overriding config values (like in `run` command)
61+
## GeneratePageObject
8462

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.
8865

66+
* `codecept g:page Login`
67+
* `codecept g:page Registration`
68+
* `codecept g:page acceptance Login`
8969

9070

9171

@@ -105,11 +85,72 @@ By default it will create 3 suites **acceptance**, **functional**, and **unit**.
10585

10686

10787

108-
## GenerateGroup
88+
## GenerateHelper
10989

110-
Creates empty GroupObject - extension which handles all group events.
90+
Creates empty Helper class.
11191

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
113154

114155

115156

@@ -213,90 +254,38 @@ Create new test suite. Requires suite name and actor name
213254

214255

215256

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
272258

273-
@author Franck Cassedanne <franck@cassedanne.com>
259+
Generates empty environment configuration file into envs dir:
274260

261+
* `codecept g:env firefox`
275262

263+
Required to have `envs` path to be specified in `codeception.yml`
276264

277-
## CompletionFallback
278265

279266

267+
## GherkinSnippets
280268

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
282271

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:
285273

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
288278

289279

290280

281+
## GherkinSteps
291282

292-
## DryRun
283+
Prints all steps from all Gherkin contexts for a specific suite
293284

294-
Shows step by step execution process for scenario driven tests without actually running them.
285+
{% highlight yaml %}
286+
codecept gherkin:steps acceptance
295287

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 %}
300289

301290

302291

@@ -311,24 +300,35 @@ Generates user-friendly text scenarios from scenario-driven tests (Cest).
311300

312301

313302

314-
## GenerateStepObject
303+
## Clean
315304

316-
Generates StepObject class. You will be asked for steps you want to implement.
305+
Recursively cleans `output` directory and generated code.
317306

318-
* `codecept g:stepobject acceptance AdminSteps`
319-
* `codecept g:stepobject acceptance UserSteps --silent` - skip action questions
307+
* `codecept clean`
320308

321309

322310

323311

324-
## GherkinSteps
312+
## ConfigValidate
325313

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
327316

328-
{% highlight yaml %}
329-
codecept gherkin:steps acceptance
317+
Check config:
330318

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
332332

333333

334334

0 commit comments

Comments
 (0)