Skip to content

Commit ae124f5

Browse files
github-actions[bot]github-actions[bot]
authored andcommitted
updated
1 parent eda89fb commit ae124f5

File tree

1 file changed

+93
-93
lines changed

1 file changed

+93
-93
lines changed

docs/reference/Commands.md

Lines changed: 93 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,7 @@ title: Commands - Codeception - Documentation
55

66
# Console Commands
77

8-
## GenerateScenarios
9-
10-
Generates user-friendly text scenarios from scenario-driven tests (Cest).
11-
12-
* `codecept g:scenarios acceptance` - for all acceptance tests
13-
* `codecept g:scenarios acceptance --format html` - in html format
14-
* `codecept g:scenarios acceptance --path doc` - generate scenarios to `doc` dir
8+
## Init
159

1610

1711

@@ -29,67 +23,77 @@ Usage:
2923

3024

3125

32-
## GenerateTest
26+
## Console
3327

34-
Generates skeleton for Unit Test that extends `Codeception\TestCase\Test`.
28+
Try to execute test commands in run-time. You may try commands before writing the test.
3529

36-
* `codecept g:test unit User`
37-
* `codecept g:test unit "App\User"`
30+
* `codecept console acceptance` - starts acceptance suite environment. If you use WebDriver you can manipulate browser with Codeception commands.
3831

3932

4033

41-
## SelfUpdate
34+
## ConfigValidate
4235

43-
Auto-updates phar archive from official site: 'https://codeception.com/codecept.phar' .
36+
Validates and prints Codeception config.
37+
Use it do debug Yaml configs
4438

45-
* `php codecept.phar self-update`
39+
Check config:
4640

47-
@author Franck Cassedanne <franck@cassedanne.com>
41+
* `codecept config`: check global config
42+
* `codecept config unit`: check suite config
4843

44+
Load config:
4945

46+
* `codecept config:validate -c path/to/another/config`: from another dir
47+
* `codecept config:validate -c another_config.yml`: from another config file
5048

51-
## GenerateFeature
49+
Check overriding config values (like in `run` command)
5250

53-
Generates Feature file (in Gherkin):
51+
* `codecept config:validate -o "settings: shuffle: true"`: enable shuffle
52+
* `codecept config:validate -o "settings: lint: false"`: disable linting
53+
* `codecept config:validate -o "reporters: report: \Custom\Reporter" --report`: use custom reporter
5454

55-
* `codecept generate:feature suite Login`
56-
* `codecept g:feature suite subdir/subdir/login.feature`
57-
* `codecept g:feature suite login.feature -c path/to/project`
5855

5956

6057

58+
## Clean
6159

62-
## CompletionFallback
60+
Recursively cleans `output` directory and generated code.
6361

62+
* `codecept clean`
6463

6564

66-
## Console
6765

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

70-
* `codecept console acceptance` - starts acceptance suite environment. If you use WebDriver you can manipulate browser with Codeception commands.
67+
## GenerateSnapshot
7168

69+
Generates Snapshot.
70+
Snapshot can be used to test dynamical data.
71+
If suite name is provided, an actor class will be included into placeholder
7272

73+
* `codecept g:snapshot UserEmails`
74+
* `codecept g:snapshot Products`
75+
* `codecept g:snapshot acceptance UserEmails`
7376

74-
## GeneratePageObject
7577

76-
Generates PageObject. Can be generated either globally, or just for one suite.
77-
If PageObject is generated globally it will act as UIMap, without any logic in it.
7878

79-
* `codecept g:page Login`
80-
* `codecept g:page Registration`
81-
* `codecept g:page acceptance Login`
79+
## Build
8280

81+
Generates Actor classes (initially Guy classes) from suite configs.
82+
Starting from Codeception 2.0 actor classes are auto-generated. Use this command to generate them manually.
8383

84+
* `codecept build`
85+
* `codecept build path/to/project`
8486

85-
## GenerateStepObject
8687

87-
Generates StepObject class. You will be asked for steps you want to implement.
8888

89-
* `codecept g:stepobject acceptance AdminSteps`
90-
* `codecept g:stepobject acceptance UserSteps --silent` - skip action questions
9189

9290

91+
## GenerateGroup
92+
93+
Creates empty GroupObject - extension which handles all group events.
94+
95+
* `codecept g:group Admin`
96+
9397

9498

9599
## Run
@@ -180,38 +184,44 @@ Options:
180184

181185

182186

183-
## GherkinSteps
187+
## SelfUpdate
184188

185-
Prints all steps from all Gherkin contexts for a specific suite
189+
Auto-updates phar archive from official site: 'https://codeception.com/codecept.phar' .
186190

187-
{% highlight yaml %}
188-
codecept gherkin:steps acceptance
191+
* `php codecept.phar self-update`
189192

190-
{% endhighlight %}
193+
@author Franck Cassedanne <franck@cassedanne.com>
191194

192195

193196

197+
## GenerateTest
194198

195-
## Clean
199+
Generates skeleton for Unit Test that extends `Codeception\TestCase\Test`.
196200

197-
Recursively cleans `output` directory and generated code.
201+
* `codecept g:test unit User`
202+
* `codecept g:test unit "App\User"`
198203

199-
* `codecept clean`
200204

201205

206+
## GenerateSuite
202207

208+
Create new test suite. Requires suite name and actor name
203209

204-
## GenerateHelper
210+
* ``
211+
* `codecept g:suite api` -> api + ApiTester
212+
* `codecept g:suite integration Code` -> integration + CodeTester
213+
* `codecept g:suite frontend Front` -> frontend + FrontTester
205214

206-
Creates empty Helper class.
207215

208-
* `codecept g:helper MyHelper`
209-
* `codecept g:helper "My\Helper"`
210216

211217

218+
## GenerateScenarios
212219

220+
Generates user-friendly text scenarios from scenario-driven tests (Cest).
213221

214-
## Init
222+
* `codecept g:scenarios acceptance` - for all acceptance tests
223+
* `codecept g:scenarios acceptance --format html` - in html format
224+
* `codecept g:scenarios acceptance --path doc` - generate scenarios to `doc` dir
215225

216226

217227

@@ -227,37 +237,12 @@ Generates Cest (scenario-driven object-oriented test) file:
227237

228238

229239

230-
## ConfigValidate
231-
232-
Validates and prints Codeception config.
233-
Use it do debug Yaml configs
234-
235-
Check config:
236-
237-
* `codecept config`: check global config
238-
* `codecept config unit`: check suite config
239-
240-
Load config:
241-
242-
* `codecept config:validate -c path/to/another/config`: from another dir
243-
* `codecept config:validate -c another_config.yml`: from another config file
244-
245-
Check overriding config values (like in `run` command)
246-
247-
* `codecept config:validate -o "settings: shuffle: true"`: enable shuffle
248-
* `codecept config:validate -o "settings: lint: false"`: disable linting
249-
* `codecept config:validate -o "reporters: report: \Custom\Reporter" --report`: use custom reporter
250-
251-
252-
253-
254-
## Build
240+
## GenerateHelper
255241

256-
Generates Actor classes (initially Guy classes) from suite configs.
257-
Starting from Codeception 2.0 actor classes are auto-generated. Use this command to generate them manually.
242+
Creates empty Helper class.
258243

259-
* `codecept build`
260-
* `codecept build path/to/project`
244+
* `codecept g:helper MyHelper`
245+
* `codecept g:helper "My\Helper"`
261246

262247

263248

@@ -278,24 +263,24 @@ By default it will create 3 suites **acceptance**, **functional**, and **unit**.
278263

279264

280265

281-
## GenerateSuite
282-
283-
Create new test suite. Requires suite name and actor name
266+
## GenerateStepObject
284267

285-
* ``
286-
* `codecept g:suite api` -> api + ApiTester
287-
* `codecept g:suite integration Code` -> integration + CodeTester
288-
* `codecept g:suite frontend Front` -> frontend + FrontTester
268+
Generates StepObject class. You will be asked for steps you want to implement.
289269

270+
* `codecept g:stepobject acceptance AdminSteps`
271+
* `codecept g:stepobject acceptance UserSteps --silent` - skip action questions
290272

291273

292274

293-
## GenerateGroup
294275

295-
Creates empty GroupObject - extension which handles all group events.
276+
## GeneratePageObject
296277

297-
* `codecept g:group Admin`
278+
Generates PageObject. Can be generated either globally, or just for one suite.
279+
If PageObject is generated globally it will act as UIMap, without any logic in it.
298280

281+
* `codecept g:page Login`
282+
* `codecept g:page Registration`
283+
* `codecept g:page acceptance Login`
299284

300285

301286

@@ -309,6 +294,17 @@ Required to have `envs` path to be specified in `codeception.yml`
309294

310295

311296

297+
## GenerateFeature
298+
299+
Generates Feature file (in Gherkin):
300+
301+
* `codecept generate:feature suite Login`
302+
* `codecept g:feature suite subdir/subdir/login.feature`
303+
* `codecept g:feature suite login.feature -c path/to/project`
304+
305+
306+
307+
312308
## DryRun
313309

314310
Shows step by step execution process for scenario driven tests without actually running them.
@@ -321,15 +317,19 @@ Shows step by step execution process for scenario driven tests without actually
321317

322318

323319

324-
## GenerateSnapshot
320+
## GherkinSteps
325321

326-
Generates Snapshot.
327-
Snapshot can be used to test dynamical data.
328-
If suite name is provided, an actor class will be included into placeholder
322+
Prints all steps from all Gherkin contexts for a specific suite
329323

330-
* `codecept g:snapshot UserEmails`
331-
* `codecept g:snapshot Products`
332-
* `codecept g:snapshot acceptance UserEmails`
324+
{% highlight yaml %}
325+
codecept gherkin:steps acceptance
326+
327+
{% endhighlight %}
328+
329+
330+
331+
332+
## CompletionFallback
333333

334334

335335

0 commit comments

Comments
 (0)