Skip to content

Commit 3277034

Browse files
committed
MQE-957: MFTF Changes to support DEVOPS-2029
- fix for try catch not capturing delete/create data
1 parent 83dab03 commit 3277034

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

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

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,11 @@ class {{suiteName}} extends \Codeception\GroupObject
3434
if (self::$CURRENT_TEST_RUN == 1) {
3535
print sprintf(self::$HOOK_EXECUTION_INIT, "before");
3636
37-
{{> testActions}}
37+
try {
38+
{{> testActions}}
39+
} catch (\Exception $e) {
40+
print $e->getMessage();
41+
}
3842

3943
print sprintf(self::$HOOK_EXECUTION_END, "before");
4044
}
@@ -47,7 +51,12 @@ class {{suiteName}} extends \Codeception\GroupObject
4751
if (self::$CURRENT_TEST_RUN == self::$TEST_COUNT) {
4852
print sprintf(self::$HOOK_EXECUTION_INIT, "after");
4953
50-
{{> testActions}}
54+
try {
55+
{{> testActions}}
56+
} catch (\Exception $e) {
57+
print $e->getMessage();
58+
}
59+
5160

5261
print sprintf(self::$HOOK_EXECUTION_END, "after");
5362
}

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

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,16 @@ if ($webDriver->webDriver != null) {
1010

1111
// initialize the webdriver session
1212
$webDriver->_initializeSession();
13-
try {
14-
// execute user specified actions
1513
{{/webDriverInit}}
1614
{{#webDriverReset}}
17-
} catch (\Exception $e) {
18-
print $e->getMessage();
19-
}
2015

2116
// reset configuration and close session
2217
$this->getModule('\Magento\FunctionalTestingFramework\Module\MagentoWebDriver')->_resetConfig();
2318
$webDriver->webDriver->close();
2419
$webDriver->webDriver = null;
2520
{{/webDriverReset}}
2621
{{#action}}
27-
{{{action}}}
22+
{{{action}}}
2823
{{/action}}
2924
{{#createData}}
3025
${{entityName}} = DataObjectHandler::getInstance()->getObject("{{entityName}}");

0 commit comments

Comments
 (0)