Skip to content

Commit cff0995

Browse files
github-actions[bot]github-actions[bot]
authored andcommitted
updated
1 parent 5865947 commit cff0995

File tree

1 file changed

+97
-97
lines changed

1 file changed

+97
-97
lines changed

docs/reference/Commands.md

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

66
# Console Commands
77

8-
## CompletionFallback
9-
10-
11-
12-
## GenerateSnapshot
13-
14-
Generates Snapshot.
15-
Snapshot can be used to test dynamical data.
16-
If suite name is provided, an actor class will be included into placeholder
17-
18-
* `codecept g:snapshot UserEmails`
19-
* `codecept g:snapshot Products`
20-
* `codecept g:snapshot acceptance UserEmails`
21-
8+
## GenerateCest
229

10+
Generates Cest (scenario-driven object-oriented test) file:
2311

24-
## GenerateFeature
12+
* `codecept generate:cest suite Login`
13+
* `codecept g:cest suite subdir/subdir/testnameCest.php`
14+
* `codecept g:cest suite LoginCest -c path/to/project`
15+
* `codecept g:cest "App\Login"`
2516

26-
Generates Feature file (in Gherkin):
2717

28-
* `codecept generate:feature suite Login`
29-
* `codecept g:feature suite subdir/subdir/login.feature`
30-
* `codecept g:feature suite login.feature -c path/to/project`
3118

3219

20+
## GenerateGroup
3321

22+
Creates empty GroupObject - extension which handles all group events.
3423

35-
## Clean
24+
* `codecept g:group Admin`
3625

37-
Recursively cleans `output` directory and generated code.
3826

39-
* `codecept clean`
4027

28+
## GenerateStepObject
4129

30+
Generates StepObject class. You will be asked for steps you want to implement.
4231

32+
* `codecept g:stepobject acceptance AdminSteps`
33+
* `codecept g:stepobject acceptance UserSteps --silent` - skip action questions
4334

44-
## Init
4535

4636

4737

48-
## GenerateGroup
38+
## GenerateSnapshot
4939

50-
Creates empty GroupObject - extension which handles all group events.
40+
Generates Snapshot.
41+
Snapshot can be used to test dynamical data.
42+
If suite name is provided, an actor class will be included into placeholder
5143

52-
* `codecept g:group Admin`
44+
* `codecept g:snapshot UserEmails`
45+
* `codecept g:snapshot Products`
46+
* `codecept g:snapshot acceptance UserEmails`
5347

5448

5549

56-
## GenerateScenarios
50+
## GenerateFeature
5751

58-
Generates user-friendly text scenarios from scenario-driven tests (Cest).
52+
Generates Feature file (in Gherkin):
5953

60-
* `codecept g:scenarios acceptance` - for all acceptance tests
61-
* `codecept g:scenarios acceptance --format html` - in html format
62-
* `codecept g:scenarios acceptance --path doc` - generate scenarios to `doc` dir
54+
* `codecept generate:feature suite Login`
55+
* `codecept g:feature suite subdir/subdir/login.feature`
56+
* `codecept g:feature suite login.feature -c path/to/project`
6357

6458

6559

@@ -75,14 +69,28 @@ If PageObject is generated globally it will act as UIMap, without any logic in i
7569

7670

7771

78-
## GenerateSuite
72+
## Bootstrap
7973

80-
Create new test suite. Requires suite name and actor name
74+
Creates default config, tests directory and sample suites for current project.
75+
Use this command to start building a test suite.
76+
77+
By default it will create 3 suites **acceptance**, **functional**, and **unit**.
78+
79+
* `codecept bootstrap` - creates `tests` dir and `codeception.yml` in current dir.
80+
* `codecept bootstrap --empty` - creates `tests` dir without suites
81+
* `codecept bootstrap --namespace Frontend` - creates tests, and use `Frontend` namespace for actor classes and helpers.
82+
* `codecept bootstrap --actor Wizard` - sets actor as Wizard, to have `TestWizard` actor in tests.
83+
* `codecept bootstrap path/to/the/project` - provide different path to a project, where tests should be placed
8184

82-
* ``
83-
* `codecept g:suite api` -> api + ApiTester
84-
* `codecept g:suite integration Code` -> integration + CodeTester
85-
* `codecept g:suite frontend Front` -> frontend + FrontTester
85+
86+
87+
88+
## GenerateHelper
89+
90+
Creates empty Helper class.
91+
92+
* `codecept g:helper MyHelper`
93+
* `codecept g:helper "My\Helper"`
8694

8795

8896

@@ -98,49 +106,35 @@ Starting from Codeception 2.0 actor classes are auto-generated. Use this command
98106

99107

100108

101-
## GenerateEnvironment
102-
103-
Generates empty environment configuration file into envs dir:
104-
105-
* `codecept g:env firefox`
106-
107-
Required to have `envs` path to be specified in `codeception.yml`
108-
109+
## CompletionFallback
109110

110111

111-
## GenerateStepObject
112112

113-
Generates StepObject class. You will be asked for steps you want to implement.
113+
## Console
114114

115-
* `codecept g:stepobject acceptance AdminSteps`
116-
* `codecept g:stepobject acceptance UserSteps --silent` - skip action questions
115+
Try to execute test commands in run-time. You may try commands before writing the test.
117116

117+
* `codecept console acceptance` - starts acceptance suite environment. If you use WebDriver you can manipulate browser with Codeception commands.
118118

119119

120120

121-
## GenerateCest
121+
## GenerateTest
122122

123-
Generates Cest (scenario-driven object-oriented test) file:
123+
Generates skeleton for Unit Test that extends `Codeception\TestCase\Test`.
124124

125-
* `codecept generate:cest suite Login`
126-
* `codecept g:cest suite subdir/subdir/testnameCest.php`
127-
* `codecept g:cest suite LoginCest -c path/to/project`
128-
* `codecept g:cest "App\Login"`
125+
* `codecept g:test unit User`
126+
* `codecept g:test unit "App\User"`
129127

130128

131129

130+
## SelfUpdate
132131

133-
## GherkinSnippets
132+
Auto-updates phar archive from official site: 'https://codeception.com/codecept.phar' .
134133

135-
Generates code snippets for matched feature files in a suite.
136-
Code snippets are expected to be implemented in Actor or PageObjects
134+
* `php codecept.phar self-update`
137135

138-
Usage:
136+
@author Franck Cassedanne <franck@cassedanne.com>
139137

140-
* `codecept gherkin:snippets acceptance` - snippets from all feature of acceptance tests
141-
* `codecept gherkin:snippets acceptance/feature/users` - snippets from `feature/users` dir of acceptance tests
142-
* `codecept gherkin:snippets acceptance user_account.feature` - snippets from a single feature file
143-
* `codecept gherkin:snippets acceptance/feature/users/user_accout.feature` - snippets from feature file in a dir
144138

145139

146140

@@ -156,6 +150,10 @@ Shows step by step execution process for scenario driven tests without actually
156150

157151

158152

153+
## Init
154+
155+
156+
159157
## Run
160158

161159
Executes tests.
@@ -244,58 +242,69 @@ Options:
244242

245243

246244

247-
## SelfUpdate
245+
## GenerateSuite
248246

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

251-
* `php codecept.phar self-update`
249+
* ``
250+
* `codecept g:suite api` -> api + ApiTester
251+
* `codecept g:suite integration Code` -> integration + CodeTester
252+
* `codecept g:suite frontend Front` -> frontend + FrontTester
252253

253-
@author Franck Cassedanne <franck@cassedanne.com>
254254

255255

256256

257-
## Console
257+
## GenerateEnvironment
258258

259-
Try to execute test commands in run-time. You may try commands before writing the test.
259+
Generates empty environment configuration file into envs dir:
260260

261-
* `codecept console acceptance` - starts acceptance suite environment. If you use WebDriver you can manipulate browser with Codeception commands.
261+
* `codecept g:env firefox`
262262

263+
Required to have `envs` path to be specified in `codeception.yml`
263264

264265

265-
## Bootstrap
266266

267-
Creates default config, tests directory and sample suites for current project.
268-
Use this command to start building a test suite.
267+
## GherkinSnippets
269268

270-
By default it will create 3 suites **acceptance**, **functional**, and **unit**.
269+
Generates code snippets for matched feature files in a suite.
270+
Code snippets are expected to be implemented in Actor or PageObjects
271271

272-
* `codecept bootstrap` - creates `tests` dir and `codeception.yml` in current dir.
273-
* `codecept bootstrap --empty` - creates `tests` dir without suites
274-
* `codecept bootstrap --namespace Frontend` - creates tests, and use `Frontend` namespace for actor classes and helpers.
275-
* `codecept bootstrap --actor Wizard` - sets actor as Wizard, to have `TestWizard` actor in tests.
276-
* `codecept bootstrap path/to/the/project` - provide different path to a project, where tests should be placed
272+
Usage:
277273

274+
* `codecept gherkin:snippets acceptance` - snippets from all feature of acceptance tests
275+
* `codecept gherkin:snippets acceptance/feature/users` - snippets from `feature/users` dir of acceptance tests
276+
* `codecept gherkin:snippets acceptance user_account.feature` - snippets from a single feature file
277+
* `codecept gherkin:snippets acceptance/feature/users/user_accout.feature` - snippets from feature file in a dir
278278

279279

280280

281-
## GenerateHelper
281+
## GherkinSteps
282282

283-
Creates empty Helper class.
283+
Prints all steps from all Gherkin contexts for a specific suite
284284

285-
* `codecept g:helper MyHelper`
286-
* `codecept g:helper "My\Helper"`
285+
{% highlight yaml %}
286+
codecept gherkin:steps acceptance
287287

288+
{% endhighlight %}
288289

289290

290291

291-
## GherkinSteps
292292

293-
Prints all steps from all Gherkin contexts for a specific suite
293+
## GenerateScenarios
294294

295-
{% highlight yaml %}
296-
codecept gherkin:steps acceptance
295+
Generates user-friendly text scenarios from scenario-driven tests (Cest).
297296

298-
{% endhighlight %}
297+
* `codecept g:scenarios acceptance` - for all acceptance tests
298+
* `codecept g:scenarios acceptance --format html` - in html format
299+
* `codecept g:scenarios acceptance --path doc` - generate scenarios to `doc` dir
300+
301+
302+
303+
## Clean
304+
305+
Recursively cleans `output` directory and generated code.
306+
307+
* `codecept clean`
299308

300309

301310

@@ -324,12 +333,3 @@ Check overriding config values (like in `run` command)
324333

325334

326335

327-
## GenerateTest
328-
329-
Generates skeleton for Unit Test that extends `Codeception\TestCase\Test`.
330-
331-
* `codecept g:test unit User`
332-
* `codecept g:test unit "App\User"`
333-
334-
335-

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy