From 8951d4bc905e026d12edc147e46d3841a7317b36 Mon Sep 17 00:00:00 2001 From: Kevin Kozan Date: Mon, 11 Feb 2019 09:38:11 -0600 Subject: [PATCH 1/6] 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/6] 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 From ba1fbb165f87f07c83bb1f2e5f6b3c7fc3c883ce Mon Sep 17 00:00:00 2001 From: Donald Booth Date: Fri, 15 Feb 2019 10:45:30 -0600 Subject: [PATCH 3/6] Fixups via review. --- mftf/2.3/debugging.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mftf/2.3/debugging.md b/mftf/2.3/debugging.md index cb175d488b2..6e5e22b599e 100644 --- a/mftf/2.3/debugging.md +++ b/mftf/2.3/debugging.md @@ -17,7 +17,7 @@ This is straightforward to do once you create a basic Debug Configuration. ## Creating Debug Configuration with PHPStorm -1. Download the Codeception Framework plugin for PHPStorm (`PhpStorm->Preferences->Plugins`). +1. If not already installed, 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. @@ -27,7 +27,6 @@ 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. The easiest method of tagging a test for debugging is the following: - In your Debug configuration, locate `Test Runner options:` and set `--group testDebug`. From 0edd6165e1c2f8538a3fc868728faa41c9ad7da8 Mon Sep 17 00:00:00 2001 From: Donald Booth Date: Fri, 15 Feb 2019 11:01:37 -0600 Subject: [PATCH 4/6] Added missing instruction. --- mftf/2.3/debugging.md | 1 + 1 file changed, 1 insertion(+) diff --git a/mftf/2.3/debugging.md b/mftf/2.3/debugging.md index 6e5e22b599e..bcafe560e4c 100644 --- a/mftf/2.3/debugging.md +++ b/mftf/2.3/debugging.md @@ -20,6 +20,7 @@ This is straightforward to do once you create a basic Debug Configuration. 1. If not already installed, 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. Change `Test Scope` to `Type` and select `functional` from the `Type:` dropdown. 1. Find the `Custom Working Directory` option and set the path to your `dev/tests/acceptance/` directory. If you get a warning `Path to Codeception for local machine is not configured.`: From 01ac08ce5420f71ccf67d4c9673b46804a8474ec Mon Sep 17 00:00:00 2001 From: James Calcaben Date: Fri, 15 Feb 2019 11:19:50 -0600 Subject: [PATCH 5/6] Update mftf/2.3/debugging.md Co-Authored-By: dobooth --- mftf/2.3/debugging.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mftf/2.3/debugging.md b/mftf/2.3/debugging.md index bcafe560e4c..1af7be7f4f4 100644 --- a/mftf/2.3/debugging.md +++ b/mftf/2.3/debugging.md @@ -12,7 +12,7 @@ This is straightforward to do once you create a basic Debug Configuration. ## Prerequisites -- [Xdebug] +- [Xdebug][] - PHPUnit configured for use in [PHPStorm] ## Creating Debug Configuration with PHPStorm @@ -37,4 +37,4 @@ Your Debug Configuration should now be able to run your test and pause execution [Xdebug]: https://xdebug.org/docs/install -[PHPStorm]: https://github.com/SeleniumHQ/selenium/wiki/PageObjects \ No newline at end of file +[PHPStorm]: https://github.com/SeleniumHQ/selenium/wiki/PageObjects From 15a7d523f6328229df419d5e95a6310dcac16b5e Mon Sep 17 00:00:00 2001 From: James Calcaben Date: Fri, 15 Feb 2019 11:19:58 -0600 Subject: [PATCH 6/6] Update mftf/2.3/debugging.md Co-Authored-By: dobooth --- mftf/2.3/debugging.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mftf/2.3/debugging.md b/mftf/2.3/debugging.md index 1af7be7f4f4..f057756bf0f 100644 --- a/mftf/2.3/debugging.md +++ b/mftf/2.3/debugging.md @@ -13,7 +13,7 @@ This is straightforward to do once you create a basic Debug Configuration. ## Prerequisites - [Xdebug][] -- PHPUnit configured for use in [PHPStorm] +- PHPUnit configured for use in [PHPStorm][] ## Creating Debug Configuration with PHPStorm