Skip to content

Commit 2243c42

Browse files
authored
Merge pull request #326 from magento-gl/suite-hotfix
Suite hotfix
2 parents 4bc777c + c6af0a1 commit 2243c42

File tree

7 files changed

+47
-50
lines changed

7 files changed

+47
-50
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
Magento Functional Testing Framework Changelog
22
================================================
33

4+
4.3.4
5+
---------
6+
### Fixes
7+
* Resolving an issue when test is marked as failed due to Suite after section failure
8+
49
4.3.3
510
---------
611
### Enhancements

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "magento/magento2-functional-testing-framework",
33
"description": "Magento2 Functional Testing Framework",
44
"type": "library",
5-
"version": "4.3.3",
5+
"version": "4.3.4",
66
"license": "AGPL-3.0",
77
"keywords": ["magento", "automation", "functional", "testing"],
88
"config": {

composer.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dev/tests/verification/Resources/ActionsInDifferentModulesSuite.txt

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,6 @@ class ActionsInDifferentModulesSuite extends \Codeception\GroupObject
2929
private $testCount = 1;
3030
private $preconditionFailure = null;
3131
private $currentTestRun = 0;
32-
/**
33-
* Remote Web Driver
34-
*
35-
* @var RemoteWebDriver
36-
*/
37-
private $remoteWebDriver = null;
3832
private static $HOOK_EXECUTION_INIT = "\n/******** Beginning execution of ActionsInDifferentModulesSuite suite %s block ********/\n";
3933
private static $HOOK_EXECUTION_END = "\n/******** Execution of ActionsInDifferentModulesSuite suite %s block complete ********/\n";
4034
/** @var MagentoWebDriver */
@@ -204,12 +198,16 @@ class ActionsInDifferentModulesSuite extends \Codeception\GroupObject
204198
);
205199
$availableSessions = RemoteWebDriver::getAllSessions($wdHost);
206200
foreach ($availableSessions as $session) {
207-
// Create an instance of ChromeOptions:
208-
$chromeOptions = new ChromeOptions();
209-
$capabilities = DesiredCapabilities::chrome();
210-
$remoteWebDriver = RemoteWebDriver::createBySessionID($session['id'], $wdHost,
211-
$webDriverConfig['connection_timeout'], $webDriverConfig['request_timeout'], true, $capabilities);
212-
$remoteWebDriver->quit();
201+
try {
202+
$chromeOptions = new ChromeOptions();
203+
$capabilities = DesiredCapabilities::chrome();
204+
$remoteWebDriver = RemoteWebDriver::createBySessionID($session['id'], $wdHost,
205+
$webDriverConfig['connection_timeout'], $webDriverConfig['request_timeout'], true, $capabilities);
206+
$remoteWebDriver->quit();
207+
} catch (\Exception $exception) {
208+
print("Failed trying to quit WebDriver session. Exception message: " . $exception->getMessage() . " Test execution will continue." . PHP_EOL);
209+
// Session already closed so nothing to do
210+
}
213211
}
214212
}
215213
}

dev/tests/verification/Resources/functionalSuiteHooks.txt

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,6 @@ class functionalSuiteHooks extends \Codeception\GroupObject
2929
private $testCount = 1;
3030
private $preconditionFailure = null;
3131
private $currentTestRun = 0;
32-
/**
33-
* Remote Web Driver
34-
*
35-
* @var RemoteWebDriver
36-
*/
37-
private $remoteWebDriver = null;
3832
private static $HOOK_EXECUTION_INIT = "\n/******** Beginning execution of functionalSuiteHooks suite %s block ********/\n";
3933
private static $HOOK_EXECUTION_END = "\n/******** Execution of functionalSuiteHooks suite %s block complete ********/\n";
4034
/** @var MagentoWebDriver */
@@ -187,12 +181,16 @@ class functionalSuiteHooks extends \Codeception\GroupObject
187181
);
188182
$availableSessions = RemoteWebDriver::getAllSessions($wdHost);
189183
foreach ($availableSessions as $session) {
190-
// Create an instance of ChromeOptions:
191-
$chromeOptions = new ChromeOptions();
192-
$capabilities = DesiredCapabilities::chrome();
193-
$remoteWebDriver = RemoteWebDriver::createBySessionID($session['id'], $wdHost,
194-
$webDriverConfig['connection_timeout'], $webDriverConfig['request_timeout'], true, $capabilities);
195-
$remoteWebDriver->quit();
184+
try {
185+
$chromeOptions = new ChromeOptions();
186+
$capabilities = DesiredCapabilities::chrome();
187+
$remoteWebDriver = RemoteWebDriver::createBySessionID($session['id'], $wdHost,
188+
$webDriverConfig['connection_timeout'], $webDriverConfig['request_timeout'], true, $capabilities);
189+
$remoteWebDriver->quit();
190+
} catch (\Exception $exception) {
191+
print("Failed trying to quit WebDriver session. Exception message: " . $exception->getMessage() . " Test execution will continue." . PHP_EOL);
192+
// Session already closed so nothing to do
193+
}
196194
}
197195
}
198196
}

dev/tests/verification/Resources/functionalSuiteWithComments.txt

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,6 @@ class functionalSuiteWithComments extends \Codeception\GroupObject
2929
private $testCount = 1;
3030
private $preconditionFailure = null;
3131
private $currentTestRun = 0;
32-
/**
33-
* Remote Web Driver
34-
*
35-
* @var RemoteWebDriver
36-
*/
37-
private $remoteWebDriver = null;
3832
private static $HOOK_EXECUTION_INIT = "\n/******** Beginning execution of functionalSuiteWithComments suite %s block ********/\n";
3933
private static $HOOK_EXECUTION_END = "\n/******** Execution of functionalSuiteWithComments suite %s block complete ********/\n";
4034
/** @var MagentoWebDriver */
@@ -167,12 +161,16 @@ class functionalSuiteWithComments extends \Codeception\GroupObject
167161
);
168162
$availableSessions = RemoteWebDriver::getAllSessions($wdHost);
169163
foreach ($availableSessions as $session) {
170-
// Create an instance of ChromeOptions:
171-
$chromeOptions = new ChromeOptions();
172-
$capabilities = DesiredCapabilities::chrome();
173-
$remoteWebDriver = RemoteWebDriver::createBySessionID($session['id'], $wdHost,
174-
$webDriverConfig['connection_timeout'], $webDriverConfig['request_timeout'], true, $capabilities);
175-
$remoteWebDriver->quit();
164+
try {
165+
$chromeOptions = new ChromeOptions();
166+
$capabilities = DesiredCapabilities::chrome();
167+
$remoteWebDriver = RemoteWebDriver::createBySessionID($session['id'], $wdHost,
168+
$webDriverConfig['connection_timeout'], $webDriverConfig['request_timeout'], true, $capabilities);
169+
$remoteWebDriver->quit();
170+
} catch (\Exception $exception) {
171+
print("Failed trying to quit WebDriver session. Exception message: " . $exception->getMessage() . " Test execution will continue." . PHP_EOL);
172+
// Session already closed so nothing to do
173+
}
176174
}
177175
}
178176
}

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

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,6 @@ class {{suiteName}} extends \Codeception\GroupObject
2929
private $testCount = {{testCount}};
3030
private $preconditionFailure = null;
3131
private $currentTestRun = 0;
32-
/**
33-
* Remote Web Driver
34-
*
35-
* @var RemoteWebDriver
36-
*/
37-
private $remoteWebDriver = null;
3832
{{#helpers}}
3933
/**
4034
* @var \Magento\FunctionalTestingFramework\Helper\HelperContainer $helperContainer
@@ -160,12 +154,16 @@ class {{suiteName}} extends \Codeception\GroupObject
160154
);
161155
$availableSessions = RemoteWebDriver::getAllSessions($wdHost);
162156
foreach ($availableSessions as $session) {
163-
// Create an instance of ChromeOptions:
164-
$chromeOptions = new ChromeOptions();
165-
$capabilities = DesiredCapabilities::chrome();
166-
$remoteWebDriver = RemoteWebDriver::createBySessionID($session['id'], $wdHost,
167-
$webDriverConfig['connection_timeout'], $webDriverConfig['request_timeout'], true, $capabilities);
168-
$remoteWebDriver->quit();
157+
try {
158+
$chromeOptions = new ChromeOptions();
159+
$capabilities = DesiredCapabilities::chrome();
160+
$remoteWebDriver = RemoteWebDriver::createBySessionID($session['id'], $wdHost,
161+
$webDriverConfig['connection_timeout'], $webDriverConfig['request_timeout'], true, $capabilities);
162+
$remoteWebDriver->quit();
163+
} catch (\Exception $exception) {
164+
print("Failed trying to quit WebDriver session. Exception message: " . $exception->getMessage() . " Test execution will continue." . PHP_EOL);
165+
// Session already closed so nothing to do
166+
}
169167
}
170168
}
171169
}

0 commit comments

Comments
 (0)