Skip to content

Commit 67751ae

Browse files
committed
MQE-1763: Investigate and fix failure due to absence of AcceptanceTester class
1 parent 3f6bb8c commit 67751ae

File tree

2 files changed

+44
-11
lines changed

2 files changed

+44
-11
lines changed

docs/troubleshooting.md

+34
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,40 @@
22

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

5+
## AcceptanceTester class issues
6+
7+
If you see the following error:
8+
9+
```terminal
10+
AcceptanceTester class doesn't exist in suite folder.
11+
Run the 'build' command to generate it
12+
```
13+
14+
#### Reason
15+
16+
Something went wrong during the `mftf build:project` command that prevented the creation of the AcceptanceTester class.
17+
18+
#### Solution
19+
20+
This issue is fixed in MFTF 2.5.0.
21+
22+
In versions of MFTF lower than 2.5.0 you should:
23+
24+
1. Open the functional.suite.yml file at:
25+
```terminal
26+
<magento root directory>/dev/tests/acceptance/tests/functional.suite.yml
27+
```
28+
2. Add quotation marks (`"`) around these values:
29+
1. `%SELENIUM_HOST%`
30+
2. `%SELENIUM_PORT%`
31+
3. `%SELENIUM_PROTOCOL%`
32+
4. `%SELENIUM_PATH%`
33+
3. Run the `vendor/bin/mftf build:project` command again.
34+
4. You should see the AcceptanceTester class is created at:
35+
```terminal
36+
<magento root directory>/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/AcceptanceTester.php
37+
```
38+
539
## WebDriver issues
640
741
Troubleshoot your WebDriver issues on various browsers.

src/Magento/FunctionalTestingFramework/Console/BuildProjectCommand.php

+10-11
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,16 @@ 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("The codecept build command failed unexpectedly. Please see the above output for more details.");
106+
}
107+
105108
if ($input->getOption('upgrade')) {
106109
$upgradeCommand = new UpgradeTestsCommand();
107110
$upgradeOptions = new ArrayInput(['path' => TESTS_MODULE_PATH]);
@@ -133,9 +136,7 @@ private function generateConfigFiles(OutputInterface $output)
133136
$output->writeln("codeception.yml configuration successfully applied.");
134137
}
135138

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

140141
// copy the functional suite yml, will only copy if there are differences between the template the destination
141142
$fileSystem->copy(
@@ -144,10 +145,8 @@ private function generateConfigFiles(OutputInterface $output)
144145
);
145146
$output->writeln('functional.suite.yml configuration successfully applied.');
146147

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

152151
$fileSystem->copy(
153152
FW_BP . '/etc/config/.credentials.example',

0 commit comments

Comments
 (0)