Skip to content

Commit e447ac0

Browse files
authored
Merge branch 'develop' into MasterToDevelop
2 parents a466aa3 + e850699 commit e447ac0

File tree

2 files changed

+46
-41
lines changed

2 files changed

+46
-41
lines changed

docs/troubleshooting.md

Lines changed: 34 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -2,60 +2,64 @@
22

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

5-
## WebDriver issues
6-
7-
Troubleshoot your WebDriver issues on various browsers.
5+
## AcceptanceTester class issues
86

9-
### PhantomJS
10-
11-
You are unable to upload file input using the MFTF actions and are seeing the following exception:
7+
If you see the following error:
128

139
```terminal
14-
[Facebook\WebDriver\Exception\NoSuchDriverException]
15-
No active session with ID e56f9260-b366-11e7-966b-db3e6f35d8e1
10+
AcceptanceTester class doesn't exist in suite folder.
11+
Run the 'build' command to generate it
1612
```
1713

18-
#### Reason
14+
### Reason
1915

20-
Use of PhantomJS is not actually supported by the MFTF.
16+
Something went wrong during the `mftf build:project` command that prevented the creation of the AcceptanceTester class.
2117

22-
#### Solution
18+
### Solution
2319

24-
For headless browsing, the [Headless Chrome][]{:target="\_blank"} has better compatibility with the MFTF.
20+
This issue is fixed in the MFTF 2.5.0.
2521

26-
### Chrome
22+
In versions of the MFTF lower than 2.5.0 you should:
2723

28-
You are seeing an "unhandled inspector error" exception:
24+
1. Open the functional.suite.yml file at:
2925

30-
```terminal
31-
[Facebook\WebDriver\Exception\UnknownServerException]
32-
unknown error: undhandled inspector error: {"code":-32601, "message":
33-
"'Network.deleteCookie' wasn't found"} ....
34-
```
26+
```terminal
27+
<magento root directory>/dev/tests/acceptance/tests/functional.suite.yml
28+
```
29+
1. Add quotation marks (`"`) around these values:
3530

36-
![Screenshot with the exception](./img/trouble-chrome232.png)
31+
1. `%SELENIUM_HOST%`
32+
1. `%SELENIUM_PORT%`
33+
1. `%SELENIUM_PROTOCOL%`
34+
1. `%SELENIUM_PATH%`
35+
36+
1. Run the `vendor/bin/mftf build:project` command again.
37+
1. You should see the AcceptanceTester class is created at:
3738

38-
#### Reason
39+
```terminal
40+
<magento root directory>/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/AcceptanceTester.php
41+
```
3942

40-
Chrome v62 is in the process of being rolled out, and it causes an error with ChromeDriver v2.32+.
43+
## WebDriver issues
4144

42-
#### Solution
45+
Troubleshoot your WebDriver issues on various browsers.
4346

44-
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+.
47+
### PhantomJS
4548

46-
### Firefox
49+
You are unable to upload file input using the MFTF actions and are seeing the following exception:
4750

48-
Tests that use the `moveMouseOver` action cause an error when run locally.
51+
```terminal
52+
[Facebook\WebDriver\Exception\NoSuchDriverException]
53+
No active session with ID e56f9260-b366-11e7-966b-db3e6f35d8e1
54+
```
4955

5056
#### Reason
5157

52-
There's a compatibility issue with Codeception's `moveMouseOver` function and GeckoDriver with Firefox.
58+
Use of PhantomJS is not supported by the MFTF.
5359

5460
#### Solution
5561

56-
None yet. Solving this problem is dependent on a GeckoDriver fix.
62+
For headless browsing, the [Headless Chrome][]{:target="\_blank"} has better compatibility with the MFTF.
5763

5864
<!-- Link Definitions -->
5965
[Headless Chrome]: https://developers.google.com/web/updates/2017/04/headless-chrome
60-
[ChromeDriver 74.0.3729.6+]: https://chromedriver.storage.googleapis.com/index.html?path=2.33/
61-
[Selenium Server Standalone v3.9+]: http://www.seleniumhq.org/download/

src/Magento/FunctionalTestingFramework/Console/BuildProjectCommand.php

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
namespace Magento\FunctionalTestingFramework\Console;
99

10+
use Magento\FunctionalTestingFramework\Exceptions\TestFrameworkException;
1011
use Magento\FunctionalTestingFramework\Util\Logger\LoggingUtil;
1112
use Symfony\Component\Console\Command\Command;
1213
use Symfony\Component\Console\Input\ArrayInput;
@@ -94,14 +95,18 @@ protected function execute(InputInterface $input, OutputInterface $output)
9495
$process->setWorkingDirectory(TESTS_BP);
9596
$process->setIdleTimeout(600);
9697
$process->setTimeout(0);
97-
$process->run(
98+
$codeceptReturnCode = $process->run(
9899
function ($type, $buffer) use ($output) {
99-
if ($output->isVerbose()) {
100-
$output->write($buffer);
101-
}
100+
$output->write($buffer);
102101
}
103102
);
104103

104+
if ($codeceptReturnCode !== 0) {
105+
throw new TestFrameworkException(
106+
"The codecept build command failed unexpectedly. Please see the above output for more details."
107+
);
108+
}
109+
105110
if ($input->getOption('upgrade')) {
106111
$upgradeCommand = new UpgradeTestsCommand();
107112
$upgradeOptions = new ArrayInput(['path' => TESTS_MODULE_PATH]);
@@ -133,9 +138,7 @@ private function generateConfigFiles(OutputInterface $output)
133138
$output->writeln("codeception.yml configuration successfully applied.");
134139
}
135140

136-
if ($output->isVerbose()) {
137-
$output->writeln("codeception.yml applied to " . TESTS_BP . DIRECTORY_SEPARATOR . 'codeception.yml');
138-
}
141+
$output->writeln("codeception.yml applied to " . TESTS_BP . DIRECTORY_SEPARATOR . 'codeception.yml');
139142

140143
// copy the functional suite yml, will only copy if there are differences between the template the destination
141144
$fileSystem->copy(
@@ -144,10 +147,8 @@ private function generateConfigFiles(OutputInterface $output)
144147
);
145148
$output->writeln('functional.suite.yml configuration successfully applied.');
146149

147-
if ($output->isVerbose()) {
148-
$output->writeln("functional.suite.yml applied to " .
149-
TESTS_BP . DIRECTORY_SEPARATOR . 'tests' . DIRECTORY_SEPARATOR . 'functional.suite.yml');
150-
}
150+
$output->writeln("functional.suite.yml applied to " .
151+
TESTS_BP . DIRECTORY_SEPARATOR . 'tests' . DIRECTORY_SEPARATOR . 'functional.suite.yml');
151152

152153
$fileSystem->copy(
153154
FW_BP . '/etc/config/.credentials.example',

0 commit comments

Comments
 (0)