|
|
###### [Home](home) / [PhpStorm](phpstorm) / Running Codeception Tests
|
|
|
|
|
|
---
|
|
|
|
|
|
# Running Codeception Tests in PhpStorm
|
|
|
|
|
|
---
|
|
|
|
|
|
## Setting up the Codeception config
|
|
|
|
|
|
* Choose the **Run** > **Edit Configurations...** menu item.
|
|
|
* Alternatively, you can also find the **Edit Configurations...** option in the dropdown located on the PhpStorm toolbar, near the **Run** button _(has green "play" icon)_.
|
|
|
* Click the `+` icon, and add a new **PHP Script** configuration
|
|
|
* Name it something like `Codeception` or `Codeception Unit` based on how you intend to configure the run.
|
|
|
* In the **File:** field, provide a link to the codecept phar file. e.g. `/Users/mikemclin/Sites/kd-app/private/vendor/bin/codecept`.
|
|
|
* In the **Arguments:** field, provide whatever commands you want codecept to run. Here are a few examples:
|
|
|
* `run`: Run all tests
|
|
|
* `run unit` Run unit test suite
|
|
|
* `run acceptance` Run acceptance test suite
|
|
|
* `run path/to/specific/tests` Run tests only in this directory
|
|
|
* See Codeception: [Running Tests](http://codeception.com/docs/02-GettingStarted#Running-Tests) for more solutions
|
|
|
* In the **Custom working directory:** field, provide your app's root directory. e.g. `/Users/mikemclin/Sites/kd-app`
|
|
|
|
|
|
## Running Codeception Tests
|
|
|
|
|
|
* First, make sure the your Codeception configuration is the current configuration for the PhpStorm **Run** tool
|
|
|
* You can select it from the dropdown located on the PhpStorm toolbar, near the **Run** button _(has green "play" icon)_.
|
|
|
* Alternatively, you can choose **Run** > **Run...** from the menu.
|
|
|
* Now, you can run your tests
|
|
|
* Click the **Run** button _(has green "play" icon)_ on the PhpStorm toolbar
|
|
|
* Alternatively, you can choose **Run** > **Run 'Codeception'** _(or whatever you named your config)_ from the menu.
|
|
|
* The keyboard shortcut is `ctrl` + `r` |
|
|
\ No newline at end of file |