Skip to content

Commit d49f30f

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

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,33 +5,47 @@ title: Commands - Codeception - Documentation
55

66
# Console Commands
77

8-
## GenerateCest
8+
## GherkinSnippets
99

10-
Generates Cest (scenario-driven object-oriented test) file:
10+
Generates code snippets for matched feature files in a suite.
11+
Code snippets are expected to be implemented in Actor or PageObjects
1112

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"`
13+
Usage:
1614

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
1719

1820

1921

20-
## GenerateGroup
22+
## GenerateFeature
2123

22-
Creates empty GroupObject - extension which handles all group events.
24+
Generates Feature file (in Gherkin):
2325

24-
* `codecept g:group Admin`
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`
2529

2630

2731

28-
## GenerateStepObject
2932

30-
Generates StepObject class. You will be asked for steps you want to implement.
33+
## GenerateEnvironment
3134

32-
* `codecept g:stepobject acceptance AdminSteps`
33-
* `codecept g:stepobject acceptance UserSteps --silent` - skip action questions
35+
Generates empty environment configuration file into envs dir:
3436

37+
* `codecept g:env firefox`
38+
39+
Required to have `envs` path to be specified in `codeception.yml`
40+
41+
42+
43+
## GenerateTest
44+
45+
Generates skeleton for Unit Test that extends `Codeception\TestCase\Test`.
46+
47+
* `codecept g:test unit User`
48+
* `codecept g:test unit "App\User"`
3549

3650

3751

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

4862

4963

50-
## GenerateFeature
64+
## Init
5165

52-
Generates Feature file (in Gherkin):
5366

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

68+
## ConfigValidate
5869

70+
Validates and prints Codeception config.
71+
Use it do debug Yaml configs
5972

73+
Check config:
6074

61-
## GeneratePageObject
75+
* `codecept config`: check global config
76+
* `codecept config unit`: check suite config
6277

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.
78+
Load config:
79+
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+
83+
Check overriding config values (like in `run` command)
84+
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
6588

66-
* `codecept g:page Login`
67-
* `codecept g:page Registration`
68-
* `codecept g:page acceptance Login`
6989

7090

7191

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

86106

87107

88-
## GenerateHelper
89-
90-
Creates empty Helper class.
91-
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-
108+
## GenerateGroup
151109

110+
Creates empty GroupObject - extension which handles all group events.
152111

153-
## Init
112+
* `codecept g:group Admin`
154113

155114

156115

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

255214

256215

257-
## GenerateEnvironment
216+
## GenerateCest
258217

259-
Generates empty environment configuration file into envs dir:
218+
Generates Cest (scenario-driven object-oriented test) file:
260219

261-
* `codecept g:env firefox`
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"`
262224

263-
Required to have `envs` path to be specified in `codeception.yml`
264225

265226

266227

267-
## GherkinSnippets
228+
## GeneratePageObject
268229

269-
Generates code snippets for matched feature files in a suite.
270-
Code snippets are expected to be implemented in Actor or PageObjects
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.
271232

272-
Usage:
233+
* `codecept g:page Login`
234+
* `codecept g:page Registration`
235+
* `codecept g:page acceptance Login`
273236

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
278237

279238

239+
## Clean
280240

281-
## GherkinSteps
241+
Recursively cleans `output` directory and generated code.
282242

283-
Prints all steps from all Gherkin contexts for a specific suite
243+
* `codecept clean`
284244

285-
{% highlight yaml %}
286-
codecept gherkin:steps acceptance
287245

288-
{% endhighlight %}
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`
272+
273+
@author Franck Cassedanne <franck@cassedanne.com>
274+
275+
276+
277+
## CompletionFallback
278+
279+
280+
281+
## Build
282+
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.
285+
286+
* `codecept build`
287+
* `codecept build path/to/project`
288+
289+
290+
291+
292+
## DryRun
293+
294+
Shows step by step execution process for scenario driven tests without actually running them.
295+
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`
289300

290301

291302

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

301312

302313

303-
## Clean
304-
305-
Recursively cleans `output` directory and generated code.
306-
307-
* `codecept clean`
308-
314+
## GenerateStepObject
309315

316+
Generates StepObject class. You will be asked for steps you want to implement.
310317

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

312-
## ConfigValidate
313321

314-
Validates and prints Codeception config.
315-
Use it do debug Yaml configs
316322

317-
Check config:
318323

319-
* `codecept config`: check global config
320-
* `codecept config unit`: check suite config
321-
322-
Load config:
324+
## GherkinSteps
323325

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+
Prints all steps from all Gherkin contexts for a specific suite
326327

327-
Check overriding config values (like in `run` command)
328+
{% highlight yaml %}
329+
codecept gherkin:steps acceptance
328330

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
331+
{% endhighlight %}
332332

333333

334334

0 commit comments

Comments
 (0)