Skip to content

Commit 9bf1fb5

Browse files
github-actions[bot]github-actions[bot]
authored andcommitted
updated
1 parent 0421491 commit 9bf1fb5

1 file changed

Lines changed: 149 additions & 149 deletions

File tree

docs/reference/Commands.md

Lines changed: 149 additions & 149 deletions
Original file line numberDiff line numberDiff line change
@@ -14,65 +14,65 @@ Generates skeleton for Unit Test that extends `Codeception\TestCase\Test`.
1414

1515

1616

17-
## GenerateEnvironment
17+
## DryRun
1818

19-
Generates empty environment configuration file into envs dir:
19+
Shows step-by-step execution process for scenario driven tests without actually running them.
2020

21-
* `codecept g:env firefox`
21+
* `codecept dry-run Acceptance`
22+
* `codecept dry-run Acceptance MyCest`
23+
* `codecept dry-run Acceptance checkout.feature`
24+
* `codecept dry-run tests/Acceptance/MyCest.php`
2225

23-
Required to have `envs` path to be specified in `codeception.yml`
2426

2527

2628

27-
## GeneratePageObject
29+
## Clean
2830

29-
Generates PageObject. Can be generated either globally, or just for one suite.
30-
If PageObject is generated globally it will act as UIMap, without any logic in it.
31+
Recursively cleans `output` directory and generated code.
3132

32-
* `codecept g:page Login`
33-
* `codecept g:page Registration`
34-
* `codecept g:page Acceptance Login`
33+
* `codecept clean`
3534

3635

3736

38-
## GherkinSnippets
3937

40-
Generates code snippets for matched feature files in a suite.
41-
Code snippets are expected to be implemented in Actor or PageObjects
38+
## GenerateStepObject
4239

43-
Usage:
40+
Generates StepObject class. You will be asked for steps you want to implement.
4441

45-
* `codecept gherkin:snippets Acceptance` - snippets from all feature of acceptance tests
46-
* `codecept gherkin:snippets Acceptance/feature/users` - snippets from `feature/users` dir of acceptance tests
47-
* `codecept gherkin:snippets Acceptance user_account.feature` - snippets from a single feature file
48-
* `codecept gherkin:snippets Acceptance/feature/users/user_accout.feature` - snippets from feature file in a dir
42+
* `codecept g:stepobject Acceptance AdminSteps`
43+
* `codecept g:stepobject Acceptance UserSteps --silent` - skip action questions
4944

5045

5146

52-
## ConfigValidate
5347

54-
Validates and prints Codeception config.
55-
Use it do debug Yaml configs
48+
## CompletionFallback
5649

57-
Check config:
5850

59-
* `codecept config`: check global config
60-
* `codecept config Unit`: check suite config
6151

62-
Load config:
52+
## Init
6353

64-
* `codecept config:validate -c path/to/another/config`: from another dir
65-
* `codecept config:validate -c another_config.yml`: from another config file
6654

67-
Check overriding config values (like in `run` command)
6855

69-
* `codecept config:validate -o "settings: shuffle: true"`: enable shuffle
70-
* `codecept config:validate -o "settings: lint: false"`: disable linting
71-
* `codecept config:validate -o "reporters: report: \Custom\Reporter" --report`: use custom reporter
56+
## GenerateFeature
57+
58+
Generates Feature file (in Gherkin):
59+
60+
* `codecept generate:feature suite Login`
61+
* `codecept g:feature suite subdir/subdir/login.feature`
62+
* `codecept g:feature suite login.feature -c path/to/project`
7263

7364

7465

7566

67+
68+
## Console
69+
70+
Try to execute test commands in run-time. You may try commands before writing the test.
71+
72+
* `codecept console Acceptance` - starts acceptance suite environment. If you use WebDriver you can manipulate browser with Codeception commands.
73+
74+
75+
7676
## GherkinSteps
7777

7878
Prints all steps from all Gherkin contexts for a specific suite
@@ -84,24 +84,47 @@ codecept gherkin:steps Acceptance
8484

8585

8686

87-
## GenerateScenarios
87+
## SelfUpdate
8888

89-
Generates user-friendly text scenarios from scenario-driven tests (Cest).
89+
Auto-updates phar archive from official site: 'https://codeception.com/codecept.phar' .
9090

91-
* `codecept g:scenarios Acceptance` - for all acceptance tests
92-
* `codecept g:scenarios Acceptance --format html` - in html format
93-
* `codecept g:scenarios Acceptance --path doc` - generate scenarios to `doc` dir
91+
* `php codecept.phar self-update`
9492

93+
@author Franck Cassedanne <franck@cassedanne.com>
9594

9695

97-
## GenerateStepObject
9896

99-
Generates StepObject class. You will be asked for steps you want to implement.
97+
## GenerateEnvironment
98+
99+
Generates empty environment configuration file into envs dir:
100+
101+
* `codecept g:env firefox`
102+
103+
Required to have `envs` path to be specified in `codeception.yml`
100104

101-
* `codecept g:stepobject Acceptance AdminSteps`
102-
* `codecept g:stepobject Acceptance UserSteps --silent` - skip action questions
103105

104106

107+
## GenerateCest
108+
109+
Generates Cest (scenario-driven object-oriented test) file:
110+
111+
* `codecept generate:cest suite Login`
112+
* `codecept g:cest suite subdir/subdir/testnameCest.php`
113+
* `codecept g:cest suite LoginCest -c path/to/project`
114+
* `codecept g:cest "App\Login"`
115+
116+
117+
118+
119+
## GeneratePageObject
120+
121+
Generates PageObject. Can be generated either globally, or just for one suite.
122+
If PageObject is generated globally it will act as UIMap, without any logic in it.
123+
124+
* `codecept g:page Login`
125+
* `codecept g:page Registration`
126+
* `codecept g:page Acceptance Login`
127+
105128

106129

107130
## GenerateSnapshot
@@ -116,19 +139,62 @@ If suite name is provided, an actor class will be included into placeholder
116139

117140

118141

119-
## GenerateSuite
142+
## Build
120143

121-
Create new test suite. Requires suite name and actor name
144+
Generates Actor classes (initially Guy classes) from suite configs.
145+
Starting from Codeception 2.0 actor classes are auto-generated. Use this command to generate them manually.
122146

123-
* ``
124-
* `codecept g:suite Api` -> api + ApiTester
125-
* `codecept g:suite Integration Code` -> integration + CodeTester
126-
* `codecept g:suite Frontend Front` -> frontend + FrontTester
147+
* `codecept build`
148+
* `codecept build path/to/project`
127149

128150

129151

130152

131-
## Init
153+
## GherkinSnippets
154+
155+
Generates code snippets for matched feature files in a suite.
156+
Code snippets are expected to be implemented in Actor or PageObjects
157+
158+
Usage:
159+
160+
* `codecept gherkin:snippets Acceptance` - snippets from all feature of acceptance tests
161+
* `codecept gherkin:snippets Acceptance/feature/users` - snippets from `feature/users` dir of acceptance tests
162+
* `codecept gherkin:snippets Acceptance user_account.feature` - snippets from a single feature file
163+
* `codecept gherkin:snippets Acceptance/feature/users/user_accout.feature` - snippets from feature file in a dir
164+
165+
166+
167+
## GenerateGroup
168+
169+
Creates empty GroupObject - extension which handles all group events.
170+
171+
* `codecept g:group Admin`
172+
173+
174+
175+
## Bootstrap
176+
177+
Creates default config, tests directory and sample suites for current project.
178+
Use this command to start building a test suite.
179+
180+
By default, it will create 3 suites **Acceptance**, **Functional**, and **Unit**.
181+
182+
* `codecept bootstrap` - creates `tests` dir and `codeception.yml` in current dir.
183+
* `codecept bootstrap --empty` - creates `tests` dir without suites
184+
* `codecept bootstrap --namespace Frontend` - creates tests, and use `Frontend` namespace for actor classes and helpers.
185+
* `codecept bootstrap --actor Wizard` - sets actor as Wizard, to have `TestWizard` actor in tests.
186+
* `codecept bootstrap path/to/the/project` - provide different path to a project, where tests should be placed
187+
188+
189+
190+
191+
## GenerateScenarios
192+
193+
Generates user-friendly text scenarios from scenario-driven tests (Cest).
194+
195+
* `codecept g:scenarios Acceptance` - for all acceptance tests
196+
* `codecept g:scenarios Acceptance --format html` - in html format
197+
* `codecept g:scenarios Acceptance --path doc` - generate scenarios to `doc` dir
132198

133199

134200

@@ -141,6 +207,42 @@ Creates empty Helper class.
141207

142208

143209

210+
## ConfigValidate
211+
212+
Validates and prints Codeception config.
213+
Use it do debug Yaml configs
214+
215+
Check config:
216+
217+
* `codecept config`: check global config
218+
* `codecept config Unit`: check suite config
219+
220+
Load config:
221+
222+
* `codecept config:validate -c path/to/another/config`: from another dir
223+
* `codecept config:validate -c another_config.yml`: from another config file
224+
225+
Check overriding config values (like in `run` command)
226+
227+
* `codecept config:validate -o "settings: shuffle: true"`: enable shuffle
228+
* `codecept config:validate -o "settings: lint: false"`: disable linting
229+
* `codecept config:validate -o "reporters: report: \Custom\Reporter" --report`: use custom reporter
230+
231+
232+
233+
234+
## GenerateSuite
235+
236+
Create new test suite. Requires suite name and actor name
237+
238+
* ``
239+
* `codecept g:suite Api` -> api + ApiTester
240+
* `codecept g:suite Integration Code` -> integration + CodeTester
241+
* `codecept g:suite Frontend Front` -> frontend + FrontTester
242+
243+
244+
245+
144246
## Run
145247

146248
Executes tests.
@@ -234,105 +336,3 @@ Options:
234336

235337

236338

237-
## GenerateCest
238-
239-
Generates Cest (scenario-driven object-oriented test) file:
240-
241-
* `codecept generate:cest suite Login`
242-
* `codecept g:cest suite subdir/subdir/testnameCest.php`
243-
* `codecept g:cest suite LoginCest -c path/to/project`
244-
* `codecept g:cest "App\Login"`
245-
246-
247-
248-
249-
## Console
250-
251-
Try to execute test commands in run-time. You may try commands before writing the test.
252-
253-
* `codecept console Acceptance` - starts acceptance suite environment. If you use WebDriver you can manipulate browser with Codeception commands.
254-
255-
256-
257-
## GenerateGroup
258-
259-
Creates empty GroupObject - extension which handles all group events.
260-
261-
* `codecept g:group Admin`
262-
263-
264-
265-
266-
## CompletionFallback
267-
268-
269-
270-
## Bootstrap
271-
272-
Creates default config, tests directory and sample suites for current project.
273-
Use this command to start building a test suite.
274-
275-
By default, it will create 3 suites **Acceptance**, **Functional**, and **Unit**.
276-
277-
* `codecept bootstrap` - creates `tests` dir and `codeception.yml` in current dir.
278-
* `codecept bootstrap --empty` - creates `tests` dir without suites
279-
* `codecept bootstrap --namespace Frontend` - creates tests, and use `Frontend` namespace for actor classes and helpers.
280-
* `codecept bootstrap --actor Wizard` - sets actor as Wizard, to have `TestWizard` actor in tests.
281-
* `codecept bootstrap path/to/the/project` - provide different path to a project, where tests should be placed
282-
283-
284-
285-
286-
## DryRun
287-
288-
Shows step-by-step execution process for scenario driven tests without actually running them.
289-
290-
* `codecept dry-run Acceptance`
291-
* `codecept dry-run Acceptance MyCest`
292-
* `codecept dry-run Acceptance checkout.feature`
293-
* `codecept dry-run tests/Acceptance/MyCest.php`
294-
295-
296-
297-
298-
## Build
299-
300-
Generates Actor classes (initially Guy classes) from suite configs.
301-
Starting from Codeception 2.0 actor classes are auto-generated. Use this command to generate them manually.
302-
303-
* `codecept build`
304-
* `codecept build path/to/project`
305-
306-
307-
308-
309-
## GenerateFeature
310-
311-
Generates Feature file (in Gherkin):
312-
313-
* `codecept generate:feature suite Login`
314-
* `codecept g:feature suite subdir/subdir/login.feature`
315-
* `codecept g:feature suite login.feature -c path/to/project`
316-
317-
318-
319-
320-
## SelfUpdate
321-
322-
Auto-updates phar archive from official site: 'https://codeception.com/codecept.phar' .
323-
324-
* `php codecept.phar self-update`
325-
326-
@author Franck Cassedanne <franck@cassedanne.com>
327-
328-
329-
330-
## Clean
331-
332-
Recursively cleans `output` directory and generated code.
333-
334-
* `codecept clean`
335-
336-
337-
338-

0 commit comments

Comments
 (0)