Skip to content

Commit 2353428

Browse files
committed
MQE-1181: Fatal error while test running
- Suite After no longer resets WebDriver, allows Test after to fail naturally (and Suite After to run)
1 parent 5788253 commit 2353428

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

src/Magento/FunctionalTestingFramework/Suite/views/SuiteClass.mustache

+7-2
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,12 @@ class {{suiteName}} extends \Codeception\GroupObject
4747
4848
try {
4949
{{> testActions}}
50+
51+
// reset configuration and close session
52+
$this->getModule('\Magento\FunctionalTestingFramework\Module\MagentoWebDriver')->_resetConfig();
53+
$webDriver->webDriver->close();
54+
$webDriver->webDriver = null;
55+
5056
} catch (\Exception $exception) {
5157
$this->preconditionFailure = $exception->getMessage();
5258
}
@@ -86,11 +92,10 @@ class {{suiteName}} extends \Codeception\GroupObject
8692
if ($error->failedTest()->getTestMethod() == $cest->getName()) {
8793
// Do not attempt to run _after if failure was in the _after block
8894
// Try to run _after but catch exceptions to prevent them from overwriting original failure.
89-
\PHPUnit_Framework_Assert::fail("LAST TESTS FAILED IN SUITE, SUITE_AFTER CANNOT BE RUN");
95+
print("LAST TEST IN SUITE FAILED, TEST AFTER MAY NOT BE SUCCESSFUL\n");
9096
}
9197
}
9298
}
93-
9499
{{> testActions}}
95100
} catch (\Exception $exception) {
96101
print $exception->getMessage();

src/Magento/FunctionalTestingFramework/Suite/views/partials/testActions.mustache

-7
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,6 @@ if ($webDriver->webDriver != null) {
1111
// initialize the webdriver session
1212
$webDriver->_initializeSession();
1313
{{/webDriverInit}}
14-
{{#webDriverReset}}
15-
16-
// reset configuration and close session
17-
$this->getModule('\Magento\FunctionalTestingFramework\Module\MagentoWebDriver')->_resetConfig();
18-
$webDriver->webDriver->close();
19-
$webDriver->webDriver = null;
20-
{{/webDriverReset}}
2114
{{#action}}
2215
{{{action}}}
2316
{{/action}}

0 commit comments

Comments
 (0)