From 8951d4bc905e026d12edc147e46d3841a7317b36 Mon Sep 17 00:00:00 2001 From: Kevin Kozan Date: Mon, 11 Feb 2019 09:38:11 -0600 Subject: [PATCH 1/2] MQE-1440: MFTF Debugging - Topic Created --- mftf/2.3/debugging.md | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 mftf/2.3/debugging.md diff --git a/mftf/2.3/debugging.md b/mftf/2.3/debugging.md new file mode 100644 index 00000000000..b1b802bfdeb --- /dev/null +++ b/mftf/2.3/debugging.md @@ -0,0 +1,39 @@ +--- +mftf-release: 2.2.0 +redirect_from: /guides/v2.3/magento-functional-testing-framework/2.3/debugging.html +--- + +# Debugging MFTF Tests + +_This topic was updated due to the {{page.mftf-release}} MFTF release._ +{: style="text-align: right"} + +Debugging MFTF can be helpful in identifying test bugs by allowing you to pause execution to either examine the page, or to check returned data and other variables being used by your test during run-time. +This is easy to do once you create a basic Debug Configuration. + +## Prerequisites +* [Xdebug] +* PHPUnit configured for use in [PHPStorm] + +## Creating Debug Configuration with PHPStorm + +* Download the Codeception Framework plugin for PHPStorm (`PhpStorm->Preferences->Plugins`). +* Click `Edit Configurations` on the configuration dropdown. Click `+` and select `Codeception` from the available types. +* Find the `Custom Working Directory` option, set the path to your `dev/tests/acceptance/` directory + +You may be getting a warning `Path to Codeception for local machine is not configured.` +* Click `Fix`, then `+` and select `Codeception Local`. +* Click `...` and locate `/vendor/bin/codecept` in your Magento installation folder + +At this point, you have a couple choices in how to choose which test you want to debug. 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 `` 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. + + +{%endraw%} + + +[Xdebug]: https://xdebug.org/docs/install +[PHPStorm]: https://github.com/SeleniumHQ/selenium/wiki/PageObjects From b4ce91f98cecacfc0d17f379d327f29863f4d6ae Mon Sep 17 00:00:00 2001 From: Donald Booth Date: Wed, 13 Feb 2019 11:11:18 -0600 Subject: [PATCH 2/2] Edited debugging page, TOC. --- ...functional-testing-framework-guide-2_3.yml | 4 ++ mftf/2.3/debugging.md | 43 ++++++++++--------- 2 files changed, 26 insertions(+), 21 deletions(-) diff --git a/_data/toc/magento-functional-testing-framework-guide-2_3.yml b/_data/toc/magento-functional-testing-framework-guide-2_3.yml index 6f128e1b5b3..00a78817df5 100644 --- a/_data/toc/magento-functional-testing-framework-guide-2_3.yml +++ b/_data/toc/magento-functional-testing-framework-guide-2_3.yml @@ -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 diff --git a/mftf/2.3/debugging.md b/mftf/2.3/debugging.md index b1b802bfdeb..cb175d488b2 100644 --- a/mftf/2.3/debugging.md +++ b/mftf/2.3/debugging.md @@ -1,39 +1,40 @@ --- -mftf-release: 2.2.0 -redirect_from: /guides/v2.3/magento-functional-testing-framework/2.3/debugging.html +title: Debugging MFTF Tests +mftf-release: 2.3.13 --- -# Debugging MFTF Tests +Debugging within the Magento Functional Testing Framework is helpful in identifying test bugs by allowing you to pause execution so that you may: -_This topic was updated due to the {{page.mftf-release}} MFTF release._ -{: style="text-align: right"} +- Examine the page. +- Check returned data and other variables being used during run-time. -Debugging MFTF can be helpful in identifying test bugs by allowing you to pause execution to either examine the page, or to check returned data and other variables being used by your test during run-time. -This is easy to do once you create a basic Debug Configuration. +This is straightforward to do once you create a basic Debug Configuration. ## Prerequisites -* [Xdebug] -* PHPUnit configured for use in [PHPStorm] + +- [Xdebug] +- PHPUnit configured for use in [PHPStorm] ## Creating Debug Configuration with PHPStorm -* Download the Codeception Framework plugin for PHPStorm (`PhpStorm->Preferences->Plugins`). -* Click `Edit Configurations` on the configuration dropdown. Click `+` and select `Codeception` from the available types. -* Find the `Custom Working Directory` option, set the path to your `dev/tests/acceptance/` directory +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. -You may be getting a warning `Path to Codeception for local machine is not configured.` -* Click `Fix`, then `+` and select `Codeception Local`. -* Click `...` and locate `/vendor/bin/codecept` in your Magento installation folder +If you get a warning `Path to Codeception for local machine is not configured.`: -At this point, you have a couple choices in how to choose which test you want to debug. 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 `` to the annotations (be sure to remove this after done debugging) +1. Click `Fix`, then `+`, and select `Codeception Local`. +1. Click `...` and locate `/vendor/bin/codecept` in your Magento installation folder. -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. +At this point, you have a couple choices in how to select the test you want to debug. +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 `` to the annotations. Be sure to remove this after done debugging. -{%endraw%} +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. [Xdebug]: https://xdebug.org/docs/install -[PHPStorm]: https://github.com/SeleniumHQ/selenium/wiki/PageObjects +[PHPStorm]: https://github.com/SeleniumHQ/selenium/wiki/PageObjects \ No newline at end of file