Skip to content

Commit d2fb18c

Browse files
github-actions[bot]github-actions[bot]
authored andcommitted
updated
1 parent 8afe9be commit d2fb18c

1 file changed

Lines changed: 131 additions & 131 deletions

File tree

docs/reference/Commands.md

Lines changed: 131 additions & 131 deletions
Original file line numberDiff line numberDiff line change
@@ -5,34 +5,6 @@ title: Commands - Codeception - Documentation
55

66
# Console Commands
77

8-
9-
## GenerateFeature
10-
11-
Generates Feature file (in Gherkin):
12-
13-
* `codecept generate:feature suite Login`
14-
* `codecept g:feature suite subdir/subdir/login.feature`
15-
* `codecept g:feature suite login.feature -c path/to/project`
16-
17-
18-
19-
20-
## GenerateSnapshot
21-
22-
Generates Snapshot.
23-
Snapshot can be used to test dynamical data.
24-
If suite name is provided, an actor class will be included into placeholder
25-
26-
* `codecept g:snapshot UserEmails`
27-
* `codecept g:snapshot Products`
28-
* `codecept g:snapshot Acceptance UserEmails`
29-
30-
31-
32-
## CompletionFallback
33-
34-
35-
368
## ConfigValidate
379

3810
Validates and prints Codeception config.
@@ -57,82 +29,35 @@ Check overriding config values (like in `run` command)
5729

5830

5931

60-
## Console
61-
62-
Try to execute test commands in run-time. You may try commands before writing the test.
63-
64-
* `codecept console Acceptance` - starts acceptance suite environment. If you use WebDriver you can manipulate browser with Codeception commands.
65-
66-
67-
68-
## GenerateHelper
69-
70-
Creates empty Helper class.
71-
72-
* `codecept g:helper MyHelper`
73-
* `codecept g:helper "My\Helper"`
74-
75-
76-
77-
## DryRun
78-
79-
Shows step-by-step execution process for scenario driven tests without actually running them.
80-
81-
* `codecept dry-run Acceptance`
82-
* `codecept dry-run Acceptance MyCest`
83-
* `codecept dry-run Acceptance checkout.feature`
84-
* `codecept dry-run tests/Acceptance/MyCest.php`
85-
86-
87-
88-
89-
## GenerateScenarios
90-
91-
Generates user-friendly text scenarios from scenario-driven tests (Cest).
92-
93-
* `codecept g:scenarios Acceptance` - for all acceptance tests
94-
* `codecept g:scenarios Acceptance --format html` - in html format
95-
* `codecept g:scenarios Acceptance --path doc` - generate scenarios to `doc` dir
96-
97-
98-
99-
## GeneratePageObject
100-
101-
Generates PageObject. Can be generated either globally, or just for one suite.
102-
If PageObject is generated globally it will act as UIMap, without any logic in it.
103-
104-
* `codecept g:page Login`
105-
* `codecept g:page Registration`
106-
* `codecept g:page Acceptance Login`
107-
108-
109-
110-
## GenerateSuite
111-
112-
Create new test suite. Requires suite name and actor name
32+
## GenerateSnapshot
11333

114-
* ``
115-
* `codecept g:suite Api` -> api + ApiTester
116-
* `codecept g:suite Integration Code` -> integration + CodeTester
117-
* `codecept g:suite Frontend Front` -> frontend + FrontTester
34+
Generates Snapshot.
35+
Snapshot can be used to test dynamical data.
36+
If suite name is provided, an actor class will be included into placeholder
11837

38+
* `codecept g:snapshot UserEmails`
39+
* `codecept g:snapshot Products`
40+
* `codecept g:snapshot Acceptance UserEmails`
11941

12042

12143

122-
## GenerateGroup
44+
## Bootstrap
12345

124-
Creates empty GroupObject - extension which handles all group events.
46+
Creates default config, tests directory and sample suites for current project.
47+
Use this command to start building a test suite.
12548

126-
* `codecept g:group Admin`
49+
By default, it will create 3 suites **Acceptance**, **Functional**, and **Unit**.
12750

51+
* `codecept bootstrap` - creates `tests` dir and `codeception.yml` in current dir.
52+
* `codecept bootstrap --empty` - creates `tests` dir without suites
53+
* `codecept bootstrap --namespace Frontend` - creates tests, and use `Frontend` namespace for actor classes and helpers.
54+
* `codecept bootstrap --actor Wizard` - sets actor as Wizard, to have `TestWizard` actor in tests.
55+
* `codecept bootstrap path/to/the/project` - provide different path to a project, where tests should be placed
12856

12957

130-
## GenerateTest
13158

132-
Generates skeleton for Unit Test that extends `Codeception\TestCase\Test`.
13359

134-
* `codecept g:test Unit User`
135-
* `codecept g:test Unit "App\User"`
60+
## CompletionFallback
13661

13762

13863

@@ -146,18 +71,12 @@ Auto-updates phar archive from official site: 'https://codeception.com/codecept.
14671

14772

14873

149-
## Bootstrap
150-
151-
Creates default config, tests directory and sample suites for current project.
152-
Use this command to start building a test suite.
74+
## GenerateStepObject
15375

154-
By default, it will create 3 suites **Acceptance**, **Functional**, and **Unit**.
76+
Generates StepObject class. You will be asked for steps you want to implement.
15577

156-
* `codecept bootstrap` - creates `tests` dir and `codeception.yml` in current dir.
157-
* `codecept bootstrap --empty` - creates `tests` dir without suites
158-
* `codecept bootstrap --namespace Frontend` - creates tests, and use `Frontend` namespace for actor classes and helpers.
159-
* `codecept bootstrap --actor Wizard` - sets actor as Wizard, to have `TestWizard` actor in tests.
160-
* `codecept bootstrap path/to/the/project` - provide different path to a project, where tests should be placed
78+
* `codecept g:stepobject Acceptance AdminSteps`
79+
* `codecept g:stepobject Acceptance UserSteps --silent` - skip action questions
16180

16281

16382

@@ -176,28 +95,6 @@ Usage:
17695

17796

17897

179-
## GenerateStepObject
180-
181-
Generates StepObject class. You will be asked for steps you want to implement.
182-
183-
* `codecept g:stepobject Acceptance AdminSteps`
184-
* `codecept g:stepobject Acceptance UserSteps --silent` - skip action questions
185-
186-
187-
188-
189-
## GenerateCest
190-
191-
Generates Cest (scenario-driven object-oriented test) file:
192-
193-
* `codecept generate:cest suite Login`
194-
* `codecept g:cest suite subdir/subdir/testnameCest.php`
195-
* `codecept g:cest suite LoginCest -c path/to/project`
196-
* `codecept g:cest "App\Login"`
197-
198-
199-
200-
20198
## Run
20299

203100
Executes tests.
@@ -291,14 +188,12 @@ Options:
291188

292189

293190

294-
## Build
295-
296-
Generates Actor classes (initially Guy classes) from suite configs.
297-
Starting from Codeception 2.0 actor classes are auto-generated. Use this command to generate them manually.
191+
## GenerateTest
298192

299-
* `codecept build`
300-
* `codecept build path/to/project`
193+
Generates skeleton for Unit Test that extends `Codeception\TestCase\Test`.
301194

195+
* `codecept g:test Unit User`
196+
* `codecept g:test Unit "App\User"`
302197

303198

304199

@@ -311,6 +206,96 @@ Recursively cleans `output` directory and generated code.
311206

312207

313208

209+
## DryRun
210+
211+
Shows step-by-step execution process for scenario driven tests without actually running them.
212+
213+
* `codecept dry-run Acceptance`
214+
* `codecept dry-run Acceptance MyCest`
215+
* `codecept dry-run Acceptance checkout.feature`
216+
* `codecept dry-run tests/Acceptance/MyCest.php`
217+
218+
219+
220+
221+
## GenerateGroup
222+
223+
Creates empty GroupObject - extension which handles all group events.
224+
225+
* `codecept g:group Admin`
226+
227+
228+
229+
230+
## GenerateCest
231+
232+
Generates Cest (scenario-driven object-oriented test) file:
233+
234+
* `codecept generate:cest suite Login`
235+
* `codecept g:cest suite subdir/subdir/testnameCest.php`
236+
* `codecept g:cest suite LoginCest -c path/to/project`
237+
* `codecept g:cest "App\Login"`
238+
239+
240+
241+
242+
## GenerateFeature
243+
244+
Generates Feature file (in Gherkin):
245+
246+
* `codecept generate:feature suite Login`
247+
* `codecept g:feature suite subdir/subdir/login.feature`
248+
* `codecept g:feature suite login.feature -c path/to/project`
249+
250+
251+
252+
253+
## GeneratePageObject
254+
255+
Generates PageObject. Can be generated either globally, or just for one suite.
256+
If PageObject is generated globally it will act as UIMap, without any logic in it.
257+
258+
* `codecept g:page Login`
259+
* `codecept g:page Registration`
260+
* `codecept g:page Acceptance Login`
261+
262+
263+
264+
## GenerateSuite
265+
266+
Create new test suite. Requires suite name and actor name
267+
268+
* ``
269+
* `codecept g:suite Api` -> api + ApiTester
270+
* `codecept g:suite Integration Code` -> integration + CodeTester
271+
* `codecept g:suite Frontend Front` -> frontend + FrontTester
272+
273+
274+
275+
276+
## GenerateHelper
277+
278+
Creates empty Helper class.
279+
280+
* `codecept g:helper MyHelper`
281+
* `codecept g:helper "My\Helper"`
282+
283+
284+
285+
## GenerateScenarios
286+
287+
Generates user-friendly text scenarios from scenario-driven tests (Cest).
288+
289+
* `codecept g:scenarios Acceptance` - for all acceptance tests
290+
* `codecept g:scenarios Acceptance --format html` - in html format
291+
* `codecept g:scenarios Acceptance --path doc` - generate scenarios to `doc` dir
292+
293+
294+
295+
## Init
296+
297+
298+
314299
## GenerateEnvironment
315300

316301
Generates empty environment configuration file into envs dir:
@@ -321,7 +306,14 @@ Required to have `envs` path to be specified in `codeception.yml`
321306

322307

323308

324-
## Init
309+
## Build
310+
311+
Generates Actor classes (initially Guy classes) from suite configs.
312+
Starting from Codeception 2.0 actor classes are auto-generated. Use this command to generate them manually.
313+
314+
* `codecept build`
315+
* `codecept build path/to/project`
316+
325317

326318

327319

@@ -336,3 +328,11 @@ codecept gherkin:steps Acceptance
336328

337329

338330

331+
## Console
332+
333+
Try to execute test commands in run-time. You may try commands before writing the test.
334+
335+
* `codecept console Acceptance` - starts acceptance suite environment. If you use WebDriver you can manipulate browser with Codeception commands.
336+
337+
338+

0 commit comments

Comments
 (0)