diff --git a/docs/troubleshooting.md b/docs/troubleshooting.md index d546c4e15..d2a7dcabe 100644 --- a/docs/troubleshooting.md +++ b/docs/troubleshooting.md @@ -2,60 +2,64 @@ Having a little trouble with the MFTF? See some common errors and fixes below. -## WebDriver issues - -Troubleshoot your WebDriver issues on various browsers. +## AcceptanceTester class issues -### PhantomJS - -You are unable to upload file input using the MFTF actions and are seeing the following exception: +If you see the following error: ```terminal -[Facebook\WebDriver\Exception\NoSuchDriverException] -No active session with ID e56f9260-b366-11e7-966b-db3e6f35d8e1 +AcceptanceTester class doesn't exist in suite folder. +Run the 'build' command to generate it ``` -#### Reason +### Reason -Use of PhantomJS is not actually supported by the MFTF. +Something went wrong during the `mftf build:project` command that prevented the creation of the AcceptanceTester class. -#### Solution +### Solution -For headless browsing, the [Headless Chrome][]{:target="\_blank"} has better compatibility with the MFTF. +This issue is fixed in the MFTF 2.5.0. -### Chrome +In versions of the MFTF lower than 2.5.0 you should: -You are seeing an "unhandled inspector error" exception: +1. Open the functional.suite.yml file at: -```terminal -[Facebook\WebDriver\Exception\UnknownServerException] -unknown error: undhandled inspector error: {"code":-32601, "message": -"'Network.deleteCookie' wasn't found"} .... -``` + ```terminal + /dev/tests/acceptance/tests/functional.suite.yml + ``` +1. Add quotation marks (`"`) around these values: -![Screenshot with the exception](./img/trouble-chrome232.png) + 1. `%SELENIUM_HOST%` + 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: -#### Reason + ```terminal + /vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/AcceptanceTester.php + ``` -Chrome v62 is in the process of being rolled out, and it causes an error with ChromeDriver v2.32+. +## WebDriver issues -#### Solution +Troubleshoot your WebDriver issues on various browsers. -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+. +### PhantomJS -### Firefox +You are unable to upload file input using the MFTF actions and are seeing the following exception: -Tests that use the `moveMouseOver` action cause an error when run locally. +```terminal +[Facebook\WebDriver\Exception\NoSuchDriverException] +No active session with ID e56f9260-b366-11e7-966b-db3e6f35d8e1 +``` #### Reason -There's a compatibility issue with Codeception's `moveMouseOver` function and GeckoDriver with Firefox. +Use of PhantomJS is not supported by the MFTF. #### Solution -None yet. Solving this problem is dependent on a GeckoDriver fix. +For headless browsing, the [Headless Chrome][]{:target="\_blank"} has better compatibility with the MFTF. [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/ diff --git a/src/Magento/FunctionalTestingFramework/Console/BuildProjectCommand.php b/src/Magento/FunctionalTestingFramework/Console/BuildProjectCommand.php index 6b421a332..5102a3fdf 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,18 @@ 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 +138,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 +147,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',