Skip to content

Commit

Permalink
updated
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] authored and github-actions[bot] committed Jul 24, 2024
1 parent 64ef891 commit 8f29f3c
Showing 1 changed file with 108 additions and 108 deletions.
216 changes: 108 additions & 108 deletions docs/reference/Commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,48 +15,69 @@ Auto-updates phar archive from official site: 'https://codeception.com/codecept.



## Init

## GenerateGroup

Creates empty GroupObject - extension which handles all group events.

* `codecept g:group Admin`
## GherkinSnippets

Generates code snippets for matched feature files in a suite.
Code snippets are expected to be implemented in Actor or PageObjects

Usage:

## ConfigValidate
* `codecept gherkin:snippets acceptance` - snippets from all feature of acceptance tests
* `codecept gherkin:snippets acceptance/feature/users` - snippets from `feature/users` dir of acceptance tests
* `codecept gherkin:snippets acceptance user_account.feature` - snippets from a single feature file
* `codecept gherkin:snippets acceptance/feature/users/user_accout.feature` - snippets from feature file in a dir

Validates and prints Codeception config.
Use it do debug Yaml configs

Check config:

* `codecept config`: check global config
* `codecept config unit`: check suite config
## GenerateEnvironment

Load config:
Generates empty environment configuration file into envs dir:

* `codecept config:validate -c path/to/another/config`: from another dir
* `codecept config:validate -c another_config.yml`: from another config file
* `codecept g:env firefox`

Check overriding config values (like in `run` command)
Required to have `envs` path to be specified in `codeception.yml`

* `codecept config:validate -o "settings: shuffle: true"`: enable shuffle
* `codecept config:validate -o "settings: lint: false"`: disable linting
* `codecept config:validate -o "reporters: report: \Custom\Reporter" --report`: use custom reporter


## CompletionFallback


## CompletionFallback

## DryRun

Shows step by step execution process for scenario driven tests without actually running them.

## Console
* `codecept dry-run acceptance`
* `codecept dry-run acceptance MyCest`
* `codecept dry-run acceptance checkout.feature`
* `codecept dry-run tests/acceptance/MyCest.php`

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

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


## GenerateHelper

Creates empty Helper class.

* `codecept g:helper MyHelper`
* `codecept g:helper "My\Helper"`




## GenerateSuite

Create new test suite. Requires suite name and actor name

* ``
* `codecept g:suite api` -> api + ApiTester
* `codecept g:suite integration Code` -> integration + CodeTester
* `codecept g:suite frontend Front` -> frontend + FrontTester




Expand All @@ -71,35 +92,54 @@ Starting from Codeception 2.0 actor classes are auto-generated. Use this command



## GherkinSteps
## GenerateSnapshot

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

{% highlight yaml %}
codecept gherkin:steps acceptance
* `codecept g:snapshot UserEmails`
* `codecept g:snapshot Products`
* `codecept g:snapshot acceptance UserEmails`

{% endhighlight %}


## Clean

Recursively cleans `output` directory and generated code.

## GenerateFeature
* `codecept clean`

Generates Feature file (in Gherkin):

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


## Console

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

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

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

* `codecept g:test unit User`
* `codecept g:test unit "App\User"`

## GenerateStepObject

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

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




## GherkinSteps

Prints all steps from all Gherkin contexts for a specific suite

{% highlight yaml %}
codecept gherkin:steps acceptance

{% endhighlight %}




Expand Down Expand Up @@ -202,36 +242,42 @@ If PageObject is generated globally it will act as UIMap, without any logic in i



## Clean
## GenerateFeature

Recursively cleans `output` directory and generated code.
Generates Feature file (in Gherkin):

* `codecept clean`
* `codecept generate:feature suite Login`
* `codecept g:feature suite subdir/subdir/login.feature`
* `codecept g:feature suite login.feature -c path/to/project`




## GenerateStepObject
## GenerateGroup

Generates StepObject class. You will be asked for steps you want to implement.
Creates empty GroupObject - extension which handles all group events.

* `codecept g:stepobject acceptance AdminSteps`
* `codecept g:stepobject acceptance UserSteps --silent` - skip action questions
* `codecept g:group Admin`



## GenerateScenarios

## GherkinSnippets
Generates user-friendly text scenarios from scenario-driven tests (Cest).

Generates code snippets for matched feature files in a suite.
Code snippets are expected to be implemented in Actor or PageObjects
* `codecept g:scenarios acceptance` - for all acceptance tests
* `codecept g:scenarios acceptance --format html` - in html format
* `codecept g:scenarios acceptance --path doc` - generate scenarios to `doc` dir

Usage:

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


## GenerateTest

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

* `codecept g:test unit User`
* `codecept g:test unit "App\User"`



Expand Down Expand Up @@ -263,72 +309,26 @@ By default it will create 3 suites **Acceptance**, **Functional**, and **Unit**.



## GenerateScenarios

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

* `codecept g:scenarios acceptance` - for all acceptance tests
* `codecept g:scenarios acceptance --format html` - in html format
* `codecept g:scenarios acceptance --path doc` - generate scenarios to `doc` dir



## GenerateHelper

Creates empty Helper class.

* `codecept g:helper MyHelper`
* `codecept g:helper "My\Helper"`




## GenerateSuite

Create new test suite. Requires suite name and actor name

* ``
* `codecept g:suite api` -> api + ApiTester
* `codecept g:suite integration Code` -> integration + CodeTester
* `codecept g:suite frontend Front` -> frontend + FrontTester




## Init



## GenerateEnvironment

Generates empty environment configuration file into envs dir:

* `codecept g:env firefox`

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



## GenerateSnapshot
## ConfigValidate

Generates Snapshot.
Snapshot can be used to test dynamical data.
If suite name is provided, an actor class will be included into placeholder
Validates and prints Codeception config.
Use it do debug Yaml configs

* `codecept g:snapshot UserEmails`
* `codecept g:snapshot Products`
* `codecept g:snapshot acceptance UserEmails`
Check config:

* `codecept config`: check global config
* `codecept config unit`: check suite config

Load config:

## DryRun
* `codecept config:validate -c path/to/another/config`: from another dir
* `codecept config:validate -c another_config.yml`: from another config file

Shows step by step execution process for scenario driven tests without actually running them.
Check overriding config values (like in `run` command)

* `codecept dry-run acceptance`
* `codecept dry-run acceptance MyCest`
* `codecept dry-run acceptance checkout.feature`
* `codecept dry-run tests/acceptance/MyCest.php`
* `codecept config:validate -o "settings: shuffle: true"`: enable shuffle
* `codecept config:validate -o "settings: lint: false"`: disable linting
* `codecept config:validate -o "reporters: report: \Custom\Reporter" --report`: use custom reporter



Expand Down

0 comments on commit 8f29f3c

Please sign in to comment.