Skip to content

Commit 500d433

Browse files
github-actions[bot]github-actions[bot]
github-actions[bot]
authored and
github-actions[bot]
committed
updated
1 parent 94e0552 commit 500d433

File tree

1 file changed

+118
-118
lines changed

1 file changed

+118
-118
lines changed

docs/reference/Commands.md

+118-118
Original file line numberDiff line numberDiff line change
@@ -5,69 +5,6 @@ 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-
## GenerateScenarios
19-
20-
Generates user-friendly text scenarios from scenario-driven tests (Cest).
21-
22-
* `codecept g:scenarios acceptance` - for all acceptance tests
23-
* `codecept g:scenarios acceptance --format html` - in html format
24-
* `codecept g:scenarios acceptance --path doc` - generate scenarios to `doc` dir
25-
26-
27-
28-
## GenerateSnapshot
29-
30-
Generates Snapshot.
31-
Snapshot can be used to test dynamical data.
32-
If suite name is provided, an actor class will be included into placeholder
33-
34-
* `codecept g:snapshot UserEmails`
35-
* `codecept g:snapshot Products`
36-
* `codecept g:snapshot acceptance UserEmails`
37-
38-
39-
40-
## DryRun
41-
42-
Shows step-by-step execution process for scenario driven tests without actually running them.
43-
44-
* `codecept dry-run acceptance`
45-
* `codecept dry-run acceptance MyCest`
46-
* `codecept dry-run acceptance checkout.feature`
47-
* `codecept dry-run tests/acceptance/MyCest.php`
48-
49-
50-
51-
52-
## GenerateTest
53-
54-
Generates skeleton for Unit Test that extends `Codeception\TestCase\Test`.
55-
56-
* `codecept g:test unit User`
57-
* `codecept g:test unit "App\User"`
58-
59-
60-
61-
## GenerateHelper
62-
63-
Creates empty Helper class.
64-
65-
* `codecept g:helper MyHelper`
66-
* `codecept g:helper "My\Helper"`
67-
68-
69-
70-
718
## GherkinSnippets
729

7310
Generates code snippets for matched feature files in a suite.
@@ -82,24 +19,13 @@ Usage:
8219

8320

8421

85-
## GeneratePageObject
86-
87-
Generates PageObject. Can be generated either globally, or just for one suite.
88-
If PageObject is generated globally it will act as UIMap, without any logic in it.
89-
90-
* `codecept g:page Login`
91-
* `codecept g:page Registration`
92-
* `codecept g:page acceptance Login`
93-
94-
95-
96-
## GenerateEnvironment
22+
## GenerateHelper
9723

98-
Generates empty environment configuration file into envs dir:
24+
Creates empty Helper class.
9925

100-
* `codecept g:env firefox`
26+
* `codecept g:helper MyHelper`
27+
* `codecept g:helper "My\Helper"`
10128

102-
Required to have `envs` path to be specified in `codeception.yml`
10329

10430

10531

@@ -192,32 +118,64 @@ Options:
192118

193119

194120

121+
## GenerateSnapshot
122+
123+
Generates Snapshot.
124+
Snapshot can be used to test dynamical data.
125+
If suite name is provided, an actor class will be included into placeholder
126+
127+
* `codecept g:snapshot UserEmails`
128+
* `codecept g:snapshot Products`
129+
* `codecept g:snapshot acceptance UserEmails`
130+
131+
132+
133+
## GeneratePageObject
134+
135+
Generates PageObject. Can be generated either globally, or just for one suite.
136+
If PageObject is generated globally it will act as UIMap, without any logic in it.
137+
138+
* `codecept g:page Login`
139+
* `codecept g:page Registration`
140+
* `codecept g:page acceptance Login`
141+
142+
143+
195144
## CompletionFallback
196145

197146

198147

199-
## GherkinSteps
148+
## GenerateScenarios
200149

201-
Prints all steps from all Gherkin contexts for a specific suite
150+
Generates user-friendly text scenarios from scenario-driven tests (Cest).
202151

203-
{% highlight yaml %}
204-
codecept gherkin:steps acceptance
152+
* `codecept g:scenarios acceptance` - for all acceptance tests
153+
* `codecept g:scenarios acceptance --format html` - in html format
154+
* `codecept g:scenarios acceptance --path doc` - generate scenarios to `doc` dir
205155

206-
{% endhighlight %}
207156

208157

158+
## Bootstrap
159+
160+
Creates default config, tests directory and sample suites for current project.
161+
Use this command to start building a test suite.
209162

163+
By default, it will create 3 suites **Acceptance**, **Functional**, and **Unit**.
210164

211-
## Clean
165+
* `codecept bootstrap` - creates `tests` dir and `codeception.yml` in current dir.
166+
* `codecept bootstrap --empty` - creates `tests` dir without suites
167+
* `codecept bootstrap --namespace Frontend` - creates tests, and use `Frontend` namespace for actor classes and helpers.
168+
* `codecept bootstrap --actor Wizard` - sets actor as Wizard, to have `TestWizard` actor in tests.
169+
* `codecept bootstrap path/to/the/project` - provide different path to a project, where tests should be placed
212170

213-
Recursively cleans `output` directory and generated code.
214171

215-
* `codecept clean`
216172

217173

174+
## GenerateGroup
218175

176+
Creates empty GroupObject - extension which handles all group events.
219177

220-
## Init
178+
* `codecept g:group Admin`
221179

222180

223181

@@ -233,31 +191,35 @@ Generates Cest (scenario-driven object-oriented test) file:
233191

234192

235193

236-
## Console
194+
## GherkinSteps
237195

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

240-
* `codecept console acceptance` - starts acceptance suite environment. If you use WebDriver you can manipulate browser with Codeception commands.
198+
{% highlight yaml %}
199+
codecept gherkin:steps acceptance
241200

201+
{% endhighlight %}
242202

243203

244-
## GenerateSuite
245204

246-
Create new test suite. Requires suite name and actor name
247205

248-
* ``
249-
* `codecept g:suite api` -> api + ApiTester
250-
* `codecept g:suite integration Code` -> integration + CodeTester
251-
* `codecept g:suite frontend Front` -> frontend + FrontTester
206+
## GenerateFeature
252207

208+
Generates Feature file (in Gherkin):
253209

210+
* `codecept generate:feature suite Login`
211+
* `codecept g:feature suite subdir/subdir/login.feature`
212+
* `codecept g:feature suite login.feature -c path/to/project`
254213

255214

256-
## GenerateGroup
257215

258-
Creates empty GroupObject - extension which handles all group events.
259216

260-
* `codecept g:group Admin`
217+
## Clean
218+
219+
Recursively cleans `output` directory and generated code.
220+
221+
* `codecept clean`
222+
261223

262224

263225

@@ -271,44 +233,59 @@ Auto-updates phar archive from official site: 'https://codeception.com/codecept.
271233

272234

273235

274-
## Build
236+
## GenerateEnvironment
275237

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

279-
* `codecept build`
280-
* `codecept build path/to/project`
240+
* `codecept g:env firefox`
281241

242+
Required to have `envs` path to be specified in `codeception.yml`
282243

283244

284245

285-
## GenerateFeature
246+
## GenerateStepObject
286247

287-
Generates Feature file (in Gherkin):
248+
Generates StepObject class. You will be asked for steps you want to implement.
288249

289-
* `codecept generate:feature suite Login`
290-
* `codecept g:feature suite subdir/subdir/login.feature`
291-
* `codecept g:feature suite login.feature -c path/to/project`
250+
* `codecept g:stepobject acceptance AdminSteps`
251+
* `codecept g:stepobject acceptance UserSteps --silent` - skip action questions
292252

293253

294254

295255

296-
## Bootstrap
256+
## Init
297257

298-
Creates default config, tests directory and sample suites for current project.
299-
Use this command to start building a test suite.
300258

301-
By default, it will create 3 suites **Acceptance**, **Functional**, and **Unit**.
302259

303-
* `codecept bootstrap` - creates `tests` dir and `codeception.yml` in current dir.
304-
* `codecept bootstrap --empty` - creates `tests` dir without suites
305-
* `codecept bootstrap --namespace Frontend` - creates tests, and use `Frontend` namespace for actor classes and helpers.
306-
* `codecept bootstrap --actor Wizard` - sets actor as Wizard, to have `TestWizard` actor in tests.
307-
* `codecept bootstrap path/to/the/project` - provide different path to a project, where tests should be placed
260+
## GenerateSuite
261+
262+
Create new test suite. Requires suite name and actor name
263+
264+
* ``
265+
* `codecept g:suite api` -> api + ApiTester
266+
* `codecept g:suite integration Code` -> integration + CodeTester
267+
* `codecept g:suite frontend Front` -> frontend + FrontTester
308268

309269

310270

311271

272+
## GenerateTest
273+
274+
Generates skeleton for Unit Test that extends `Codeception\TestCase\Test`.
275+
276+
* `codecept g:test unit User`
277+
* `codecept g:test unit "App\User"`
278+
279+
280+
281+
## Console
282+
283+
Try to execute test commands in run-time. You may try commands before writing the test.
284+
285+
* `codecept console acceptance` - starts acceptance suite environment. If you use WebDriver you can manipulate browser with Codeception commands.
286+
287+
288+
312289
## ConfigValidate
313290

314291
Validates and prints Codeception config.
@@ -333,4 +310,27 @@ Check overriding config values (like in `run` command)
333310

334311

335312

313+
## Build
314+
315+
Generates Actor classes (initially Guy classes) from suite configs.
316+
Starting from Codeception 2.0 actor classes are auto-generated. Use this command to generate them manually.
317+
318+
* `codecept build`
319+
* `codecept build path/to/project`
320+
321+
322+
323+
324+
325+
## DryRun
326+
327+
Shows step-by-step execution process for scenario driven tests without actually running them.
328+
329+
* `codecept dry-run acceptance`
330+
* `codecept dry-run acceptance MyCest`
331+
* `codecept dry-run acceptance checkout.feature`
332+
* `codecept dry-run tests/acceptance/MyCest.php`
333+
334+
335+
336336

0 commit comments

Comments
 (0)