From 67751aec87ad33073c4917ad780e483e1f2ac321 Mon Sep 17 00:00:00 2001 From: Tom Reece Date: Wed, 18 Sep 2019 15:46:37 -0500 Subject: [PATCH 1/4] MQE-1763: Investigate and fix failure due to absence of AcceptanceTester class --- docs/troubleshooting.md | 34 +++++++++++++++++++ .../Console/BuildProjectCommand.php | 21 ++++++------ 2 files changed, 44 insertions(+), 11 deletions(-) diff --git a/docs/troubleshooting.md b/docs/troubleshooting.md index d546c4e15..fe64ea0e6 100644 --- a/docs/troubleshooting.md +++ b/docs/troubleshooting.md @@ -2,6 +2,40 @@ Having a little trouble with the MFTF? See some common errors and fixes below. +## AcceptanceTester class issues + +If you see the following error: + +```terminal +AcceptanceTester class doesn't exist in suite folder. +Run the 'build' command to generate it +``` + +#### Reason + +Something went wrong during the `mftf build:project` command that prevented the creation of the AcceptanceTester class. + +#### Solution + +This issue is fixed in MFTF 2.5.0. + +In versions of MFTF lower than 2.5.0 you should: + +1. Open the functional.suite.yml file at: + ```terminal + /dev/tests/acceptance/tests/functional.suite.yml + ``` +2. Add quotation marks (`"`) around these values: + 1. `%SELENIUM_HOST%` + 2. `%SELENIUM_PORT%` + 3. `%SELENIUM_PROTOCOL%` + 4. `%SELENIUM_PATH%` +3. Run the `vendor/bin/mftf build:project` command again. +4. You should see the AcceptanceTester class is created at: + ```terminal + /vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/AcceptanceTester.php + ``` + ## WebDriver issues Troubleshoot your WebDriver issues on various browsers. diff --git a/src/Magento/FunctionalTestingFramework/Console/BuildProjectCommand.php b/src/Magento/FunctionalTestingFramework/Console/BuildProjectCommand.php index 6b421a332..1de5345aa 100644 --- a/src/Magento/FunctionalTestingFramework/Console/BuildProjectCommand.php +++ b/src/Magento/FunctionalTestingFramework/Console/BuildProjectCommand.php @@ -7,6 +7,7 @@ namespace Magento\FunctionalTestingFramework\Console; +use Magento\FunctionalTestingFramework\Exceptions\TestFrameworkException; use Magento\FunctionalTestingFramework\Util\Logger\LoggingUtil; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\ArrayInput; @@ -94,14 +95,16 @@ protected function execute(InputInterface $input, OutputInterface $output) $process->setWorkingDirectory(TESTS_BP); $process->setIdleTimeout(600); $process->setTimeout(0); - $process->run( + $codeceptReturnCode = $process->run( function ($type, $buffer) use ($output) { - if ($output->isVerbose()) { - $output->write($buffer); - } + $output->write($buffer); } ); + if ($codeceptReturnCode !== 0) { + throw new TestFrameworkException("The codecept build command failed unexpectedly. Please see the above output for more details."); + } + if ($input->getOption('upgrade')) { $upgradeCommand = new UpgradeTestsCommand(); $upgradeOptions = new ArrayInput(['path' => TESTS_MODULE_PATH]); @@ -133,9 +136,7 @@ private function generateConfigFiles(OutputInterface $output) $output->writeln("codeception.yml configuration successfully applied."); } - if ($output->isVerbose()) { - $output->writeln("codeception.yml applied to " . TESTS_BP . DIRECTORY_SEPARATOR . 'codeception.yml'); - } + $output->writeln("codeception.yml applied to " . TESTS_BP . DIRECTORY_SEPARATOR . 'codeception.yml'); // copy the functional suite yml, will only copy if there are differences between the template the destination $fileSystem->copy( @@ -144,10 +145,8 @@ private function generateConfigFiles(OutputInterface $output) ); $output->writeln('functional.suite.yml configuration successfully applied.'); - if ($output->isVerbose()) { - $output->writeln("functional.suite.yml applied to " . - TESTS_BP . DIRECTORY_SEPARATOR . 'tests' . DIRECTORY_SEPARATOR . 'functional.suite.yml'); - } + $output->writeln("functional.suite.yml applied to " . + TESTS_BP . DIRECTORY_SEPARATOR . 'tests' . DIRECTORY_SEPARATOR . 'functional.suite.yml'); $fileSystem->copy( FW_BP . '/etc/config/.credentials.example', From 5d2335597ed654a803009cf6a55656910e6d7161 Mon Sep 17 00:00:00 2001 From: Tom Reece Date: Thu, 19 Sep 2019 09:46:35 -0500 Subject: [PATCH 2/4] MQE-1763: Investigate and fix failure due to absence of AcceptanceTester class - Fix long line --- .../Console/BuildProjectCommand.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Magento/FunctionalTestingFramework/Console/BuildProjectCommand.php b/src/Magento/FunctionalTestingFramework/Console/BuildProjectCommand.php index 1de5345aa..5102a3fdf 100644 --- a/src/Magento/FunctionalTestingFramework/Console/BuildProjectCommand.php +++ b/src/Magento/FunctionalTestingFramework/Console/BuildProjectCommand.php @@ -102,7 +102,9 @@ function ($type, $buffer) use ($output) { ); if ($codeceptReturnCode !== 0) { - throw new TestFrameworkException("The codecept build command failed unexpectedly. Please see the above output for more details."); + throw new TestFrameworkException( + "The codecept build command failed unexpectedly. Please see the above output for more details." + ); } if ($input->getOption('upgrade')) { From 58564203d9a74b38bcf0c2de6aef4c1790b09044 Mon Sep 17 00:00:00 2001 From: Donald Booth Date: Thu, 19 Sep 2019 10:13:47 -0500 Subject: [PATCH 3/4] Formatting changes --- docs/troubleshooting.md | 38 +++++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/docs/troubleshooting.md b/docs/troubleshooting.md index fe64ea0e6..2ed6d5422 100644 --- a/docs/troubleshooting.md +++ b/docs/troubleshooting.md @@ -11,30 +11,34 @@ AcceptanceTester class doesn't exist in suite folder. Run the 'build' command to generate it ``` -#### Reason +### Reason Something went wrong during the `mftf build:project` command that prevented the creation of the AcceptanceTester class. -#### Solution +### Solution -This issue is fixed in MFTF 2.5.0. +This issue is fixed in the MFTF 2.5.0. -In versions of MFTF lower than 2.5.0 you should: +In versions of the MFTF lower than 2.5.0 you should: 1. Open the functional.suite.yml file at: - ```terminal - /dev/tests/acceptance/tests/functional.suite.yml - ``` -2. Add quotation marks (`"`) around these values: + + ```terminal + /dev/tests/acceptance/tests/functional.suite.yml + ``` +1. Add quotation marks (`"`) around these values: + 1. `%SELENIUM_HOST%` - 2. `%SELENIUM_PORT%` - 3. `%SELENIUM_PROTOCOL%` - 4. `%SELENIUM_PATH%` -3. Run the `vendor/bin/mftf build:project` command again. -4. You should see the AcceptanceTester class is created at: - ```terminal + 1. `%SELENIUM_PORT%` + 1. `%SELENIUM_PROTOCOL%` + 1. `%SELENIUM_PATH%` + +1. Run the `vendor/bin/mftf build:project` command again. +1. You should see the AcceptanceTester class is created at: + + ```terminal /vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/AcceptanceTester.php - ``` + ``` ## WebDriver issues @@ -51,7 +55,7 @@ No active session with ID e56f9260-b366-11e7-966b-db3e6f35d8e1 #### Reason -Use of PhantomJS is not actually supported by the MFTF. +Use of PhantomJS is not supported by the MFTF. #### Solution @@ -83,7 +87,7 @@ Tests that use the `moveMouseOver` action cause an error when run locally. #### Reason -There's a compatibility issue with Codeception's `moveMouseOver` function and GeckoDriver with Firefox. +There is a compatibility issue with Codeception's `moveMouseOver` function and GeckoDriver with Firefox. #### Solution From ba6fb4dfc30bf2b7357fe19b03a82a9794a1f45e Mon Sep 17 00:00:00 2001 From: Donald Booth Date: Thu, 19 Sep 2019 10:19:57 -0500 Subject: [PATCH 4/4] Removed unused issues. --- docs/troubleshooting.md | 34 ---------------------------------- 1 file changed, 34 deletions(-) diff --git a/docs/troubleshooting.md b/docs/troubleshooting.md index 2ed6d5422..d2a7dcabe 100644 --- a/docs/troubleshooting.md +++ b/docs/troubleshooting.md @@ -61,39 +61,5 @@ Use of PhantomJS is not supported by the MFTF. For headless browsing, the [Headless Chrome][]{:target="\_blank"} has better compatibility with the MFTF. -### Chrome - -You are seeing an "unhandled inspector error" exception: - -```terminal -[Facebook\WebDriver\Exception\UnknownServerException] -unknown error: undhandled inspector error: {"code":-32601, "message": -"'Network.deleteCookie' wasn't found"} .... -``` - -![Screenshot with the exception](./img/trouble-chrome232.png) - -#### Reason - -Chrome v62 is in the process of being rolled out, and it causes an error with ChromeDriver v2.32+. - -#### Solution - -Use [ChromeDriver 74.0.3729.6+][]{:target="\_blank"} and [Selenium Server Standalone v3.9+][]{:target="\_blank"} in order to execute tests in Google Chrome v62+. - -### Firefox - -Tests that use the `moveMouseOver` action cause an error when run locally. - -#### Reason - -There is a compatibility issue with Codeception's `moveMouseOver` function and GeckoDriver with Firefox. - -#### Solution - -None yet. Solving this problem is dependent on a GeckoDriver fix. - [Headless Chrome]: https://developers.google.com/web/updates/2017/04/headless-chrome -[ChromeDriver 74.0.3729.6+]: https://chromedriver.storage.googleapis.com/index.html?path=2.33/ -[Selenium Server Standalone v3.9+]: http://www.seleniumhq.org/download/