From 79c2af90d0b29bacf93f47f285cb863c659ab541 Mon Sep 17 00:00:00 2001 From: Kevin Kozan Date: Tue, 19 Mar 2019 14:07:38 -0500 Subject: [PATCH 1/4] MQE-1472: Action Group context in Tests and Allure - Added Context comment in ActionGroupObject - Allure now nests actionGroup steps a parent step --- .../Allure/Adapter/MagentoAllureAdapter.php | 63 ++++++++++++++++++- .../Test/Objects/ActionGroupObject.php | 24 +++++++ .../Test/Objects/ActionObject.php | 2 + 3 files changed, 88 insertions(+), 1 deletion(-) diff --git a/src/Magento/FunctionalTestingFramework/Allure/Adapter/MagentoAllureAdapter.php b/src/Magento/FunctionalTestingFramework/Allure/Adapter/MagentoAllureAdapter.php index 747e653e9..9d3177cfd 100644 --- a/src/Magento/FunctionalTestingFramework/Allure/Adapter/MagentoAllureAdapter.php +++ b/src/Magento/FunctionalTestingFramework/Allure/Adapter/MagentoAllureAdapter.php @@ -6,11 +6,14 @@ namespace Magento\FunctionalTestingFramework\Allure\Adapter; use Magento\FunctionalTestingFramework\Suite\Handlers\SuiteObjectHandler; +use Magento\FunctionalTestingFramework\Test\Objects\ActionGroupObject; +use Yandex\Allure\Adapter\Model\Step; use Yandex\Allure\Codeception\AllureCodeception; use Yandex\Allure\Adapter\Event\StepStartedEvent; use Yandex\Allure\Adapter\Event\StepFinishedEvent; use Yandex\Allure\Adapter\Event\StepFailedEvent; use Yandex\Allure\Adapter\Event\TestCaseFailedEvent; +use Yandex\Allure\Adapter\Event\TestCaseFinishedEvent; use Codeception\Event\FailEvent; use Codeception\Event\SuiteEvent; use Codeception\Event\StepEvent; @@ -25,6 +28,8 @@ class MagentoAllureAdapter extends AllureCodeception { + const STEP_PASSED = "passed"; + /** * Array of group values passed to test runner command * @@ -107,7 +112,13 @@ public function stepBefore(StepEvent $stepEvent) { //Hard set to 200; we don't expose this config in MFTF $argumentsLength = 200; - $stepAction = $stepEvent->getStep()->getHumanizedActionWithoutArguments(); + + // DO NOT alter action if actionGroup is starting, need the exact actionGroup name for good logging + if (strpos($stepEvent->getStep()->getAction(), ActionGroupObject::ACTION_GROUP_CONTEXT_START) !== false) { + $stepAction = $stepEvent->getStep()->getAction(); + } else { + $stepAction = $stepEvent->getStep()->getHumanizedActionWithoutArguments(); + } $stepArgs = $stepEvent->getStep()->getArgumentsAsString($argumentsLength); if (!trim($stepAction)) { @@ -148,4 +159,54 @@ public function testIncomplete(FailEvent $failEvent) $message = $e->getMessage(); $this->getLifecycle()->fire($event->withException($e)->withMessage($message)); } + + /** + * Override of parent method, polls stepStorage for testcase and formats it according to actionGroup nesting. + * + * @return void + */ + public function testEnd() + { + $rootStep = $this->getLifecycle()->getStepStorage()->pollLast(); + $formattedStep = new Step(); + $formattedStep->setName($rootStep->getName()); + $formattedStep->setStart($rootStep->getStart()); + $formattedStep->setStatus($rootStep->getStatus()); + + $actionGroupStepContainer = null; + + foreach ($rootStep->getSteps() as $step) { + // if actionGroup flag, start nesting + if (strpos($step->getName(), ActionGroupObject::ACTION_GROUP_CONTEXT_START) !== false) { + $step->setName(str_replace(ActionGroupObject::ACTION_GROUP_CONTEXT_START, '', $step->getName())); + $actionGroupStepContainer = $step; + continue; + } + // if actionGroup ended, add stack to steps + if (stripos($step->getName(), ActionGroupObject::ACTION_GROUP_CONTEXT_END) !== false) { + $formattedStep->addStep($actionGroupStepContainer); + $actionGroupStepContainer = null; + continue; + } + + if ($actionGroupStepContainer !== null) { + $actionGroupStepContainer->addStep($step); + if ($step->getStatus() !== self::STEP_PASSED) { + // If step didn't pass, need to end action group nesting and set overall step status + $actionGroupStepContainer->setStatus($step->getStatus()); + $formattedStep->addStep($actionGroupStepContainer); + $actionGroupStepContainer = null; + } + } else { + // Add step as normal + $formattedStep->addStep($step); + } + } + + // Reset storage with new formatted nested steps + $this->getLifecycle()->getStepStorage()->clear(); + $this->getLifecycle()->getStepStorage()->put($formattedStep); + + $this->getLifecycle()->fire(new TestCaseFinishedEvent()); + } } diff --git a/src/Magento/FunctionalTestingFramework/Test/Objects/ActionGroupObject.php b/src/Magento/FunctionalTestingFramework/Test/Objects/ActionGroupObject.php index 67c1ba25c..b7176b43a 100644 --- a/src/Magento/FunctionalTestingFramework/Test/Objects/ActionGroupObject.php +++ b/src/Magento/FunctionalTestingFramework/Test/Objects/ActionGroupObject.php @@ -19,6 +19,8 @@ class ActionGroupObject { const ACTION_GROUP_ORIGIN_NAME = "actionGroupName"; const ACTION_GROUP_ORIGIN_TEST_REF = "testInvocationRef"; + const ACTION_GROUP_CONTEXT_START = "Entering Action Group "; + const ACTION_GROUP_CONTEXT_END = "Exiting Action Group"; const STEPKEY_REPLACEMENT_ENABLED_TYPES = [ "executeJS", "magentoCLI", @@ -190,6 +192,8 @@ private function getResolvedActionsWithArgs($arguments, $actionReferenceKey) ); } + $resolvedActions = $this->addContextCommentsToActionList($resolvedActions); + return $resolvedActions; } @@ -481,4 +485,24 @@ private function replaceCreateDataKeys($action, $replacementStepKeys) return $resolvedActionAttributes; } + + /** + * Adds comment ActionObjects before and after given actionList for context setting. + * @param array $actionList + * @return array + */ + private function addContextCommentsToActionList($actionList) + { + $startAction = new ActionObject( + self::ACTION_GROUP_CONTEXT_START . $this->name, + ActionObject::ACTION_TYPE_COMMENT, + [ActionObject::ACTION_ATTRIBUTE_USERINPUT => self::ACTION_GROUP_CONTEXT_START . $this->name] + ); + $endAction = new ActionObject( + self::ACTION_GROUP_CONTEXT_END, + ActionObject::ACTION_TYPE_COMMENT, + [ActionObject::ACTION_ATTRIBUTE_USERINPUT => self::ACTION_GROUP_CONTEXT_END] + ); + return [$startAction->getStepKey() => $startAction] + $actionList + [$endAction->getStepKey() => $endAction]; + } } diff --git a/src/Magento/FunctionalTestingFramework/Test/Objects/ActionObject.php b/src/Magento/FunctionalTestingFramework/Test/Objects/ActionObject.php index 166a61889..f8650f2cf 100644 --- a/src/Magento/FunctionalTestingFramework/Test/Objects/ActionObject.php +++ b/src/Magento/FunctionalTestingFramework/Test/Objects/ActionObject.php @@ -69,6 +69,8 @@ class ActionObject const ACTION_ATTRIBUTE_VARIABLE_REGEX_PARAMETER = '/\(.+\)/'; const ACTION_ATTRIBUTE_VARIABLE_REGEX_PATTERN = '/({{[\w]+\.[\w\[\]]+}})|({{[\w]+\.[\w]+\((?(?!}}).)+\)}})/'; const DEFAULT_WAIT_TIMEOUT = 10; + const ACTION_ATTRIBUTE_USERINPUT = 'userInput'; + const ACTION_TYPE_COMMENT = 'comment'; /** * The unique identifier for the action From cd42bf637107c52252797f8d6abd504ae7f61e7c Mon Sep 17 00:00:00 2001 From: Kevin Kozan Date: Tue, 19 Mar 2019 15:25:42 -0500 Subject: [PATCH 2/4] MQE-1472: Action Group context in Tests and Allure - ActionGroup StepKey added to index in steps, fixes duplicate AG collisions --- .../Test/Objects/ActionGroupObject.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/Magento/FunctionalTestingFramework/Test/Objects/ActionGroupObject.php b/src/Magento/FunctionalTestingFramework/Test/Objects/ActionGroupObject.php index b7176b43a..57fda2c20 100644 --- a/src/Magento/FunctionalTestingFramework/Test/Objects/ActionGroupObject.php +++ b/src/Magento/FunctionalTestingFramework/Test/Objects/ActionGroupObject.php @@ -192,7 +192,7 @@ private function getResolvedActionsWithArgs($arguments, $actionReferenceKey) ); } - $resolvedActions = $this->addContextCommentsToActionList($resolvedActions); + $resolvedActions = $this->addContextCommentsToActionList($resolvedActions, $actionReferenceKey); return $resolvedActions; } @@ -491,17 +491,18 @@ private function replaceCreateDataKeys($action, $replacementStepKeys) * @param array $actionList * @return array */ - private function addContextCommentsToActionList($actionList) + private function addContextCommentsToActionList($actionList, $actionReferenceKey) { + $actionStartComment = self::ACTION_GROUP_CONTEXT_START . $this->name . " (" . $actionReferenceKey . ")"; $startAction = new ActionObject( - self::ACTION_GROUP_CONTEXT_START . $this->name, + $actionStartComment, ActionObject::ACTION_TYPE_COMMENT, - [ActionObject::ACTION_ATTRIBUTE_USERINPUT => self::ACTION_GROUP_CONTEXT_START . $this->name] + [ActionObject::ACTION_ATTRIBUTE_USERINPUT => $actionStartComment] ); $endAction = new ActionObject( - self::ACTION_GROUP_CONTEXT_END, + self::ACTION_GROUP_CONTEXT_END . $this->name, ActionObject::ACTION_TYPE_COMMENT, - [ActionObject::ACTION_ATTRIBUTE_USERINPUT => self::ACTION_GROUP_CONTEXT_END] + [ActionObject::ACTION_ATTRIBUTE_USERINPUT => self::ACTION_GROUP_CONTEXT_END . $this->name] ); return [$startAction->getStepKey() => $startAction] + $actionList + [$endAction->getStepKey() => $endAction]; } From de0b3fe5db7433a905a3fcad50243794f7b3a0e1 Mon Sep 17 00:00:00 2001 From: Kevin Kozan Date: Wed, 20 Mar 2019 11:21:11 -0500 Subject: [PATCH 3/4] MQE-1472: Action Group context in Tests and Allure - Static/Verification test fixes --- .../ActionGroupContainsStepKeyInArgText.txt | 4 ++++ .../ActionGroupMergedViaInsertAfter.txt | 2 ++ .../ActionGroupMergedViaInsertBefore.txt | 2 ++ .../Resources/ActionGroupSkipReadiness.txt | 2 ++ .../Resources/ActionGroupToExtend.txt | 2 ++ .../Resources/ActionGroupUsingCreateData.txt | 2 ++ .../ActionGroupUsingNestedArgument.txt | 2 ++ .../ActionGroupWithDataOverrideTest.txt | 6 ++++++ .../Resources/ActionGroupWithDataTest.txt | 6 ++++++ ...hDefaultArgumentAndStringSelectorParam.txt | 2 ++ ...eParameterSelectorsFromDefaultArgument.txt | 2 ++ .../Resources/ActionGroupWithNoArguments.txt | 2 ++ .../ActionGroupWithNoDefaultTest.txt | 6 ++++++ ...roupWithParameterizedElementWithHyphen.txt | 2 ++ ...thPassedArgumentAndStringSelectorParam.txt | 2 ++ .../ActionGroupWithPersistedData.txt | 6 ++++++ ...tionGroupWithSectionAndDataAsArguments.txt | 2 ++ ...WithSimpleDataUsageFromDefaultArgument.txt | 2 ++ ...pWithSimpleDataUsageFromPassedArgument.txt | 20 +++++++++++++++++++ ...leParameterSelectorFromDefaultArgument.txt | 2 ++ ...gleParameterSelectorFromPassedArgument.txt | 2 ++ .../ActionGroupWithStepKeyReferences.txt | 2 ++ .../ActionGroupWithTopLevelPersistedData.txt | 6 ++++++ .../ArgumentWithSameNameAsElement.txt | 6 ++++++ .../Resources/BasicActionGroupTest.txt | 4 ++++ .../verification/Resources/BasicMergeTest.txt | 2 ++ .../Resources/ChildExtendedTestNoParent.txt | 2 +- .../Resources/ExtendedActionGroup.txt | 2 ++ .../Resources/ExtendedRemoveActionGroup.txt | 2 ++ .../Resources/MergedActionGroupTest.txt | 6 ++++++ .../Resources/MultipleActionGroupsTest.txt | 8 ++++++++ .../PersistedAndXmlEntityArguments.txt | 2 ++ .../PersistenceActionGroupAppendingTest.txt | 4 ++++ .../Resources/PersistenceCustomFieldsTest.txt | 2 ++ .../Resources/functionalSuiteHooks.txt | 4 ++++ .../Allure/Adapter/MagentoAllureAdapter.php | 3 ++- .../Test/Objects/ActionGroupObject.php | 10 ++++++---- 37 files changed, 137 insertions(+), 6 deletions(-) diff --git a/dev/tests/verification/Resources/ActionGroupContainsStepKeyInArgText.txt b/dev/tests/verification/Resources/ActionGroupContainsStepKeyInArgText.txt index 8d33003af..a9d6c3d27 100644 --- a/dev/tests/verification/Resources/ActionGroupContainsStepKeyInArgText.txt +++ b/dev/tests/verification/Resources/ActionGroupContainsStepKeyInArgText.txt @@ -24,7 +24,9 @@ class ActionGroupContainsStepKeyInArgTextCest */ public function _before(AcceptanceTester $I) { + $I->comment("Entering Action Group actionGroupContainsStepKeyInArgValue (actionGroup)"); $I->see("arg1", ".selector"); + $I->comment("Exiting Action Group actionGroupContainsStepKeyInArgValue (actionGroup)"); } /** @@ -36,6 +38,8 @@ class ActionGroupContainsStepKeyInArgTextCest */ public function ActionGroupContainsStepKeyInArgText(AcceptanceTester $I) { + $I->comment("Entering Action Group actionGroupContainsStepKeyInArgValue (actionGroup)"); $I->see("arg1", ".selector"); + $I->comment("Exiting Action Group actionGroupContainsStepKeyInArgValue (actionGroup)"); } } diff --git a/dev/tests/verification/Resources/ActionGroupMergedViaInsertAfter.txt b/dev/tests/verification/Resources/ActionGroupMergedViaInsertAfter.txt index 2c2536136..1573c0d43 100644 --- a/dev/tests/verification/Resources/ActionGroupMergedViaInsertAfter.txt +++ b/dev/tests/verification/Resources/ActionGroupMergedViaInsertAfter.txt @@ -27,11 +27,13 @@ class ActionGroupMergedViaInsertAfterCest */ public function ActionGroupMergedViaInsertAfter(AcceptanceTester $I) { + $I->comment("Entering Action Group FunctionalActionGroupForMassMergeAfter (keyone)"); $I->fillField("#foo", "foo"); $I->fillField("#bar", "bar"); $I->click("#foo2"); $I->click("#bar2"); $I->click("#baz2"); $I->fillField("#baz", "baz"); + $I->comment("Exiting Action Group FunctionalActionGroupForMassMergeAfter (keyone)"); } } diff --git a/dev/tests/verification/Resources/ActionGroupMergedViaInsertBefore.txt b/dev/tests/verification/Resources/ActionGroupMergedViaInsertBefore.txt index 110ce3059..5dda9af14 100644 --- a/dev/tests/verification/Resources/ActionGroupMergedViaInsertBefore.txt +++ b/dev/tests/verification/Resources/ActionGroupMergedViaInsertBefore.txt @@ -27,11 +27,13 @@ class ActionGroupMergedViaInsertBeforeCest */ public function ActionGroupMergedViaInsertBefore(AcceptanceTester $I) { + $I->comment("Entering Action Group FunctionalActionGroupForMassMergeBefore (keyone)"); $I->fillField("#foo", "foo"); $I->click("#foo2"); $I->click("#bar2"); $I->click("#baz2"); $I->fillField("#bar", "bar"); $I->fillField("#baz", "baz"); + $I->comment("Exiting Action Group FunctionalActionGroupForMassMergeBefore (keyone)"); } } diff --git a/dev/tests/verification/Resources/ActionGroupSkipReadiness.txt b/dev/tests/verification/Resources/ActionGroupSkipReadiness.txt index b787f9116..64294b7f8 100644 --- a/dev/tests/verification/Resources/ActionGroupSkipReadiness.txt +++ b/dev/tests/verification/Resources/ActionGroupSkipReadiness.txt @@ -27,8 +27,10 @@ class ActionGroupSkipReadinessCest */ public function ActionGroupSkipReadiness(AcceptanceTester $I) { + $I->comment("Entering Action Group actionGroupWithSkipReadinessActions (skipReadinessActionGroup)"); $I->skipReadinessCheck(true); $I->comment("ActionGroupSkipReadiness"); $I->skipReadinessCheck(false); + $I->comment("Exiting Action Group actionGroupWithSkipReadinessActions (skipReadinessActionGroup)"); } } diff --git a/dev/tests/verification/Resources/ActionGroupToExtend.txt b/dev/tests/verification/Resources/ActionGroupToExtend.txt index 7c7e666cd..40fdedeb9 100644 --- a/dev/tests/verification/Resources/ActionGroupToExtend.txt +++ b/dev/tests/verification/Resources/ActionGroupToExtend.txt @@ -27,7 +27,9 @@ class ActionGroupToExtendCest */ public function ActionGroupToExtend(AcceptanceTester $I) { + $I->comment("Entering Action Group ActionGroupToExtend (actionGroup)"); $grabProductsActionGroup = $I->grabMultiple("selector"); $I->assertCount(99, $grabProductsActionGroup); + $I->comment("Exiting Action Group ActionGroupToExtend (actionGroup)"); } } diff --git a/dev/tests/verification/Resources/ActionGroupUsingCreateData.txt b/dev/tests/verification/Resources/ActionGroupUsingCreateData.txt index f0d14dbd9..f011d307a 100644 --- a/dev/tests/verification/Resources/ActionGroupUsingCreateData.txt +++ b/dev/tests/verification/Resources/ActionGroupUsingCreateData.txt @@ -24,6 +24,7 @@ class ActionGroupUsingCreateDataCest */ public function _before(AcceptanceTester $I) { + $I->comment("Entering Action Group actionGroupWithCreateData (Key1)"); $I->amGoingTo("create entity that has the stepKey: createCategoryKey1"); PersistedObjectHandler::getInstance()->createEntity( "createCategoryKey1", @@ -40,6 +41,7 @@ class ActionGroupUsingCreateDataCest ["createCategoryKey1"], null ); + $I->comment("Exiting Action Group actionGroupWithCreateData (Key1)"); } /** diff --git a/dev/tests/verification/Resources/ActionGroupUsingNestedArgument.txt b/dev/tests/verification/Resources/ActionGroupUsingNestedArgument.txt index 2d435b051..8d6bf7a3a 100644 --- a/dev/tests/verification/Resources/ActionGroupUsingNestedArgument.txt +++ b/dev/tests/verification/Resources/ActionGroupUsingNestedArgument.txt @@ -27,7 +27,9 @@ class ActionGroupUsingNestedArgumentCest */ public function ActionGroupUsingNestedArgument(AcceptanceTester $I) { + $I->comment("Entering Action Group ActionGroupToExtend (actionGroup)"); $grabProductsActionGroup = $I->grabMultiple("selector"); $I->assertCount(99, $grabProductsActionGroup); + $I->comment("Exiting Action Group ActionGroupToExtend (actionGroup)"); } } diff --git a/dev/tests/verification/Resources/ActionGroupWithDataOverrideTest.txt b/dev/tests/verification/Resources/ActionGroupWithDataOverrideTest.txt index 3bc708a1a..a584c0f50 100644 --- a/dev/tests/verification/Resources/ActionGroupWithDataOverrideTest.txt +++ b/dev/tests/verification/Resources/ActionGroupWithDataOverrideTest.txt @@ -33,8 +33,10 @@ class ActionGroupWithDataOverrideTestCest [], null ); + $I->comment("Entering Action Group FunctionalActionGroup (beforeGroup)"); $I->fillField("#foo", "myData1"); $I->fillField("#bar", "myData2"); + $I->comment("Exiting Action Group FunctionalActionGroup (beforeGroup)"); } /** @@ -43,8 +45,10 @@ class ActionGroupWithDataOverrideTestCest */ public function _after(AcceptanceTester $I) { + $I->comment("Entering Action Group FunctionalActionGroup (afterGroup)"); $I->fillField("#foo", "myData1"); $I->fillField("#bar", "myData2"); + $I->comment("Exiting Action Group FunctionalActionGroup (afterGroup)"); } /** @@ -68,11 +72,13 @@ class ActionGroupWithDataOverrideTestCest public function ActionGroupWithDataOverrideTest(AcceptanceTester $I) { $I->amOnPage("/someUrl"); + $I->comment("Entering Action Group FunctionalActionGroupWithData (actionGroupWithDataOverride1)"); $I->amOnPage("/John/Doe.html"); $I->fillField("#foo", "John"); $I->fillField("#bar", "Doe"); $I->searchAndMultiSelectOption("#foo", ["John", "Doe"]); $I->see("#element .John"); + $I->comment("Exiting Action Group FunctionalActionGroupWithData (actionGroupWithDataOverride1)"); $I->click("loginButton"); } } diff --git a/dev/tests/verification/Resources/ActionGroupWithDataTest.txt b/dev/tests/verification/Resources/ActionGroupWithDataTest.txt index e79534bad..29d822831 100644 --- a/dev/tests/verification/Resources/ActionGroupWithDataTest.txt +++ b/dev/tests/verification/Resources/ActionGroupWithDataTest.txt @@ -33,8 +33,10 @@ class ActionGroupWithDataTestCest [], null ); + $I->comment("Entering Action Group FunctionalActionGroup (beforeGroup)"); $I->fillField("#foo", "myData1"); $I->fillField("#bar", "myData2"); + $I->comment("Exiting Action Group FunctionalActionGroup (beforeGroup)"); } /** @@ -43,8 +45,10 @@ class ActionGroupWithDataTestCest */ public function _after(AcceptanceTester $I) { + $I->comment("Entering Action Group FunctionalActionGroup (afterGroup)"); $I->fillField("#foo", "myData1"); $I->fillField("#bar", "myData2"); + $I->comment("Exiting Action Group FunctionalActionGroup (afterGroup)"); } /** @@ -68,11 +72,13 @@ class ActionGroupWithDataTestCest public function ActionGroupWithDataTest(AcceptanceTester $I) { $I->amOnPage("/someUrl"); + $I->comment("Entering Action Group FunctionalActionGroupWithData (actionGroupWithData1)"); $I->amOnPage("/Jane/Dane.html"); $I->fillField("#foo", "Jane"); $I->fillField("#bar", "Dane"); $I->searchAndMultiSelectOption("#foo", ["Jane", "Dane"]); $I->see("#element .Jane"); + $I->comment("Exiting Action Group FunctionalActionGroupWithData (actionGroupWithData1)"); $I->click("loginButton"); } } diff --git a/dev/tests/verification/Resources/ActionGroupWithDefaultArgumentAndStringSelectorParam.txt b/dev/tests/verification/Resources/ActionGroupWithDefaultArgumentAndStringSelectorParam.txt index db3c6325c..a66759a89 100644 --- a/dev/tests/verification/Resources/ActionGroupWithDefaultArgumentAndStringSelectorParam.txt +++ b/dev/tests/verification/Resources/ActionGroupWithDefaultArgumentAndStringSelectorParam.txt @@ -29,6 +29,8 @@ class ActionGroupWithDefaultArgumentAndStringSelectorParamCest */ public function ActionGroupWithDefaultArgumentAndStringSelectorParam(AcceptanceTester $I) { + $I->comment("Entering Action Group actionGroupWithDefaultArgumentAndStringSelectorParam (actionGroup)"); $I->see("John", "#element .test1"); + $I->comment("Exiting Action Group actionGroupWithDefaultArgumentAndStringSelectorParam (actionGroup)"); } } diff --git a/dev/tests/verification/Resources/ActionGroupWithMultipleParameterSelectorsFromDefaultArgument.txt b/dev/tests/verification/Resources/ActionGroupWithMultipleParameterSelectorsFromDefaultArgument.txt index e446cc407..e726a178f 100644 --- a/dev/tests/verification/Resources/ActionGroupWithMultipleParameterSelectorsFromDefaultArgument.txt +++ b/dev/tests/verification/Resources/ActionGroupWithMultipleParameterSelectorsFromDefaultArgument.txt @@ -29,6 +29,8 @@ class ActionGroupWithMultipleParameterSelectorsFromDefaultArgumentCest */ public function ActionGroupWithMultipleParameterSelectorsFromDefaultArgument(AcceptanceTester $I) { + $I->comment("Entering Action Group actionGroupWithMultipleParameterSelectorsFromArgument (actionGroup)"); $I->see("Doe", "#John-Doe .test"); + $I->comment("Exiting Action Group actionGroupWithMultipleParameterSelectorsFromArgument (actionGroup)"); } } diff --git a/dev/tests/verification/Resources/ActionGroupWithNoArguments.txt b/dev/tests/verification/Resources/ActionGroupWithNoArguments.txt index 39e4bda89..751206193 100644 --- a/dev/tests/verification/Resources/ActionGroupWithNoArguments.txt +++ b/dev/tests/verification/Resources/ActionGroupWithNoArguments.txt @@ -29,6 +29,8 @@ class ActionGroupWithNoArgumentsCest */ public function ActionGroupWithNoArguments(AcceptanceTester $I) { + $I->comment("Entering Action Group actionGroupWithoutArguments (actionGroup)"); $I->wait(1); + $I->comment("Exiting Action Group actionGroupWithoutArguments (actionGroup)"); } } diff --git a/dev/tests/verification/Resources/ActionGroupWithNoDefaultTest.txt b/dev/tests/verification/Resources/ActionGroupWithNoDefaultTest.txt index ed02790e5..fd5846c4a 100644 --- a/dev/tests/verification/Resources/ActionGroupWithNoDefaultTest.txt +++ b/dev/tests/verification/Resources/ActionGroupWithNoDefaultTest.txt @@ -33,8 +33,10 @@ class ActionGroupWithNoDefaultTestCest [], null ); + $I->comment("Entering Action Group FunctionalActionGroup (beforeGroup)"); $I->fillField("#foo", "myData1"); $I->fillField("#bar", "myData2"); + $I->comment("Exiting Action Group FunctionalActionGroup (beforeGroup)"); } /** @@ -43,8 +45,10 @@ class ActionGroupWithNoDefaultTestCest */ public function _after(AcceptanceTester $I) { + $I->comment("Entering Action Group FunctionalActionGroup (afterGroup)"); $I->fillField("#foo", "myData1"); $I->fillField("#bar", "myData2"); + $I->comment("Exiting Action Group FunctionalActionGroup (afterGroup)"); } /** @@ -68,9 +72,11 @@ class ActionGroupWithNoDefaultTestCest public function ActionGroupWithNoDefaultTest(AcceptanceTester $I) { $I->amOnPage("/someUrl"); + $I->comment("Entering Action Group FunctionalActionGroupNoDefault (actionGroupWithDataOverride1)"); $I->fillField("#foo", "Jane"); $I->fillField("#bar", "Dane"); $I->see("#Jane .Dane"); + $I->comment("Exiting Action Group FunctionalActionGroupNoDefault (actionGroupWithDataOverride1)"); $I->click("loginButton"); } } diff --git a/dev/tests/verification/Resources/ActionGroupWithParameterizedElementWithHyphen.txt b/dev/tests/verification/Resources/ActionGroupWithParameterizedElementWithHyphen.txt index 64a350505..989c5af5e 100644 --- a/dev/tests/verification/Resources/ActionGroupWithParameterizedElementWithHyphen.txt +++ b/dev/tests/verification/Resources/ActionGroupWithParameterizedElementWithHyphen.txt @@ -27,6 +27,8 @@ class ActionGroupWithParameterizedElementWithHyphenCest */ public function ActionGroupWithParameterizedElementWithHyphen(AcceptanceTester $I) { + $I->comment("Entering Action Group SectionArgumentWithParameterizedSelector (actionGroup)"); $keyoneActionGroup = $I->executeJS("#element .full-width"); + $I->comment("Exiting Action Group SectionArgumentWithParameterizedSelector (actionGroup)"); } } diff --git a/dev/tests/verification/Resources/ActionGroupWithPassedArgumentAndStringSelectorParam.txt b/dev/tests/verification/Resources/ActionGroupWithPassedArgumentAndStringSelectorParam.txt index 157690bee..7df77e742 100644 --- a/dev/tests/verification/Resources/ActionGroupWithPassedArgumentAndStringSelectorParam.txt +++ b/dev/tests/verification/Resources/ActionGroupWithPassedArgumentAndStringSelectorParam.txt @@ -29,6 +29,8 @@ class ActionGroupWithPassedArgumentAndStringSelectorParamCest */ public function ActionGroupWithPassedArgumentAndStringSelectorParam(AcceptanceTester $I) { + $I->comment("Entering Action Group actionGroupWithDefaultArgumentAndStringSelectorParam (actionGroup)"); $I->see("John" . msq("UniquePerson"), "#element .test1"); + $I->comment("Exiting Action Group actionGroupWithDefaultArgumentAndStringSelectorParam (actionGroup)"); } } diff --git a/dev/tests/verification/Resources/ActionGroupWithPersistedData.txt b/dev/tests/verification/Resources/ActionGroupWithPersistedData.txt index 5ed6eb7f7..2f58e390c 100644 --- a/dev/tests/verification/Resources/ActionGroupWithPersistedData.txt +++ b/dev/tests/verification/Resources/ActionGroupWithPersistedData.txt @@ -33,8 +33,10 @@ class ActionGroupWithPersistedDataCest [], null ); + $I->comment("Entering Action Group FunctionalActionGroup (beforeGroup)"); $I->fillField("#foo", "myData1"); $I->fillField("#bar", "myData2"); + $I->comment("Exiting Action Group FunctionalActionGroup (beforeGroup)"); } /** @@ -43,8 +45,10 @@ class ActionGroupWithPersistedDataCest */ public function _after(AcceptanceTester $I) { + $I->comment("Entering Action Group FunctionalActionGroup (afterGroup)"); $I->fillField("#foo", "myData1"); $I->fillField("#bar", "myData2"); + $I->comment("Exiting Action Group FunctionalActionGroup (afterGroup)"); } /** @@ -75,10 +79,12 @@ class ActionGroupWithPersistedDataCest [], null ); + $I->comment("Entering Action Group FunctionalActionGroupWithData (actionGroupWithPersistedData1)"); $I->amOnPage("/" . PersistedObjectHandler::getInstance()->retrieveEntityField('createPerson', 'firstname', 'test') . "/" . PersistedObjectHandler::getInstance()->retrieveEntityField('createPerson', 'lastname', 'test') . ".html"); $I->fillField("#foo", PersistedObjectHandler::getInstance()->retrieveEntityField('createPerson', 'firstname', 'test')); $I->fillField("#bar", PersistedObjectHandler::getInstance()->retrieveEntityField('createPerson', 'lastname', 'test')); $I->searchAndMultiSelectOption("#foo", [PersistedObjectHandler::getInstance()->retrieveEntityField('createPerson', 'firstname', 'test'), PersistedObjectHandler::getInstance()->retrieveEntityField('createPerson', 'lastname', 'test')]); $I->see("#element ." . PersistedObjectHandler::getInstance()->retrieveEntityField('createPerson', 'firstname', 'test')); + $I->comment("Exiting Action Group FunctionalActionGroupWithData (actionGroupWithPersistedData1)"); } } diff --git a/dev/tests/verification/Resources/ActionGroupWithSectionAndDataAsArguments.txt b/dev/tests/verification/Resources/ActionGroupWithSectionAndDataAsArguments.txt index 0ee49a80e..34c2a0ea1 100644 --- a/dev/tests/verification/Resources/ActionGroupWithSectionAndDataAsArguments.txt +++ b/dev/tests/verification/Resources/ActionGroupWithSectionAndDataAsArguments.txt @@ -27,6 +27,8 @@ class ActionGroupWithSectionAndDataAsArgumentsCest */ public function ActionGroupWithSectionAndDataAsArguments(AcceptanceTester $I) { + $I->comment("Entering Action Group actionGroupWithSectionAndData (actionGroup)"); $I->waitForElementVisible("#element .John", 10); + $I->comment("Exiting Action Group actionGroupWithSectionAndData (actionGroup)"); } } diff --git a/dev/tests/verification/Resources/ActionGroupWithSimpleDataUsageFromDefaultArgument.txt b/dev/tests/verification/Resources/ActionGroupWithSimpleDataUsageFromDefaultArgument.txt index a71cd562f..f4840d88a 100644 --- a/dev/tests/verification/Resources/ActionGroupWithSimpleDataUsageFromDefaultArgument.txt +++ b/dev/tests/verification/Resources/ActionGroupWithSimpleDataUsageFromDefaultArgument.txt @@ -29,6 +29,8 @@ class ActionGroupWithSimpleDataUsageFromDefaultArgumentCest */ public function ActionGroupWithSimpleDataUsageFromDefaultArgument(AcceptanceTester $I) { + $I->comment("Entering Action Group actionGroupWithStringUsage (actionGroup)"); $I->see("stringLiteral", "#element .stringLiteral"); + $I->comment("Exiting Action Group actionGroupWithStringUsage (actionGroup)"); } } diff --git a/dev/tests/verification/Resources/ActionGroupWithSimpleDataUsageFromPassedArgument.txt b/dev/tests/verification/Resources/ActionGroupWithSimpleDataUsageFromPassedArgument.txt index 1453d716f..4f67da1aa 100644 --- a/dev/tests/verification/Resources/ActionGroupWithSimpleDataUsageFromPassedArgument.txt +++ b/dev/tests/verification/Resources/ActionGroupWithSimpleDataUsageFromPassedArgument.txt @@ -29,15 +29,35 @@ class ActionGroupWithSimpleDataUsageFromPassedArgumentCest */ public function ActionGroupWithSimpleDataUsageFromPassedArgument(AcceptanceTester $I) { + $I->comment("Entering Action Group actionGroupWithStringUsage (actionGroup1)"); $I->see("overrideString", "#element .overrideString"); + $I->comment("Exiting Action Group actionGroupWithStringUsage (actionGroup1)"); + $I->comment("Entering Action Group actionGroupWithStringUsage (actionGroup11)"); $I->see("1", "#element .1"); + $I->comment("Exiting Action Group actionGroupWithStringUsage (actionGroup11)"); + $I->comment("Entering Action Group actionGroupWithStringUsage (actionGroup12)"); $I->see("1.5", "#element .1.5"); + $I->comment("Exiting Action Group actionGroupWithStringUsage (actionGroup12)"); + $I->comment("Entering Action Group actionGroupWithStringUsage (actionGroup13)"); $I->see("true", "#element .true"); + $I->comment("Exiting Action Group actionGroupWithStringUsage (actionGroup13)"); + $I->comment("Entering Action Group actionGroupWithStringUsage (actionGroup2)"); $I->see("simpleData.firstname", "#element .simpleData.firstname"); + $I->comment("Exiting Action Group actionGroupWithStringUsage (actionGroup2)"); + $I->comment("Entering Action Group actionGroupWithStringUsage (actionGroup3)"); $I->see(PersistedObjectHandler::getInstance()->retrieveEntityField('persisted', 'data', 'test'), "#element ." . PersistedObjectHandler::getInstance()->retrieveEntityField('persisted', 'data', 'test')); + $I->comment("Exiting Action Group actionGroupWithStringUsage (actionGroup3)"); + $I->comment("Entering Action Group actionGroupWithEntityUsage (actionGroup4)"); $I->see("John", "#element .John"); + $I->comment("Exiting Action Group actionGroupWithEntityUsage (actionGroup4)"); + $I->comment("Entering Action Group actionGroupWithEntityUsage (actionGroup5)"); $I->see(PersistedObjectHandler::getInstance()->retrieveEntityField('simpleData', 'firstname', 'test'), "#element ." . PersistedObjectHandler::getInstance()->retrieveEntityField('simpleData', 'firstname', 'test')); + $I->comment("Exiting Action Group actionGroupWithEntityUsage (actionGroup5)"); + $I->comment("Entering Action Group actionGroupWithEntityUsage (actionGroup6)"); $I->see(PersistedObjectHandler::getInstance()->retrieveEntityField('simpleData', 'firstname[0]', 'test'), "#element ." . PersistedObjectHandler::getInstance()->retrieveEntityField('simpleData', 'firstname[0]', 'test')); + $I->comment("Exiting Action Group actionGroupWithEntityUsage (actionGroup6)"); + $I->comment("Entering Action Group actionGroupWithEntityUsage (actionGroup7)"); $I->see(PersistedObjectHandler::getInstance()->retrieveEntityField('simpleData', 'firstname[data_index]', 'test'), "#element ." . PersistedObjectHandler::getInstance()->retrieveEntityField('simpleData', 'firstname[data_index]', 'test')); + $I->comment("Exiting Action Group actionGroupWithEntityUsage (actionGroup7)"); } } diff --git a/dev/tests/verification/Resources/ActionGroupWithSingleParameterSelectorFromDefaultArgument.txt b/dev/tests/verification/Resources/ActionGroupWithSingleParameterSelectorFromDefaultArgument.txt index 86be7fb72..89979bf97 100644 --- a/dev/tests/verification/Resources/ActionGroupWithSingleParameterSelectorFromDefaultArgument.txt +++ b/dev/tests/verification/Resources/ActionGroupWithSingleParameterSelectorFromDefaultArgument.txt @@ -29,6 +29,8 @@ class ActionGroupWithSingleParameterSelectorFromDefaultArgumentCest */ public function ActionGroupWithSingleParameterSelectorFromDefaultArgument(AcceptanceTester $I) { + $I->comment("Entering Action Group actionGroupWithSingleParameterSelectorFromArgument (actionGroup)"); $I->see("Doe", "#element .John"); + $I->comment("Exiting Action Group actionGroupWithSingleParameterSelectorFromArgument (actionGroup)"); } } diff --git a/dev/tests/verification/Resources/ActionGroupWithSingleParameterSelectorFromPassedArgument.txt b/dev/tests/verification/Resources/ActionGroupWithSingleParameterSelectorFromPassedArgument.txt index 9a30bcc5c..b4707ff0c 100644 --- a/dev/tests/verification/Resources/ActionGroupWithSingleParameterSelectorFromPassedArgument.txt +++ b/dev/tests/verification/Resources/ActionGroupWithSingleParameterSelectorFromPassedArgument.txt @@ -29,6 +29,8 @@ class ActionGroupWithSingleParameterSelectorFromPassedArgumentCest */ public function ActionGroupWithSingleParameterSelectorFromPassedArgument(AcceptanceTester $I) { + $I->comment("Entering Action Group actionGroupWithSingleParameterSelectorFromArgument (actionGroup)"); $I->see("Doe", "#element .John" . msq("UniquePerson")); + $I->comment("Exiting Action Group actionGroupWithSingleParameterSelectorFromArgument (actionGroup)"); } } diff --git a/dev/tests/verification/Resources/ActionGroupWithStepKeyReferences.txt b/dev/tests/verification/Resources/ActionGroupWithStepKeyReferences.txt index 542e20133..92b54622c 100644 --- a/dev/tests/verification/Resources/ActionGroupWithStepKeyReferences.txt +++ b/dev/tests/verification/Resources/ActionGroupWithStepKeyReferences.txt @@ -27,6 +27,7 @@ class ActionGroupWithStepKeyReferencesCest */ public function ActionGroupWithStepKeyReferences(AcceptanceTester $I) { + $I->comment("Entering Action Group FunctionActionGroupWithStepKeyReferences (actionGroup)"); $I->amGoingTo("create entity that has the stepKey: createSimpleDataActionGroup"); PersistedObjectHandler::getInstance()->createEntity( "createSimpleDataActionGroup", @@ -83,5 +84,6 @@ class ActionGroupWithStepKeyReferencesCest $action14ActionGroup = $I->grabMultiple($action14ActionGroup); $action15ActionGroup = $I->grabTextFrom($action15ActionGroup); $action16ActionGroup = $I->grabValueFrom($action16ActionGroup); + $I->comment("Exiting Action Group FunctionActionGroupWithStepKeyReferences (actionGroup)"); } } diff --git a/dev/tests/verification/Resources/ActionGroupWithTopLevelPersistedData.txt b/dev/tests/verification/Resources/ActionGroupWithTopLevelPersistedData.txt index acc274567..463e5b307 100644 --- a/dev/tests/verification/Resources/ActionGroupWithTopLevelPersistedData.txt +++ b/dev/tests/verification/Resources/ActionGroupWithTopLevelPersistedData.txt @@ -33,8 +33,10 @@ class ActionGroupWithTopLevelPersistedDataCest [], null ); + $I->comment("Entering Action Group FunctionalActionGroup (beforeGroup)"); $I->fillField("#foo", "myData1"); $I->fillField("#bar", "myData2"); + $I->comment("Exiting Action Group FunctionalActionGroup (beforeGroup)"); } /** @@ -43,8 +45,10 @@ class ActionGroupWithTopLevelPersistedDataCest */ public function _after(AcceptanceTester $I) { + $I->comment("Entering Action Group FunctionalActionGroup (afterGroup)"); $I->fillField("#foo", "myData1"); $I->fillField("#bar", "myData2"); + $I->comment("Exiting Action Group FunctionalActionGroup (afterGroup)"); } /** @@ -67,10 +71,12 @@ class ActionGroupWithTopLevelPersistedDataCest */ public function ActionGroupWithTopLevelPersistedData(AcceptanceTester $I) { + $I->comment("Entering Action Group FunctionalActionGroupWithData (actionGroupWithPersistedData1)"); $I->amOnPage("/" . PersistedObjectHandler::getInstance()->retrieveEntityField('createPersonParam', 'firstname', 'test') . "/" . PersistedObjectHandler::getInstance()->retrieveEntityField('createPersonParam', 'lastname', 'test') . ".html"); $I->fillField("#foo", PersistedObjectHandler::getInstance()->retrieveEntityField('createPersonParam', 'firstname', 'test')); $I->fillField("#bar", PersistedObjectHandler::getInstance()->retrieveEntityField('createPersonParam', 'lastname', 'test')); $I->searchAndMultiSelectOption("#foo", [PersistedObjectHandler::getInstance()->retrieveEntityField('createPersonParam', 'firstname', 'test'), PersistedObjectHandler::getInstance()->retrieveEntityField('createPersonParam', 'lastname', 'test')]); $I->see("#element ." . PersistedObjectHandler::getInstance()->retrieveEntityField('createPersonParam', 'firstname', 'test')); + $I->comment("Exiting Action Group FunctionalActionGroupWithData (actionGroupWithPersistedData1)"); } } diff --git a/dev/tests/verification/Resources/ArgumentWithSameNameAsElement.txt b/dev/tests/verification/Resources/ArgumentWithSameNameAsElement.txt index 80a1d3c80..d1621fd73 100644 --- a/dev/tests/verification/Resources/ArgumentWithSameNameAsElement.txt +++ b/dev/tests/verification/Resources/ArgumentWithSameNameAsElement.txt @@ -33,8 +33,10 @@ class ArgumentWithSameNameAsElementCest [], null ); + $I->comment("Entering Action Group FunctionalActionGroup (beforeGroup)"); $I->fillField("#foo", "myData1"); $I->fillField("#bar", "myData2"); + $I->comment("Exiting Action Group FunctionalActionGroup (beforeGroup)"); } /** @@ -43,8 +45,10 @@ class ArgumentWithSameNameAsElementCest */ public function _after(AcceptanceTester $I) { + $I->comment("Entering Action Group FunctionalActionGroup (afterGroup)"); $I->fillField("#foo", "myData1"); $I->fillField("#bar", "myData2"); + $I->comment("Exiting Action Group FunctionalActionGroup (afterGroup)"); } /** @@ -67,7 +71,9 @@ class ArgumentWithSameNameAsElementCest */ public function ArgumentWithSameNameAsElement(AcceptanceTester $I) { + $I->comment("Entering Action Group FunctionalActionGroupWithTrickyArgument (actionGroup1)"); $I->seeElement("#element"); $I->seeElement("#element .John"); + $I->comment("Exiting Action Group FunctionalActionGroupWithTrickyArgument (actionGroup1)"); } } diff --git a/dev/tests/verification/Resources/BasicActionGroupTest.txt b/dev/tests/verification/Resources/BasicActionGroupTest.txt index d6d953a88..d62c2919d 100644 --- a/dev/tests/verification/Resources/BasicActionGroupTest.txt +++ b/dev/tests/verification/Resources/BasicActionGroupTest.txt @@ -33,8 +33,10 @@ class BasicActionGroupTestCest [], null ); + $I->comment("Entering Action Group FunctionalActionGroup (beforeGroup)"); $I->fillField("#foo", "myData1"); $I->fillField("#bar", "myData2"); + $I->comment("Exiting Action Group FunctionalActionGroup (beforeGroup)"); } /** @@ -49,8 +51,10 @@ class BasicActionGroupTestCest public function BasicActionGroupTest(AcceptanceTester $I) { $I->amOnPage("/someUrl"); + $I->comment("Entering Action Group FunctionalActionGroup (actionGroup1)"); $I->fillField("#foo", "myData1"); $I->fillField("#bar", "myData2"); + $I->comment("Exiting Action Group FunctionalActionGroup (actionGroup1)"); $I->click("loginButton"); } } diff --git a/dev/tests/verification/Resources/BasicMergeTest.txt b/dev/tests/verification/Resources/BasicMergeTest.txt index 039e31a58..2f66f2ce4 100644 --- a/dev/tests/verification/Resources/BasicMergeTest.txt +++ b/dev/tests/verification/Resources/BasicMergeTest.txt @@ -67,11 +67,13 @@ class BasicMergeTestCest $I->fillField("#password", "step5"); $I->click("#step6Merged"); $I->click("#element .Jane .step7Merge"); + $I->comment("Entering Action Group FunctionalActionGroupWithData (step8Merge)"); $I->amOnPage("/Jane/Dane.html"); $I->fillField("#foo", "Jane"); $I->fillField("#bar", "Dane"); $I->searchAndMultiSelectOption("#foo", ["Jane", "Dane"]); $I->see("#element .Jane"); + $I->comment("Exiting Action Group FunctionalActionGroupWithData (step8Merge)"); $I->click("#step10MergedInResult"); } } diff --git a/dev/tests/verification/Resources/ChildExtendedTestNoParent.txt b/dev/tests/verification/Resources/ChildExtendedTestNoParent.txt index cea7ffeca..34106b5fa 100644 --- a/dev/tests/verification/Resources/ChildExtendedTestNoParent.txt +++ b/dev/tests/verification/Resources/ChildExtendedTestNoParent.txt @@ -32,6 +32,6 @@ class ChildExtendedTestNoParentCest */ public function ChildExtendedTestNoParent(AcceptanceTester $I, \Codeception\Scenario $scenario) { - $scenario->skip("This test is skipped due to the following issues:\nNo issues have been specified."); + $scenario->skip("This test is skipped due to the following issues:No issues have been specified."); } } diff --git a/dev/tests/verification/Resources/ExtendedActionGroup.txt b/dev/tests/verification/Resources/ExtendedActionGroup.txt index 48fa542bc..e321bfec1 100644 --- a/dev/tests/verification/Resources/ExtendedActionGroup.txt +++ b/dev/tests/verification/Resources/ExtendedActionGroup.txt @@ -27,10 +27,12 @@ class ExtendedActionGroupCest */ public function ExtendedActionGroup(AcceptanceTester $I) { + $I->comment("Entering Action Group extendTestActionGroup (actionGroup)"); $I->comment("New Input Before"); $grabProductsActionGroup = $I->grabMultiple("notASelector"); $I->comment("New Input After"); $I->assertCount(99, $grabProductsActionGroup); $I->assertCount(8000, $grabProductsActionGroup); + $I->comment("Exiting Action Group extendTestActionGroup (actionGroup)"); } } diff --git a/dev/tests/verification/Resources/ExtendedRemoveActionGroup.txt b/dev/tests/verification/Resources/ExtendedRemoveActionGroup.txt index 936e78721..6d7e26d87 100644 --- a/dev/tests/verification/Resources/ExtendedRemoveActionGroup.txt +++ b/dev/tests/verification/Resources/ExtendedRemoveActionGroup.txt @@ -27,5 +27,7 @@ class ExtendedRemoveActionGroupCest */ public function ExtendedRemoveActionGroup(AcceptanceTester $I) { + $I->comment("Entering Action Group extendRemoveTestActionGroup (actionGroup)"); + $I->comment("Exiting Action Group extendRemoveTestActionGroup (actionGroup)"); } } diff --git a/dev/tests/verification/Resources/MergedActionGroupTest.txt b/dev/tests/verification/Resources/MergedActionGroupTest.txt index 2d1748f56..3a5da8725 100644 --- a/dev/tests/verification/Resources/MergedActionGroupTest.txt +++ b/dev/tests/verification/Resources/MergedActionGroupTest.txt @@ -33,8 +33,10 @@ class MergedActionGroupTestCest [], null ); + $I->comment("Entering Action Group FunctionalActionGroup (beforeGroup)"); $I->fillField("#foo", "myData1"); $I->fillField("#bar", "myData2"); + $I->comment("Exiting Action Group FunctionalActionGroup (beforeGroup)"); } /** @@ -43,8 +45,10 @@ class MergedActionGroupTestCest */ public function _after(AcceptanceTester $I) { + $I->comment("Entering Action Group FunctionalActionGroup (afterGroup)"); $I->fillField("#foo", "myData1"); $I->fillField("#bar", "myData2"); + $I->comment("Exiting Action Group FunctionalActionGroup (afterGroup)"); } /** @@ -67,9 +71,11 @@ class MergedActionGroupTestCest */ public function MergedActionGroupTest(AcceptanceTester $I) { + $I->comment("Entering Action Group FunctionalActionGroupForMerge (actionGroupForMerge)"); $I->see(".merge .Jane"); $I->see("#element .Jane"); $I->amOnPage("/Jane/Dane.html"); $I->click(".merge .Dane"); + $I->comment("Exiting Action Group FunctionalActionGroupForMerge (actionGroupForMerge)"); } } diff --git a/dev/tests/verification/Resources/MultipleActionGroupsTest.txt b/dev/tests/verification/Resources/MultipleActionGroupsTest.txt index 5084692be..ba99de0cb 100644 --- a/dev/tests/verification/Resources/MultipleActionGroupsTest.txt +++ b/dev/tests/verification/Resources/MultipleActionGroupsTest.txt @@ -33,8 +33,10 @@ class MultipleActionGroupsTestCest [], null ); + $I->comment("Entering Action Group FunctionalActionGroup (beforeGroup)"); $I->fillField("#foo", "myData1"); $I->fillField("#bar", "myData2"); + $I->comment("Exiting Action Group FunctionalActionGroup (beforeGroup)"); } /** @@ -43,8 +45,10 @@ class MultipleActionGroupsTestCest */ public function _after(AcceptanceTester $I) { + $I->comment("Entering Action Group FunctionalActionGroup (afterGroup)"); $I->fillField("#foo", "myData1"); $I->fillField("#bar", "myData2"); + $I->comment("Exiting Action Group FunctionalActionGroup (afterGroup)"); } /** @@ -68,16 +72,20 @@ class MultipleActionGroupsTestCest public function MultipleActionGroupsTest(AcceptanceTester $I) { $I->amOnPage("/someUrl"); + $I->comment("Entering Action Group FunctionalActionGroupWithData (actionGroup1)"); $I->amOnPage("/Jane/Dane.html"); $I->fillField("#foo", "Jane"); $I->fillField("#bar", "Dane"); $I->searchAndMultiSelectOption("#foo", ["Jane", "Dane"]); $I->see("#element .Jane"); + $I->comment("Exiting Action Group FunctionalActionGroupWithData (actionGroup1)"); $I->click("loginButton"); + $I->comment("Entering Action Group FunctionalActionGroupWithData (actionGroupWithDataOverride2)"); $I->amOnPage("/John/Doe.html"); $I->fillField("#foo", "John"); $I->fillField("#bar", "Doe"); $I->searchAndMultiSelectOption("#foo", ["John", "Doe"]); $I->see("#element .John"); + $I->comment("Exiting Action Group FunctionalActionGroupWithData (actionGroupWithDataOverride2)"); } } diff --git a/dev/tests/verification/Resources/PersistedAndXmlEntityArguments.txt b/dev/tests/verification/Resources/PersistedAndXmlEntityArguments.txt index 02d371571..510e99018 100644 --- a/dev/tests/verification/Resources/PersistedAndXmlEntityArguments.txt +++ b/dev/tests/verification/Resources/PersistedAndXmlEntityArguments.txt @@ -27,6 +27,8 @@ class PersistedAndXmlEntityArgumentsCest */ public function PersistedAndXmlEntityArguments(AcceptanceTester $I) { + $I->comment("Entering Action Group FunctionalActionGroupWithXmlAndPersistedData (afterGroup)"); $I->seeInCurrentUrl("/" . PersistedObjectHandler::getInstance()->retrieveEntityField('persistedInTest', 'urlKey', 'test') . ".html?___store=" . msq("uniqueData") . "John"); + $I->comment("Exiting Action Group FunctionalActionGroupWithXmlAndPersistedData (afterGroup)"); } } diff --git a/dev/tests/verification/Resources/PersistenceActionGroupAppendingTest.txt b/dev/tests/verification/Resources/PersistenceActionGroupAppendingTest.txt index c38a14155..e255a0338 100644 --- a/dev/tests/verification/Resources/PersistenceActionGroupAppendingTest.txt +++ b/dev/tests/verification/Resources/PersistenceActionGroupAppendingTest.txt @@ -24,6 +24,7 @@ class PersistenceActionGroupAppendingTestCest */ public function _before(AcceptanceTester $I) { + $I->comment("Entering Action Group DataPersistenceAppendingActionGroup (ACTIONGROUPBEFORE)"); $I->amGoingTo("create entity that has the stepKey: createDataACTIONGROUPBEFORE"); PersistedObjectHandler::getInstance()->createEntity( "createDataACTIONGROUPBEFORE", @@ -53,6 +54,7 @@ class PersistenceActionGroupAppendingTestCest null ); $I->comment(PersistedObjectHandler::getInstance()->retrieveEntityField('createData', 'field', 'hook')); + $I->comment("Exiting Action Group DataPersistenceAppendingActionGroup (ACTIONGROUPBEFORE)"); } /** @@ -64,6 +66,7 @@ class PersistenceActionGroupAppendingTestCest */ public function PersistenceActionGroupAppendingTest(AcceptanceTester $I) { + $I->comment("Entering Action Group DataPersistenceAppendingActionGroup (ACTIONGROUP)"); $I->amGoingTo("create entity that has the stepKey: createDataACTIONGROUP"); PersistedObjectHandler::getInstance()->createEntity( "createDataACTIONGROUP", @@ -93,5 +96,6 @@ class PersistenceActionGroupAppendingTestCest null ); $I->comment(PersistedObjectHandler::getInstance()->retrieveEntityField('createDataACTIONGROUP', 'field', 'test')); + $I->comment("Exiting Action Group DataPersistenceAppendingActionGroup (ACTIONGROUP)"); } } diff --git a/dev/tests/verification/Resources/PersistenceCustomFieldsTest.txt b/dev/tests/verification/Resources/PersistenceCustomFieldsTest.txt index 24faac699..2db1b498f 100644 --- a/dev/tests/verification/Resources/PersistenceCustomFieldsTest.txt +++ b/dev/tests/verification/Resources/PersistenceCustomFieldsTest.txt @@ -74,6 +74,7 @@ class PersistenceCustomFieldsTestCest ["createdData"], $createdData3Fields ); + $I->comment("Entering Action Group PersistenceActionGroup (createdAG)"); $createDataAG1CreatedAGFields['firstname'] = "string1"; $I->amGoingTo("create entity that has the stepKey: createDataAG1CreatedAG"); PersistedObjectHandler::getInstance()->createEntity( @@ -101,5 +102,6 @@ class PersistenceCustomFieldsTestCest [], $createDataAG3CreatedAGFields ); + $I->comment("Exiting Action Group PersistenceActionGroup (createdAG)"); } } diff --git a/dev/tests/verification/Resources/functionalSuiteHooks.txt b/dev/tests/verification/Resources/functionalSuiteHooks.txt index 0a6dc463f..d9ff2a344 100644 --- a/dev/tests/verification/Resources/functionalSuiteHooks.txt +++ b/dev/tests/verification/Resources/functionalSuiteHooks.txt @@ -60,7 +60,9 @@ class functionalSuiteHooks extends \Codeception\GroupObject $createFields ); $webDriver->click(PersistedObjectHandler::getInstance()->retrieveEntityField('create', 'data', 'suite')); + print("Entering Action Group actionGroupWithTwoArguments (AC)"); $webDriver->see("John", msq("uniqueData") . "John"); + print("Exiting Action Group actionGroupWithTwoArguments (AC)"); // reset configuration and close session $this->getModule('\Magento\FunctionalTestingFramework\Module\MagentoWebDriver')->_resetConfig(); @@ -120,7 +122,9 @@ class functionalSuiteHooks extends \Codeception\GroupObject $webDriver->_initializeSession(); $webDriver->amOnPage("some.url"); $webDriver->deleteEntityByUrl("deleteThis"); + print("Entering Action Group actionGroupWithTwoArguments (AC)"); $webDriver->see("John", msq("uniqueData") . "John"); + print("Exiting Action Group actionGroupWithTwoArguments (AC)"); } catch (\Exception $exception) { print $exception->getMessage(); } diff --git a/src/Magento/FunctionalTestingFramework/Allure/Adapter/MagentoAllureAdapter.php b/src/Magento/FunctionalTestingFramework/Allure/Adapter/MagentoAllureAdapter.php index 9d3177cfd..3719e5afa 100644 --- a/src/Magento/FunctionalTestingFramework/Allure/Adapter/MagentoAllureAdapter.php +++ b/src/Magento/FunctionalTestingFramework/Allure/Adapter/MagentoAllureAdapter.php @@ -24,6 +24,7 @@ * Extends AllureAdapter to provide further information for allure reports * * @package Magento\FunctionalTestingFramework\Allure + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ class MagentoAllureAdapter extends AllureCodeception @@ -195,7 +196,7 @@ public function testEnd() // If step didn't pass, need to end action group nesting and set overall step status $actionGroupStepContainer->setStatus($step->getStatus()); $formattedStep->addStep($actionGroupStepContainer); - $actionGroupStepContainer = null; + $actionGroupStepContainer = null; } } else { // Add step as normal diff --git a/src/Magento/FunctionalTestingFramework/Test/Objects/ActionGroupObject.php b/src/Magento/FunctionalTestingFramework/Test/Objects/ActionGroupObject.php index 57fda2c20..fb6f9a510 100644 --- a/src/Magento/FunctionalTestingFramework/Test/Objects/ActionGroupObject.php +++ b/src/Magento/FunctionalTestingFramework/Test/Objects/ActionGroupObject.php @@ -20,7 +20,7 @@ class ActionGroupObject const ACTION_GROUP_ORIGIN_NAME = "actionGroupName"; const ACTION_GROUP_ORIGIN_TEST_REF = "testInvocationRef"; const ACTION_GROUP_CONTEXT_START = "Entering Action Group "; - const ACTION_GROUP_CONTEXT_END = "Exiting Action Group"; + const ACTION_GROUP_CONTEXT_END = "Exiting Action Group "; const STEPKEY_REPLACEMENT_ENABLED_TYPES = [ "executeJS", "magentoCLI", @@ -488,21 +488,23 @@ private function replaceCreateDataKeys($action, $replacementStepKeys) /** * Adds comment ActionObjects before and after given actionList for context setting. - * @param array $actionList + * @param array $actionList + * @param string $actionReferenceKey * @return array */ private function addContextCommentsToActionList($actionList, $actionReferenceKey) { $actionStartComment = self::ACTION_GROUP_CONTEXT_START . $this->name . " (" . $actionReferenceKey . ")"; + $actionEndComment = self::ACTION_GROUP_CONTEXT_END . $this->name . " (" . $actionReferenceKey . ")"; $startAction = new ActionObject( $actionStartComment, ActionObject::ACTION_TYPE_COMMENT, [ActionObject::ACTION_ATTRIBUTE_USERINPUT => $actionStartComment] ); $endAction = new ActionObject( - self::ACTION_GROUP_CONTEXT_END . $this->name, + $actionEndComment, ActionObject::ACTION_TYPE_COMMENT, - [ActionObject::ACTION_ATTRIBUTE_USERINPUT => self::ACTION_GROUP_CONTEXT_END . $this->name] + [ActionObject::ACTION_ATTRIBUTE_USERINPUT => $actionEndComment] ); return [$startAction->getStepKey() => $startAction] + $actionList + [$endAction->getStepKey() => $endAction]; } From fedf28ecc46909cc142a04438fcb6c1802883b60 Mon Sep 17 00:00:00 2001 From: Kevin Kozan Date: Fri, 22 Mar 2019 08:49:38 -0500 Subject: [PATCH 4/4] MQE-1472: Action Group context in Tests and Allure - Removed unecessary intermediate Step object clone --- .../Allure/Adapter/MagentoAllureAdapter.php | 26 +++++++++++-------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/src/Magento/FunctionalTestingFramework/Allure/Adapter/MagentoAllureAdapter.php b/src/Magento/FunctionalTestingFramework/Allure/Adapter/MagentoAllureAdapter.php index 3719e5afa..64d9fdc36 100644 --- a/src/Magento/FunctionalTestingFramework/Allure/Adapter/MagentoAllureAdapter.php +++ b/src/Magento/FunctionalTestingFramework/Allure/Adapter/MagentoAllureAdapter.php @@ -168,12 +168,9 @@ public function testIncomplete(FailEvent $failEvent) */ public function testEnd() { + // Pops top of stepStorage, need to add it back in after processing $rootStep = $this->getLifecycle()->getStepStorage()->pollLast(); - $formattedStep = new Step(); - $formattedStep->setName($rootStep->getName()); - $formattedStep->setStart($rootStep->getStart()); - $formattedStep->setStatus($rootStep->getStatus()); - + $formattedSteps = []; $actionGroupStepContainer = null; foreach ($rootStep->getSteps() as $step) { @@ -185,7 +182,7 @@ public function testEnd() } // if actionGroup ended, add stack to steps if (stripos($step->getName(), ActionGroupObject::ACTION_GROUP_CONTEXT_END) !== false) { - $formattedStep->addStep($actionGroupStepContainer); + $formattedSteps[] = $actionGroupStepContainer; $actionGroupStepContainer = null; continue; } @@ -195,18 +192,25 @@ public function testEnd() if ($step->getStatus() !== self::STEP_PASSED) { // If step didn't pass, need to end action group nesting and set overall step status $actionGroupStepContainer->setStatus($step->getStatus()); - $formattedStep->addStep($actionGroupStepContainer); + $formattedSteps[] = $actionGroupStepContainer; $actionGroupStepContainer = null; } } else { // Add step as normal - $formattedStep->addStep($step); + $formattedSteps[] = $step; } } - // Reset storage with new formatted nested steps - $this->getLifecycle()->getStepStorage()->clear(); - $this->getLifecycle()->getStepStorage()->put($formattedStep); + // No public function for setting the step's steps + call_user_func(\Closure::bind( + function () use ($rootStep, $formattedSteps) { + $rootStep->steps = $formattedSteps; + }, + null, + $rootStep + )); + + $this->getLifecycle()->getStepStorage()->put($rootStep); $this->getLifecycle()->fire(new TestCaseFinishedEvent()); }