Skip to content
This repository was archived by the owner on Apr 9, 2025. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions _data/toc/magento-functional-testing-framework-guide-2_3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ pages:
url: /mftf/2.3/data.html
versionless: true

- label: Debugging
url: /mftf/2.3/debugging.html
versionless: true

- label: Metadata
url: /mftf/2.3/metadata.html
versionless: true
Expand Down
40 changes: 40 additions & 0 deletions mftf/2.3/debugging.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
title: Debugging MFTF Tests
mftf-release: 2.3.13
---

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

- [Xdebug]
- PHPUnit configured for use in [PHPStorm]

## Creating Debug Configuration with PHPStorm

1. Download the Codeception Framework plugin for PHPStorm (`PhpStorm->Preferences->Plugins`).
1. Click `Edit Configurations` on the configuration dropdown.
1. Click `+` and select `Codeception` from the available types.
1. Find the `Custom Working Directory` option and set the path to your `dev/tests/acceptance/` directory.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like something is missing here because my configuration is still not ready to run. The window is asking for information to be filled out in the Test Runner section (at the top of the configuration window).

Copy link

@KevinBKozan KevinBKozan Feb 15, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dobooth he is correct, need to add a step for:
" 1. Change Test Scope to Type and select functional from the Type: dropdown"


If you get a warning `Path to Codeception for local machine is not configured.`:

1. Click `Fix`, then `+`, and select `Codeception Local`.
1. Click `...` and locate `/vendor/bin/codecept` in your Magento installation folder.

At this point, you have a couple choices in how to select the test you want to debug.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
At this point, you have a couple choices in how to select the test you want to debug.
At this point, you have a couple of choices in how to select the test you want to debug.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks.

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.

<!-- Link definitions -->
[Xdebug]: https://xdebug.org/docs/install
[PHPStorm]: https://github.com/SeleniumHQ/selenium/wiki/PageObjects