Home / 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
orCodeception 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 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
Selenium Server
There is a chance that your tests might require a Selenium server to be running. See your project's README
or CONTRIBUTING
file for any additional setup that might be required when running Codeception tests.