Skip to content

Commit 83bf80b

Browse files
github-actions[bot]github-actions[bot]
authored andcommitted
updated
1 parent 78bb09f commit 83bf80b

File tree

1 file changed

+108
-108
lines changed

1 file changed

+108
-108
lines changed

docs/reference/Commands.md

Lines changed: 108 additions & 108 deletions
Original file line numberDiff line numberDiff line change
@@ -15,69 +15,48 @@ Auto-updates phar archive from official site: 'https://codeception.com/codecept.
1515

1616

1717

18-
## Init
19-
20-
21-
22-
## GherkinSnippets
23-
24-
Generates code snippets for matched feature files in a suite.
25-
Code snippets are expected to be implemented in Actor or PageObjects
26-
27-
Usage:
2818

29-
* `codecept gherkin:snippets acceptance` - snippets from all feature of acceptance tests
30-
* `codecept gherkin:snippets acceptance/feature/users` - snippets from `feature/users` dir of acceptance tests
31-
* `codecept gherkin:snippets acceptance user_account.feature` - snippets from a single feature file
32-
* `codecept gherkin:snippets acceptance/feature/users/user_accout.feature` - snippets from feature file in a dir
33-
34-
35-
36-
## GenerateEnvironment
37-
38-
Generates empty environment configuration file into envs dir:
39-
40-
* `codecept g:env firefox`
41-
42-
Required to have `envs` path to be specified in `codeception.yml`
19+
## GenerateGroup
4320

21+
Creates empty GroupObject - extension which handles all group events.
4422

23+
* `codecept g:group Admin`
4524

46-
## CompletionFallback
4725

4826

27+
## ConfigValidate
4928

50-
## DryRun
29+
Validates and prints Codeception config.
30+
Use it do debug Yaml configs
5131

52-
Shows step by step execution process for scenario driven tests without actually running them.
32+
Check config:
5333

54-
* `codecept dry-run acceptance`
55-
* `codecept dry-run acceptance MyCest`
56-
* `codecept dry-run acceptance checkout.feature`
57-
* `codecept dry-run tests/acceptance/MyCest.php`
34+
* `codecept config`: check global config
35+
* `codecept config unit`: check suite config
5836

37+
Load config:
5938

39+
* `codecept config:validate -c path/to/another/config`: from another dir
40+
* `codecept config:validate -c another_config.yml`: from another config file
6041

42+
Check overriding config values (like in `run` command)
6143

62-
## GenerateHelper
44+
* `codecept config:validate -o "settings: shuffle: true"`: enable shuffle
45+
* `codecept config:validate -o "settings: lint: false"`: disable linting
46+
* `codecept config:validate -o "reporters: report: \Custom\Reporter" --report`: use custom reporter
6347

64-
Creates empty Helper class.
6548

66-
* `codecept g:helper MyHelper`
67-
* `codecept g:helper "My\Helper"`
6849

6950

51+
## CompletionFallback
7052

7153

72-
## GenerateSuite
7354

74-
Create new test suite. Requires suite name and actor name
55+
## Console
7556

76-
* ``
77-
* `codecept g:suite api` -> api + ApiTester
78-
* `codecept g:suite integration Code` -> integration + CodeTester
79-
* `codecept g:suite frontend Front` -> frontend + FrontTester
57+
Try to execute test commands in run-time. You may try commands before writing the test.
8058

59+
* `codecept console acceptance` - starts acceptance suite environment. If you use WebDriver you can manipulate browser with Codeception commands.
8160

8261

8362

@@ -92,54 +71,35 @@ Starting from Codeception 2.0 actor classes are auto-generated. Use this command
9271

9372

9473

95-
## GenerateSnapshot
96-
97-
Generates Snapshot.
98-
Snapshot can be used to test dynamical data.
99-
If suite name is provided, an actor class will be included into placeholder
100-
101-
* `codecept g:snapshot UserEmails`
102-
* `codecept g:snapshot Products`
103-
* `codecept g:snapshot acceptance UserEmails`
104-
105-
106-
107-
## Clean
108-
109-
Recursively cleans `output` directory and generated code.
110-
111-
* `codecept clean`
112-
113-
114-
115-
116-
## Console
74+
## GherkinSteps
11775

118-
Try to execute test commands in run-time. You may try commands before writing the test.
76+
Prints all steps from all Gherkin contexts for a specific suite
11977

120-
* `codecept console acceptance` - starts acceptance suite environment. If you use WebDriver you can manipulate browser with Codeception commands.
78+
{% highlight yaml %}
79+
codecept gherkin:steps acceptance
12180

81+
{% endhighlight %}
12282

12383

124-
## GenerateStepObject
12584

126-
Generates StepObject class. You will be asked for steps you want to implement.
12785

128-
* `codecept g:stepobject acceptance AdminSteps`
129-
* `codecept g:stepobject acceptance UserSteps --silent` - skip action questions
86+
## GenerateFeature
13087

88+
Generates Feature file (in Gherkin):
13189

90+
* `codecept generate:feature suite Login`
91+
* `codecept g:feature suite subdir/subdir/login.feature`
92+
* `codecept g:feature suite login.feature -c path/to/project`
13293

13394

134-
## GherkinSteps
13595

136-
Prints all steps from all Gherkin contexts for a specific suite
13796

138-
{% highlight yaml %}
139-
codecept gherkin:steps acceptance
97+
## GenerateTest
14098

141-
{% endhighlight %}
99+
Generates skeleton for Unit Test that extends `Codeception\TestCase\Test`.
142100

101+
* `codecept g:test unit User`
102+
* `codecept g:test unit "App\User"`
143103

144104

145105

@@ -242,42 +202,36 @@ If PageObject is generated globally it will act as UIMap, without any logic in i
242202

243203

244204

245-
## GenerateFeature
246-
247-
Generates Feature file (in Gherkin):
248-
249-
* `codecept generate:feature suite Login`
250-
* `codecept g:feature suite subdir/subdir/login.feature`
251-
* `codecept g:feature suite login.feature -c path/to/project`
205+
## Clean
252206

207+
Recursively cleans `output` directory and generated code.
253208

209+
* `codecept clean`
254210

255211

256-
## GenerateGroup
257212

258-
Creates empty GroupObject - extension which handles all group events.
259-
260-
* `codecept g:group Admin`
261213

214+
## GenerateStepObject
262215

216+
Generates StepObject class. You will be asked for steps you want to implement.
263217

264-
## GenerateScenarios
218+
* `codecept g:stepobject acceptance AdminSteps`
219+
* `codecept g:stepobject acceptance UserSteps --silent` - skip action questions
265220

266-
Generates user-friendly text scenarios from scenario-driven tests (Cest).
267-
268-
* `codecept g:scenarios acceptance` - for all acceptance tests
269-
* `codecept g:scenarios acceptance --format html` - in html format
270-
* `codecept g:scenarios acceptance --path doc` - generate scenarios to `doc` dir
271221

272222

273223

224+
## GherkinSnippets
274225

275-
## GenerateTest
226+
Generates code snippets for matched feature files in a suite.
227+
Code snippets are expected to be implemented in Actor or PageObjects
276228

277-
Generates skeleton for Unit Test that extends `Codeception\TestCase\Test`.
229+
Usage:
278230

279-
* `codecept g:test unit User`
280-
* `codecept g:test unit "App\User"`
231+
* `codecept gherkin:snippets acceptance` - snippets from all feature of acceptance tests
232+
* `codecept gherkin:snippets acceptance/feature/users` - snippets from `feature/users` dir of acceptance tests
233+
* `codecept gherkin:snippets acceptance user_account.feature` - snippets from a single feature file
234+
* `codecept gherkin:snippets acceptance/feature/users/user_accout.feature` - snippets from feature file in a dir
281235

282236

283237

@@ -309,26 +263,72 @@ By default it will create 3 suites **Acceptance**, **Functional**, and **Unit**.
309263

310264

311265

312-
## ConfigValidate
266+
## GenerateScenarios
313267

314-
Validates and prints Codeception config.
315-
Use it do debug Yaml configs
268+
Generates user-friendly text scenarios from scenario-driven tests (Cest).
316269

317-
Check config:
270+
* `codecept g:scenarios acceptance` - for all acceptance tests
271+
* `codecept g:scenarios acceptance --format html` - in html format
272+
* `codecept g:scenarios acceptance --path doc` - generate scenarios to `doc` dir
318273

319-
* `codecept config`: check global config
320-
* `codecept config unit`: check suite config
321274

322-
Load config:
323275

324-
* `codecept config:validate -c path/to/another/config`: from another dir
325-
* `codecept config:validate -c another_config.yml`: from another config file
276+
## GenerateHelper
326277

327-
Check overriding config values (like in `run` command)
278+
Creates empty Helper class.
328279

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
280+
* `codecept g:helper MyHelper`
281+
* `codecept g:helper "My\Helper"`
282+
283+
284+
285+
286+
## GenerateSuite
287+
288+
Create new test suite. Requires suite name and actor name
289+
290+
* ``
291+
* `codecept g:suite api` -> api + ApiTester
292+
* `codecept g:suite integration Code` -> integration + CodeTester
293+
* `codecept g:suite frontend Front` -> frontend + FrontTester
294+
295+
296+
297+
298+
## Init
299+
300+
301+
302+
## GenerateEnvironment
303+
304+
Generates empty environment configuration file into envs dir:
305+
306+
* `codecept g:env firefox`
307+
308+
Required to have `envs` path to be specified in `codeception.yml`
309+
310+
311+
312+
## GenerateSnapshot
313+
314+
Generates Snapshot.
315+
Snapshot can be used to test dynamical data.
316+
If suite name is provided, an actor class will be included into placeholder
317+
318+
* `codecept g:snapshot UserEmails`
319+
* `codecept g:snapshot Products`
320+
* `codecept g:snapshot acceptance UserEmails`
321+
322+
323+
324+
## DryRun
325+
326+
Shows step by step execution process for scenario driven tests without actually running them.
327+
328+
* `codecept dry-run acceptance`
329+
* `codecept dry-run acceptance MyCest`
330+
* `codecept dry-run acceptance checkout.feature`
331+
* `codecept dry-run tests/acceptance/MyCest.php`
332332

333333

334334

0 commit comments

Comments
 (0)