Skip to content

Commit 94ba5cb

Browse files
github-actions[bot]github-actions[bot]
authored andcommitted
updated
1 parent ff7a35f commit 94ba5cb

1 file changed

Lines changed: 102 additions & 102 deletions

File tree

docs/reference/Commands.md

Lines changed: 102 additions & 102 deletions
Original file line numberDiff line numberDiff line change
@@ -5,65 +5,41 @@ title: Commands - Codeception - Documentation
55

66
# Console Commands
77

8-
## GenerateStepObject
9-
10-
Generates StepObject class. You will be asked for steps you want to implement.
11-
12-
* `codecept g:stepobject Acceptance AdminSteps`
13-
* `codecept g:stepobject Acceptance UserSteps --silent` - skip action questions
14-
15-
16-
17-
18-
## GenerateHelper
19-
20-
Creates empty Helper class.
21-
22-
* `codecept g:helper MyHelper`
23-
* `codecept g:helper "My\Helper"`
24-
25-
26-
27-
## GenerateGroup
28-
29-
Creates empty GroupObject - extension which handles all group events.
30-
31-
* `codecept g:group Admin`
8+
## SelfUpdate
329

10+
Auto-updates phar archive from official site: 'https://codeception.com/codecept.phar' .
3311

12+
* `php codecept.phar self-update`
3413

35-
## GherkinSnippets
14+
@author Franck Cassedanne <franck@cassedanne.com>
3615

37-
Generates code snippets for matched feature files in a suite.
38-
Code snippets are expected to be implemented in Actor or PageObjects
3916

40-
Usage:
4117

42-
* `codecept gherkin:snippets Acceptance` - snippets from all feature of acceptance tests
43-
* `codecept gherkin:snippets Acceptance/feature/users` - snippets from `feature/users` dir of acceptance tests
44-
* `codecept gherkin:snippets Acceptance user_account.feature` - snippets from a single feature file
45-
* `codecept gherkin:snippets Acceptance/feature/users/user_accout.feature` - snippets from feature file in a dir
18+
## Init
4619

4720

4821

49-
## Clean
22+
## GherkinSteps
5023

51-
Recursively cleans `output` directory and generated code.
24+
Prints all steps from all Gherkin contexts for a specific suite
5225

53-
* `codecept clean`
26+
{% highlight yaml %}
27+
codecept gherkin:steps Acceptance
5428

29+
{% endhighlight %}
5530

5631

5732

58-
## Console
33+
## CompletionFallback
5934

60-
Try to execute test commands in run-time. You may try commands before writing the test.
6135

62-
* `codecept console Acceptance` - starts acceptance suite environment. If you use WebDriver you can manipulate browser with Codeception commands.
6336

37+
## GenerateHelper
6438

39+
Creates empty Helper class.
6540

66-
## CompletionFallback
41+
* `codecept g:helper MyHelper`
42+
* `codecept g:helper "My\Helper"`
6743

6844

6945

@@ -79,26 +55,17 @@ If suite name is provided, an actor class will be included into placeholder
7955

8056

8157

58+
## GherkinSnippets
8259

83-
## GenerateScenarios
84-
85-
Generates user-friendly text scenarios from scenario-driven tests (Cest).
86-
87-
* `codecept g:scenarios Acceptance` - for all acceptance tests
88-
* `codecept g:scenarios Acceptance --format html` - in html format
89-
* `codecept g:scenarios Acceptance --path doc` - generate scenarios to `doc` dir
90-
91-
92-
93-
## GenerateCest
94-
95-
Generates Cest (scenario-driven object-oriented test) file:
60+
Generates code snippets for matched feature files in a suite.
61+
Code snippets are expected to be implemented in Actor or PageObjects
9662

97-
* `codecept generate:cest suite Login`
98-
* `codecept g:cest suite subdir/subdir/testnameCest.php`
99-
* `codecept g:cest suite LoginCest -c path/to/project`
100-
* `codecept g:cest "App\Login"`
63+
Usage:
10164

65+
* `codecept gherkin:snippets Acceptance` - snippets from all feature of acceptance tests
66+
* `codecept gherkin:snippets Acceptance/feature/users` - snippets from `feature/users` dir of acceptance tests
67+
* `codecept gherkin:snippets Acceptance user_account.feature` - snippets from a single feature file
68+
* `codecept gherkin:snippets Acceptance/feature/users/user_accout.feature` - snippets from feature file in a dir
10269

10370

10471

@@ -195,88 +162,86 @@ Options:
195162

196163

197164

198-
## Bootstrap
165+
## Clean
199166

200-
Creates default config, tests directory and sample suites for current project.
201-
Use this command to start building a test suite.
167+
Recursively cleans `output` directory and generated code.
202168

203-
By default, it will create 3 suites **Acceptance**, **Functional**, and **Unit**.
169+
* `codecept clean`
204170

205-
* `codecept bootstrap` - creates `tests` dir and `codeception.yml` in current dir.
206-
* `codecept bootstrap --empty` - creates `tests` dir without suites
207-
* `codecept bootstrap --namespace Frontend` - creates tests, and use `Frontend` namespace for actor classes and helpers.
208-
* `codecept bootstrap --actor Wizard` - sets actor as Wizard, to have `TestWizard` actor in tests.
209-
* `codecept bootstrap path/to/the/project` - provide different path to a project, where tests should be placed
210171

211172

212173

174+
## Build
213175

214-
## GeneratePageObject
176+
Generates Actor classes (initially Guy classes) from suite configs.
177+
Starting from Codeception 2.0 actor classes are auto-generated. Use this command to generate them manually.
215178

216-
Generates PageObject. Can be generated either globally, or just for one suite.
217-
If PageObject is generated globally it will act as UIMap, without any logic in it.
179+
* `codecept build`
180+
* `codecept build path/to/project`
218181

219-
* `codecept g:page Login`
220-
* `codecept g:page Registration`
221-
* `codecept g:page Acceptance Login`
222182

223183

224184

225-
## Build
185+
## GenerateEnvironment
226186

227-
Generates Actor classes (initially Guy classes) from suite configs.
228-
Starting from Codeception 2.0 actor classes are auto-generated. Use this command to generate them manually.
187+
Generates empty environment configuration file into envs dir:
229188

230-
* `codecept build`
231-
* `codecept build path/to/project`
189+
* `codecept g:env firefox`
232190

191+
Required to have `envs` path to be specified in `codeception.yml`
233192

234193

235194

236-
## SelfUpdate
195+
## GenerateSuite
237196

238-
Auto-updates phar archive from official site: 'https://codeception.com/codecept.phar' .
197+
Create new test suite. Requires suite name and actor name
239198

240-
* `php codecept.phar self-update`
199+
* ``
200+
* `codecept g:suite Api` -> api + ApiTester
201+
* `codecept g:suite Integration Code` -> integration + CodeTester
202+
* `codecept g:suite Frontend Front` -> frontend + FrontTester
241203

242-
@author Franck Cassedanne <franck@cassedanne.com>
243204

244205

245206

246-
## GherkinSteps
207+
## GenerateGroup
247208

248-
Prints all steps from all Gherkin contexts for a specific suite
209+
Creates empty GroupObject - extension which handles all group events.
249210

250-
{% highlight yaml %}
251-
codecept gherkin:steps Acceptance
211+
* `codecept g:group Admin`
252212

253-
{% endhighlight %}
254213

255214

215+
## GenerateScenarios
256216

257-
## GenerateSuite
217+
Generates user-friendly text scenarios from scenario-driven tests (Cest).
258218

259-
Create new test suite. Requires suite name and actor name
219+
* `codecept g:scenarios Acceptance` - for all acceptance tests
220+
* `codecept g:scenarios Acceptance --format html` - in html format
221+
* `codecept g:scenarios Acceptance --path doc` - generate scenarios to `doc` dir
260222

261-
* ``
262-
* `codecept g:suite Api` -> api + ApiTester
263-
* `codecept g:suite Integration Code` -> integration + CodeTester
264-
* `codecept g:suite Frontend Front` -> frontend + FrontTester
265223

266224

225+
## DryRun
267226

227+
Shows step-by-step execution process for scenario driven tests without actually running them.
268228

269-
## GenerateEnvironment
229+
* `codecept dry-run Acceptance`
230+
* `codecept dry-run Acceptance MyCest`
231+
* `codecept dry-run Acceptance checkout.feature`
232+
* `codecept dry-run tests/Acceptance/MyCest.php`
270233

271-
Generates empty environment configuration file into envs dir:
272234

273-
* `codecept g:env firefox`
274235

275-
Required to have `envs` path to be specified in `codeception.yml`
276236

237+
## GeneratePageObject
277238

239+
Generates PageObject. Can be generated either globally, or just for one suite.
240+
If PageObject is generated globally it will act as UIMap, without any logic in it.
278241

279-
## Init
242+
* `codecept g:page Login`
243+
* `codecept g:page Registration`
244+
* `codecept g:page Acceptance Login`
280245

281246

282247

@@ -289,14 +254,33 @@ Generates skeleton for Unit Test that extends `Codeception\TestCase\Test`.
289254

290255

291256

292-
## DryRun
257+
## Console
293258

294-
Shows step-by-step execution process for scenario driven tests without actually running them.
259+
Try to execute test commands in run-time. You may try commands before writing the test.
295260

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`
261+
* `codecept console Acceptance` - starts acceptance suite environment. If you use WebDriver you can manipulate browser with Codeception commands.
262+
263+
264+
265+
266+
## GenerateStepObject
267+
268+
Generates StepObject class. You will be asked for steps you want to implement.
269+
270+
* `codecept g:stepobject Acceptance AdminSteps`
271+
* `codecept g:stepobject Acceptance UserSteps --silent` - skip action questions
272+
273+
274+
275+
276+
## GenerateCest
277+
278+
Generates Cest (scenario-driven object-oriented test) file:
279+
280+
* `codecept generate:cest suite Login`
281+
* `codecept g:cest suite subdir/subdir/testnameCest.php`
282+
* `codecept g:cest suite LoginCest -c path/to/project`
283+
* `codecept g:cest "App\Login"`
300284

301285

302286

@@ -336,3 +320,19 @@ Generates Feature file (in Gherkin):
336320

337321

338322

323+
## Bootstrap
324+
325+
Creates default config, tests directory and sample suites for current project.
326+
Use this command to start building a test suite.
327+
328+
By default, it will create 3 suites **Acceptance**, **Functional**, and **Unit**.
329+
330+
* `codecept bootstrap` - creates `tests` dir and `codeception.yml` in current dir.
331+
* `codecept bootstrap --empty` - creates `tests` dir without suites
332+
* `codecept bootstrap --namespace Frontend` - creates tests, and use `Frontend` namespace for actor classes and helpers.
333+
* `codecept bootstrap --actor Wizard` - sets actor as Wizard, to have `TestWizard` actor in tests.
334+
* `codecept bootstrap path/to/the/project` - provide different path to a project, where tests should be placed
335+
336+
337+
338+

0 commit comments

Comments
 (0)