From 61f9cbb4dd2867b9beb2be04c404cf7587a87317 Mon Sep 17 00:00:00 2001 From: Alex Kolesnyk Date: Mon, 14 Aug 2023 21:21:45 -0500 Subject: [PATCH 1/3] Suite rerun failure hotfix --- .../Suite/views/SuiteClass.mustache | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Magento/FunctionalTestingFramework/Suite/views/SuiteClass.mustache b/src/Magento/FunctionalTestingFramework/Suite/views/SuiteClass.mustache index ec8a23448..d8f79e94c 100644 --- a/src/Magento/FunctionalTestingFramework/Suite/views/SuiteClass.mustache +++ b/src/Magento/FunctionalTestingFramework/Suite/views/SuiteClass.mustache @@ -152,8 +152,13 @@ class {{suiteName}} extends \Codeception\GroupObject ); $availableSessions = RemoteWebDriver::getAllSessions($wdHost); foreach ($availableSessions as $session) { - $remoteWebDriver = RemoteWebDriver::createBySessionID($session['id'], $wdHost); - $remoteWebDriver->quit(); + try { + $remoteWebDriver = RemoteWebDriver::createBySessionID($session['id'], $wdHost); + $remoteWebDriver->quit(); + } catch (\Exception $exception) { + print("Failed trying to quit WebDriver session. Exception message: " . $exception->getMessage() . " Test execution will continue." . PHP_EOL); + // Session already closed so nothing to do + } } } } From 64e8b3e7d307eb01221137032b91dc659eeced45 Mon Sep 17 00:00:00 2001 From: Alex Kolesnyk Date: Mon, 14 Aug 2023 21:27:25 -0500 Subject: [PATCH 2/3] Suite after section failure HOTFIX --- CHANGELOG.md | 5 +++++ composer.json | 2 +- composer.lock | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 068410a3b..3bb602154 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,11 @@ Magento Functional Testing Framework Changelog ================================================ +4.3.4 +--------- +### Fixes +* Resolving an issue when test is marked as failed due to Suite after section failure + 4.3.3 --------- ### Enhancements diff --git a/composer.json b/composer.json index 3d5701062..11412a51f 100755 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "magento/magento2-functional-testing-framework", "description": "Magento2 Functional Testing Framework", "type": "library", - "version": "4.3.3", + "version": "4.3.4", "license": "AGPL-3.0", "keywords": ["magento", "automation", "functional", "testing"], "config": { diff --git a/composer.lock b/composer.lock index ee14feb52..fff04c318 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "38f76cb012349da43193639e44a6ca55", + "content-hash": "9c914b99fdfd6e56de9a1f3d53b417bf", "packages": [ { "name": "allure-framework/allure-codeception", From 00e15089e70cce6ce2c62e2e5fe7cf9f4336aae7 Mon Sep 17 00:00:00 2001 From: Alex Kolesnyk Date: Mon, 14 Aug 2023 21:36:11 -0500 Subject: [PATCH 3/3] Suite after section failure HOTFIX - verification test fixes --- .../Resources/ActionsInDifferentModulesSuite.txt | 9 +++++++-- .../verification/Resources/functionalSuiteHooks.txt | 9 +++++++-- .../Resources/functionalSuiteWithComments.txt | 9 +++++++-- 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/dev/tests/verification/Resources/ActionsInDifferentModulesSuite.txt b/dev/tests/verification/Resources/ActionsInDifferentModulesSuite.txt index 19829daa2..dc2fef293 100644 --- a/dev/tests/verification/Resources/ActionsInDifferentModulesSuite.txt +++ b/dev/tests/verification/Resources/ActionsInDifferentModulesSuite.txt @@ -196,8 +196,13 @@ class ActionsInDifferentModulesSuite extends \Codeception\GroupObject ); $availableSessions = RemoteWebDriver::getAllSessions($wdHost); foreach ($availableSessions as $session) { - $remoteWebDriver = RemoteWebDriver::createBySessionID($session['id'], $wdHost); - $remoteWebDriver->quit(); + try { + $remoteWebDriver = RemoteWebDriver::createBySessionID($session['id'], $wdHost); + $remoteWebDriver->quit(); + } catch (\Exception $exception) { + print("Failed trying to quit WebDriver session. Exception message: " . $exception->getMessage() . " Test execution will continue." . PHP_EOL); + // Session already closed so nothing to do + } } } } diff --git a/dev/tests/verification/Resources/functionalSuiteHooks.txt b/dev/tests/verification/Resources/functionalSuiteHooks.txt index 5c4a8f594..6b22382bb 100644 --- a/dev/tests/verification/Resources/functionalSuiteHooks.txt +++ b/dev/tests/verification/Resources/functionalSuiteHooks.txt @@ -179,8 +179,13 @@ class functionalSuiteHooks extends \Codeception\GroupObject ); $availableSessions = RemoteWebDriver::getAllSessions($wdHost); foreach ($availableSessions as $session) { - $remoteWebDriver = RemoteWebDriver::createBySessionID($session['id'], $wdHost); - $remoteWebDriver->quit(); + try { + $remoteWebDriver = RemoteWebDriver::createBySessionID($session['id'], $wdHost); + $remoteWebDriver->quit(); + } catch (\Exception $exception) { + print("Failed trying to quit WebDriver session. Exception message: " . $exception->getMessage() . " Test execution will continue." . PHP_EOL); + // Session already closed so nothing to do + } } } } diff --git a/dev/tests/verification/Resources/functionalSuiteWithComments.txt b/dev/tests/verification/Resources/functionalSuiteWithComments.txt index 7e9bd6ba1..bd0fd173f 100644 --- a/dev/tests/verification/Resources/functionalSuiteWithComments.txt +++ b/dev/tests/verification/Resources/functionalSuiteWithComments.txt @@ -159,8 +159,13 @@ class functionalSuiteWithComments extends \Codeception\GroupObject ); $availableSessions = RemoteWebDriver::getAllSessions($wdHost); foreach ($availableSessions as $session) { - $remoteWebDriver = RemoteWebDriver::createBySessionID($session['id'], $wdHost); - $remoteWebDriver->quit(); + try { + $remoteWebDriver = RemoteWebDriver::createBySessionID($session['id'], $wdHost); + $remoteWebDriver->quit(); + } catch (\Exception $exception) { + print("Failed trying to quit WebDriver session. Exception message: " . $exception->getMessage() . " Test execution will continue." . PHP_EOL); + // Session already closed so nothing to do + } } } }