Skip to content

MQE-1763: Investigate and fix failure due to absence of AcceptanceTester class #460

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Sep 20, 2019
Merged
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
64 changes: 34 additions & 30 deletions docs/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,60 +2,64 @@

Having a little trouble with the MFTF? See some common errors and fixes below.

## WebDriver issues
Copy link
Contributor Author

@tomreece tomreece Sep 19, 2019

Choose a reason for hiding this comment

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

This documentation change looks more complicated than it is.

I discussed with @dobooth and we agreed to remove the two existing troubleshooting items on this page because they were no longer relevant.

Removed those two sections
Added a section about this AcceptanceTester bug


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
<magento root directory>/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
<magento root directory>/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.

<!-- Link Definitions -->
[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/
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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]);
Expand Down Expand Up @@ -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(
Expand All @@ -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',
Expand Down