Debugging
Debugging within the Magento Functional Testing Framework is helpful in identifying test bugs by allowing you to pause execution so that you may:
- Examine the page.
- Check returned data and other variables being used during run-time.
This is straightforward to do once you create a basic Debug Configuration.
Prerequisites
Creating Debug Configuration with PHPStorm
- If not already installed, download the Codeception Framework plugin for PHPStorm (
PhpStorm->Preferences->Plugins
). - Click
Edit Configurations
on the configuration dropdown. - Click
+
and selectCodeception
from the available types. - Change
Test Scope
toType
and selectfunctional
from theType:
dropdown. - Find the
Custom Working Directory
option and set the path to yourdev/tests/acceptance/
directory.
If you get a warning Path to Codeception for local machine is not configured.
:
- Click
Fix
, then+
, and selectCodeception Local
. - Click
...
and locate/vendor/bin/codecept
in your Magento installation folder.
The easiest method of tagging a test for debugging is the following:
- In your Debug configuration, locate
Test Runner options:
and set--group testDebug
. - When you want to debug a test you are working on, simply add
<group value="testDebug"/>
to the annotations. Be sure to remove this after done debugging.
Your Debug Configuration should now be able to run your test and pause execution on any breakpoints you have set in the generated .php
file under the _generated
folder.