From 6363af9b9d9db406acc22e69890768aa34787e15 Mon Sep 17 00:00:00 2001 From: John S Date: Fri, 31 May 2019 13:57:56 -0500 Subject: [PATCH 01/29] MQE-1580: Remove the "page" attribute from the Action Group annotations node. - Removed the "page" attribute from the annotations block. --- .../FunctionalTestingFramework/Test/etc/actionGroupSchema.xsd | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Magento/FunctionalTestingFramework/Test/etc/actionGroupSchema.xsd b/src/Magento/FunctionalTestingFramework/Test/etc/actionGroupSchema.xsd index 616995531..6e9e798f1 100644 --- a/src/Magento/FunctionalTestingFramework/Test/etc/actionGroupSchema.xsd +++ b/src/Magento/FunctionalTestingFramework/Test/etc/actionGroupSchema.xsd @@ -34,7 +34,6 @@ - From 6a528c5e5ca9124397c515370efe47c5cd9ac8d8 Mon Sep 17 00:00:00 2001 From: John S Date: Mon, 3 Jun 2019 14:25:54 -0500 Subject: [PATCH 02/29] MQE-1580: Remove the "page" attribute from the Action Group annotations node. - Removed the "page" from the Required Annotations XML Scheme test. --- .../Test/Util/ActionGroupAnnotationExtractor.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Magento/FunctionalTestingFramework/Test/Util/ActionGroupAnnotationExtractor.php b/src/Magento/FunctionalTestingFramework/Test/Util/ActionGroupAnnotationExtractor.php index b6e89fd44..44b004105 100644 --- a/src/Magento/FunctionalTestingFramework/Test/Util/ActionGroupAnnotationExtractor.php +++ b/src/Magento/FunctionalTestingFramework/Test/Util/ActionGroupAnnotationExtractor.php @@ -14,8 +14,7 @@ class ActionGroupAnnotationExtractor extends AnnotationExtractor { const ACTION_GROUP_REQUIRED_ANNOTATIONS = [ - "description", - "page", + "description" ]; const GENERATE_DOCS_COMMAND = 'generate:docs'; From 9bdfa62cdd40952b3a798fb4ccbad07483b44539 Mon Sep 17 00:00:00 2001 From: John S Date: Tue, 4 Jun 2019 14:03:58 -0500 Subject: [PATCH 03/29] MQE-1580: Remove the "page" attribute from the Action Group annotations node. - Removing the remaining Action Group "Page" references from the code base. --- .../ActionGroupAnnotationExtractorTest.php | 12 +++-------- .../Util/DocGeneratorTest.php | 4 ---- .../unit/Resources/alteredDocumentation.txt | 8 +------ .../unit/Resources/basicDocumentation.txt | 8 +------ .../Util/DocGenerator.php | 21 +++++++------------ 5 files changed, 13 insertions(+), 40 deletions(-) diff --git a/dev/tests/unit/Magento/FunctionalTestFramework/Test/Util/ActionGroupAnnotationExtractorTest.php b/dev/tests/unit/Magento/FunctionalTestFramework/Test/Util/ActionGroupAnnotationExtractorTest.php index d56608894..af39298b1 100644 --- a/dev/tests/unit/Magento/FunctionalTestFramework/Test/Util/ActionGroupAnnotationExtractorTest.php +++ b/dev/tests/unit/Magento/FunctionalTestFramework/Test/Util/ActionGroupAnnotationExtractorTest.php @@ -34,10 +34,6 @@ public function testActionGroupExtractAnnotations() "description" => [ "nodeName" => "description", "value" => "someDescription" - ], - "page" => [ - "nodeName" => "page", - "value" => "somePage" ] ]; // Perform Test @@ -45,8 +41,6 @@ public function testActionGroupExtractAnnotations() $returnedAnnotations = $extractor->extractAnnotations($actionGroupAnnotations, "fileName"); // Asserts - - $this->assertEquals("somePage", $returnedAnnotations['page']); $this->assertEquals("someDescription", $returnedAnnotations['description']); } @@ -57,7 +51,7 @@ public function testActionGroupExtractAnnotations() */ public function testActionGroupMissingAnnotations() { - // Action Group Data, missing page and description + // Action Group Data, missing description $testAnnotations = []; // Perform Test $extractor = new ActionGroupAnnotationExtractor(); @@ -70,7 +64,7 @@ public function testActionGroupMissingAnnotations() 'DEPRECATION: Action Group File fileName is missing required annotations.', [ 'actionGroup' => 'fileName', - 'missingAnnotations' => "description, page" + 'missingAnnotations' => "description" ] ); } @@ -83,7 +77,7 @@ public function testActionGroupMissingAnnotations() */ public function testActionGroupMissingAnnotationsNoWarning() { - // Action Group Data, missing page and description + // Action Group Data, missing description $testAnnotations = []; // Perform Test $extractor = new ActionGroupAnnotationExtractor(); diff --git a/dev/tests/unit/Magento/FunctionalTestFramework/Util/DocGeneratorTest.php b/dev/tests/unit/Magento/FunctionalTestFramework/Util/DocGeneratorTest.php index ae61f37af..0fb73e53f 100644 --- a/dev/tests/unit/Magento/FunctionalTestFramework/Util/DocGeneratorTest.php +++ b/dev/tests/unit/Magento/FunctionalTestFramework/Util/DocGeneratorTest.php @@ -23,7 +23,6 @@ class DocGeneratorTest extends MagentoTestCase public function testBasicCreateDocumentation() { $annotations = [ - "page" => "somePage", "description" => "someDescription" ]; $actionGroupUnderTest = (new ActionGroupObjectBuilder()) @@ -55,7 +54,6 @@ public function testBasicCreateDocumentation() public function testCreateDocumentationWithOverwrite() { $annotations = [ - "page" => "somePage", "description" => "someDescription" ]; $actionGroupUnderTest = (new ActionGroupObjectBuilder()) @@ -70,7 +68,6 @@ public function testCreateDocumentationWithOverwrite() ); $annotations = [ - "page" => "alteredPage", "description" => "alteredDescription" ]; $actionGroupUnderTest = (new ActionGroupObjectBuilder()) @@ -102,7 +99,6 @@ public function testCreateDocumentationWithOverwrite() public function testCreateDocumentationNotCleanException() { $annotations = [ - "page" => "somePage", "description" => "someDescription" ]; $actionGroupUnderTest = (new ActionGroupObjectBuilder()) diff --git a/dev/tests/unit/Resources/alteredDocumentation.txt b/dev/tests/unit/Resources/alteredDocumentation.txt index b55c30d6b..c9e39cd4e 100644 --- a/dev/tests/unit/Resources/alteredDocumentation.txt +++ b/dev/tests/unit/Resources/alteredDocumentation.txt @@ -1,11 +1,5 @@ #Action Group Information -This documentation contains a list of all action groups on the pages on which they start - -##List of Pages -- [ alteredPage ](#alteredPage) ---- - -##alteredPage +This documentation contains a list of all action groups ###testActionGroupObject alteredDescription diff --git a/dev/tests/unit/Resources/basicDocumentation.txt b/dev/tests/unit/Resources/basicDocumentation.txt index 26a7fe719..1dce4de21 100644 --- a/dev/tests/unit/Resources/basicDocumentation.txt +++ b/dev/tests/unit/Resources/basicDocumentation.txt @@ -1,11 +1,5 @@ #Action Group Information -This documentation contains a list of all action groups on the pages on which they start - -##List of Pages -- [ somePage ](#somePage) ---- - -##somePage +This documentation contains a list of all action groups ###testActionGroupObject someDescription diff --git a/src/Magento/FunctionalTestingFramework/Util/DocGenerator.php b/src/Magento/FunctionalTestingFramework/Util/DocGenerator.php index 9846cded5..2642a715f 100644 --- a/src/Magento/FunctionalTestingFramework/Util/DocGenerator.php +++ b/src/Magento/FunctionalTestingFramework/Util/DocGenerator.php @@ -76,7 +76,8 @@ public function createDocumentation($annotatedObjects, $outputDir, $clean) ?? 'NO_DESCRIPTION_SPECIFIED', self::FILENAMES => $filenames, ActionGroupObjectExtractor::ACTION_GROUP_ARGUMENTS => $arguments - ]; + ]; + $pageGroups = array_merge_recursive( $pageGroups, [$annotations[ActionGroupObject::ACTION_GROUP_PAGE] ?? 'NO_PAGE_SPECIFIED' => [$name => $info]] @@ -103,26 +104,20 @@ public function createDocumentation($annotatedObjects, $outputDir, $clean) private function transformToMarkdown($annotationList) { $markdown = "#Action Group Information" . PHP_EOL; - $markdown .= "This documentation contains a list of all" . - " action groups on the pages on which they start" . + $markdown .= "This documentation contains a list of all Action Groups." . PHP_EOL . PHP_EOL; - $markdown .= "##List of Pages" . PHP_EOL; - foreach ($annotationList as $group => $objects) { - $markdown .= "- [ $group ](#$group)" . PHP_EOL; - } $markdown .= "---" . PHP_EOL; foreach ($annotationList as $group => $objects) { - $markdown .= "" . PHP_EOL; - $markdown .= "##$group" . PHP_EOL . PHP_EOL; foreach ($objects as $name => $annotations) { $markdown .= "###$name" . PHP_EOL; - $markdown .= $annotations[actionGroupObject::ACTION_GROUP_DESCRIPTION] . PHP_EOL . PHP_EOL; + $markdown .= "**Description**:" . PHP_EOL; + $markdown .= "- " . $annotations[actionGroupObject::ACTION_GROUP_DESCRIPTION] . PHP_EOL . PHP_EOL; if (!empty($annotations[ActionGroupObjectExtractor::ACTION_GROUP_ARGUMENTS])) { - $markdown .= "Action Group Arguments:" . PHP_EOL . PHP_EOL; + $markdown .= "**Action Group Arguments**:" . PHP_EOL . PHP_EOL; $markdown .= "| Name | Type |" . PHP_EOL; - $markdown .= "| --- | --- |" . PHP_EOL; + $markdown .= "| ---- | ---- |" . PHP_EOL; foreach ($annotations[ActionGroupObjectExtractor::ACTION_GROUP_ARGUMENTS] as $argument) { $argumentName = $argument->getName(); $argumentType = $argument->getDataType(); @@ -130,7 +125,7 @@ private function transformToMarkdown($annotationList) } $markdown .= PHP_EOL; } - $markdown .= "Located in:" . PHP_EOL; + $markdown .= "**Located In**:" . PHP_EOL; foreach ($annotations[self::FILENAMES] as $filename) { $relativeFilename = str_replace(MAGENTO_BP . DIRECTORY_SEPARATOR, "", $filename); $markdown .= PHP_EOL . "- $relativeFilename"; From d3556aca320c2268e27c9e82b73ab26b1945ff24 Mon Sep 17 00:00:00 2001 From: John S Date: Wed, 5 Jun 2019 10:26:54 -0500 Subject: [PATCH 04/29] MQE-1580: Remove the "page" attribute from the Action Group annotations node. - Correcting the expected Text in the Test. --- dev/tests/unit/Resources/alteredDocumentation.txt | 8 ++++---- dev/tests/unit/Resources/basicDocumentation.txt | 8 ++++---- .../FunctionalTestingFramework/Util/DocGenerator.php | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/dev/tests/unit/Resources/alteredDocumentation.txt b/dev/tests/unit/Resources/alteredDocumentation.txt index c9e39cd4e..bc4bddd17 100644 --- a/dev/tests/unit/Resources/alteredDocumentation.txt +++ b/dev/tests/unit/Resources/alteredDocumentation.txt @@ -1,10 +1,10 @@ #Action Group Information -This documentation contains a list of all action groups +This documentation contains a list of all Action Groups. ###testActionGroupObject -alteredDescription - -Located in: +**Description**: +- alteredDescription +**Located in**: - filename *** diff --git a/dev/tests/unit/Resources/basicDocumentation.txt b/dev/tests/unit/Resources/basicDocumentation.txt index 1dce4de21..129499e22 100644 --- a/dev/tests/unit/Resources/basicDocumentation.txt +++ b/dev/tests/unit/Resources/basicDocumentation.txt @@ -1,10 +1,10 @@ #Action Group Information -This documentation contains a list of all action groups +This documentation contains a list of all Action Groups. ###testActionGroupObject -someDescription - -Located in: +**Description**: +- someDescription +**Located in**: - filename *** diff --git a/src/Magento/FunctionalTestingFramework/Util/DocGenerator.php b/src/Magento/FunctionalTestingFramework/Util/DocGenerator.php index 2642a715f..0eacf46e2 100644 --- a/src/Magento/FunctionalTestingFramework/Util/DocGenerator.php +++ b/src/Magento/FunctionalTestingFramework/Util/DocGenerator.php @@ -128,7 +128,7 @@ private function transformToMarkdown($annotationList) $markdown .= "**Located In**:" . PHP_EOL; foreach ($annotations[self::FILENAMES] as $filename) { $relativeFilename = str_replace(MAGENTO_BP . DIRECTORY_SEPARATOR, "", $filename); - $markdown .= PHP_EOL . "- $relativeFilename"; + $markdown .= "- $relativeFilename"; } $markdown .= PHP_EOL . "***" . PHP_EOL; } From 0d0f789321c20bbe2693811480591dadefe09e13 Mon Sep 17 00:00:00 2001 From: John S Date: Wed, 5 Jun 2019 11:16:17 -0500 Subject: [PATCH 05/29] MQE-1580: Remove the "page" attribute from the Action Group annotations node. - Correcting the expected Text in the Test. --- dev/tests/unit/Resources/alteredDocumentation.txt | 2 +- dev/tests/unit/Resources/basicDocumentation.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dev/tests/unit/Resources/alteredDocumentation.txt b/dev/tests/unit/Resources/alteredDocumentation.txt index bc4bddd17..5e4d70774 100644 --- a/dev/tests/unit/Resources/alteredDocumentation.txt +++ b/dev/tests/unit/Resources/alteredDocumentation.txt @@ -5,6 +5,6 @@ This documentation contains a list of all Action Groups. **Description**: - alteredDescription -**Located in**: +**Located In**: - filename *** diff --git a/dev/tests/unit/Resources/basicDocumentation.txt b/dev/tests/unit/Resources/basicDocumentation.txt index 129499e22..43f1c9521 100644 --- a/dev/tests/unit/Resources/basicDocumentation.txt +++ b/dev/tests/unit/Resources/basicDocumentation.txt @@ -5,6 +5,6 @@ This documentation contains a list of all Action Groups. **Description**: - someDescription -**Located in**: +**Located In**: - filename *** From c5b651bac9a033fc645f002d3bc9d323a2a51ca5 Mon Sep 17 00:00:00 2001 From: Alex Kolesnyk Date: Wed, 5 Jun 2019 14:15:10 -0500 Subject: [PATCH 06/29] MQE-659: [ALLURE] Include the test "stepKey" in the MFTF Allure Report --- etc/config/codeception.dist.yml | 2 + .../Allure/Adapter/MagentoAllureAdapter.php | 31 +++++- .../Codeception/Subscriber/Console.php | 97 +++++++++++++++++++ .../Util/TestGenerator.php | 24 +++-- 4 files changed, 146 insertions(+), 8 deletions(-) create mode 100644 src/Magento/FunctionalTestingFramework/Codeception/Subscriber/Console.php diff --git a/etc/config/codeception.dist.yml b/etc/config/codeception.dist.yml index e6b03fab8..30697dc8f 100755 --- a/etc/config/codeception.dist.yml +++ b/etc/config/codeception.dist.yml @@ -8,10 +8,12 @@ paths: support: src/Magento/FunctionalTestingFramework envs: etc/_envs settings: + silent: true colors: true memory_limit: 1024M extensions: enabled: + - Magento\FunctionalTestingFramework\Codeception\Subscriber\Console - Magento\FunctionalTestingFramework\Extension\TestContextExtension - Magento\FunctionalTestingFramework\Allure\Adapter\MagentoAllureAdapter config: diff --git a/src/Magento/FunctionalTestingFramework/Allure/Adapter/MagentoAllureAdapter.php b/src/Magento/FunctionalTestingFramework/Allure/Adapter/MagentoAllureAdapter.php index 65be8ea84..2784555af 100644 --- a/src/Magento/FunctionalTestingFramework/Allure/Adapter/MagentoAllureAdapter.php +++ b/src/Magento/FunctionalTestingFramework/Allure/Adapter/MagentoAllureAdapter.php @@ -5,8 +5,10 @@ */ namespace Magento\FunctionalTestingFramework\Allure\Adapter; +use Codeception\Step\Comment; use Magento\FunctionalTestingFramework\Suite\Handlers\SuiteObjectHandler; use Magento\FunctionalTestingFramework\Test\Objects\ActionGroupObject; +use \Magento\FunctionalTestingFramework\Util\TestGenerator; use Yandex\Allure\Adapter\Model\Step; use Yandex\Allure\Codeception\AllureCodeception; use Yandex\Allure\Adapter\Event\StepStartedEvent; @@ -31,6 +33,8 @@ class MagentoAllureAdapter extends AllureCodeception { const STEP_PASSED = "passed"; + private $testFiles = []; + /** * Array of group values passed to test runner command * @@ -116,6 +120,11 @@ public function stepBefore(StepEvent $stepEvent) { //Hard set to 200; we don't expose this config in MFTF $argumentsLength = 200; + $stepKey = null; + + if (!($stepEvent->getStep() instanceof Comment)) { + $stepKey = $this->retrieveStepKey($stepEvent->getStep()->getLine()); + } // 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) { @@ -130,7 +139,11 @@ public function stepBefore(StepEvent $stepEvent) $stepArgs = $stepEvent->getStep()->getMetaStep()->getArgumentsAsString($argumentsLength); } - $stepName = $stepAction . ' ' . $stepArgs; + $stepName = ''; + if ($stepKey !== null) { + $stepName .= '[' . $stepKey . '] '; + } + $stepName .= $stepAction . ' ' . $stepArgs; // Strip control characters so that report generation does not fail $stepName = preg_replace('/[[:cntrl:]]/', '', $stepName); @@ -220,4 +233,20 @@ function () use ($rootStep, $formattedSteps) { $this->getLifecycle()->fire(new TestCaseFinishedEvent()); } + + private function retrieveStepKey($stepLine) + { + $stepKey = null; + list($filePath, $stepLine) = explode(":", $stepLine); + $prevStepLine = $stepLine - 2; + + if (!array_key_exists($filePath, $this->testFiles)) { + $this->testFiles[$filePath] = explode(PHP_EOL, file_get_contents($filePath)); + } + $testFile = $this->testFiles[$filePath]; + + list($stepKey) = sscanf($testFile[$prevStepLine], TestGenerator::STEP_KEY_ANNOTATION); + + return $stepKey; + } } diff --git a/src/Magento/FunctionalTestingFramework/Codeception/Subscriber/Console.php b/src/Magento/FunctionalTestingFramework/Codeception/Subscriber/Console.php new file mode 100644 index 000000000..6f4bc4461 --- /dev/null +++ b/src/Magento/FunctionalTestingFramework/Codeception/Subscriber/Console.php @@ -0,0 +1,97 @@ +steps or !$e->getTest() instanceof ScenarioDriven) { + return; + } + $metaStep = $e->getStep()->getMetaStep(); + if ($metaStep and $this->metaStep != $metaStep) { + $this->message(' ' . $metaStep->getPrefix()) + ->style('bold') + ->append($metaStep->__toString()) + ->writeln(); + } + $this->metaStep = $metaStep; + + $this->printStepKeys($e->getStep()); + } + + private function printStepKeys(Step $step) + { + if ($step instanceof Comment and $step->__toString() == '') { + return; // don't print empty comments + } + + $stepKey = $this->retrieveStepKey($step->getLine()); + + $msg = $this->message(' '); + if ($this->metaStep) { + $msg->append(' '); + } + if ($stepKey !== null) { + $msg->append(OutputFormatter::escape("[" . $stepKey . "] ")); + } + + if (!$this->metaStep) { + $msg->style('bold'); + } + + $msg->append(OutputFormatter::escape($step->toString($this->width))); + if ($this->metaStep) { + $msg->style('info'); + } + $msg->writeln(); + } + + /** + * @param $string + * @return Message + */ + private function message($string = '') + { + return $this->messageFactory->message($string); + } + + private function retrieveStepKey($stepLine) + { + $stepKey = null; + list($filePath, $stepLine) = explode(":", $stepLine); + $prevStepLine = $stepLine - 2; + + if (!array_key_exists($filePath, $this->testFiles)) { + $this->testFiles[$filePath] = explode(PHP_EOL, file_get_contents($filePath)); + } + $testFile = $this->testFiles[$filePath]; + + list($stepKey) = sscanf($testFile[$prevStepLine], TestGenerator::STEP_KEY_ANNOTATION); + + return $stepKey; + } +} diff --git a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php index 07cb96b3a..977027c4d 100644 --- a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php +++ b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php @@ -39,6 +39,7 @@ class TestGenerator const SUITE_SCOPE = 'suite'; const PRESSKEY_ARRAY_ANCHOR_KEY = '987654321098765432109876543210'; const PERSISTED_OBJECT_NOTATION_REGEX = '/\${1,2}[\w.\[\]]+\${1,2}/'; + const STEP_KEY_ANNOTATION = "\t\t/** @stepKey %s */"; /** * Path to the export dir. @@ -697,14 +698,19 @@ public function generateStepsPhp($actionObjects, $generationScope = TestGenerato if (isset($customActionAttributes['storeCode'])) { $storeCode = $customActionAttributes['storeCode']; } + + if ($actionObject->getType() !== 'comment') { + $testSteps .= PHP_EOL . sprintf(self::STEP_KEY_ANNOTATION, $stepKey) . PHP_EOL; + } switch ($actionObject->getType()) { case "createData": $entity = $customActionAttributes['entity']; //Add an informative statement to help the user debug test runs $testSteps .= sprintf( - "\t\t$%s->amGoingTo(\"create entity that has the stepKey: %s\");\n", + "\t\t$%s->comment(\"[%s] create '%s' entity\");\n", $actor, - $stepKey + $stepKey, + $entity ); //TODO refactor entity field override to not be individual actionObjects @@ -759,8 +765,9 @@ public function generateStepsPhp($actionObjects, $generationScope = TestGenerato $key .= $actionGroup; //Add an informative statement to help the user debug test runs $contextSetter = sprintf( - "\t\t$%s->amGoingTo(\"delete entity that has the createDataKey: %s\");\n", + "\t\t$%s->comment(\"[%s] delete entity '%s'\");\n", $actor, + $stepKey, $key ); @@ -802,9 +809,11 @@ public function generateStepsPhp($actionObjects, $generationScope = TestGenerato //Add an informative statement to help the user debug test runs $testSteps .= sprintf( - "\t\t$%s->amGoingTo(\"update entity that has the createdDataKey: %s\");\n", + "\t\t$%s->comment(\"[%s] update '%s' entity to '%s'\");\n", $actor, - $key + $stepKey, + $key, + $updateEntity ); // Build array of requiredEntities @@ -848,9 +857,10 @@ public function generateStepsPhp($actionObjects, $generationScope = TestGenerato } //Add an informative statement to help the user debug test runs $testSteps .= sprintf( - "\t\t$%s->amGoingTo(\"get entity that has the stepKey: %s\");\n", + "\t\t$%s->comment(\"[%s] get '%s' entity\");\n", $actor, - $stepKey + $stepKey, + $entity ); // Build array of requiredEntities From eb87ccfaeefdbc6b298a56384daf9095cbc916b4 Mon Sep 17 00:00:00 2001 From: Alex Kolesnyk Date: Wed, 5 Jun 2019 16:06:00 -0500 Subject: [PATCH 07/29] MQE-659: [ALLURE] Include the test "stepKey" in the MFTF Allure Report - test fixes --- .../ActionGroupContainsStepKeyInArgText.txt | 12 +- .../ActionGroupMergedViaInsertAfter.txt | 16 +- .../ActionGroupMergedViaInsertBefore.txt | 16 +- .../Resources/ActionGroupToExtend.txt | 8 +- .../Resources/ActionGroupUsingCreateData.txt | 10 +- .../ActionGroupUsingNestedArgument.txt | 8 +- .../ActionGroupWithDataOverrideTest.txt | 39 ++-- .../Resources/ActionGroupWithDataTest.txt | 39 ++-- ...hDefaultArgumentAndStringSelectorParam.txt | 6 +- ...eParameterSelectorsFromDefaultArgument.txt | 6 +- .../Resources/ActionGroupWithNoArguments.txt | 6 +- .../ActionGroupWithNoDefaultTest.txt | 35 +-- ...roupWithParameterizedElementWithHyphen.txt | 6 +- ...thPassedArgumentAndStringSelectorParam.txt | 6 +- .../ActionGroupWithPersistedData.txt | 38 ++-- ...tionGroupWithSectionAndDataAsArguments.txt | 6 +- ...WithSimpleDataUsageFromDefaultArgument.txt | 6 +- ...pWithSimpleDataUsageFromPassedArgument.txt | 60 ++--- ...leParameterSelectorFromDefaultArgument.txt | 6 +- ...gleParameterSelectorFromPassedArgument.txt | 6 +- .../ActionGroupWithStepKeyReferences.txt | 48 ++-- .../ActionGroupWithTopLevelPersistedData.txt | 35 +-- .../ArgumentWithSameNameAsElement.txt | 29 +-- .../verification/Resources/AssertTest.txt | 212 +++++++++--------- .../Resources/BasicActionGroupTest.txt | 23 +- .../Resources/BasicFunctionalTest.txt | 194 ++++++++-------- .../verification/Resources/BasicMergeTest.txt | 38 ++-- .../Resources/CharacterReplacementTest.txt | 16 +- .../Resources/ChildExtendedTestAddHooks.txt | 6 +- .../Resources/ChildExtendedTestMerging.txt | 10 +- .../ChildExtendedTestRemoveAction.txt | 6 +- .../ChildExtendedTestRemoveHookAction.txt | 4 +- .../Resources/ChildExtendedTestReplace.txt | 6 +- .../ChildExtendedTestReplaceHook.txt | 6 +- .../Resources/DataActionsTest.txt | 24 +- .../Resources/DataReplacementTest.txt | 52 ++--- .../Resources/ExecuteInSeleniumTest.txt | 2 +- .../Resources/ExecuteJsEscapingTest.txt | 10 +- .../Resources/ExtendParentDataTest.txt | 13 +- .../Resources/ExtendedActionGroup.txt | 10 +- .../ExtendedChildTestInSuiteCest.txt | 6 +- .../Resources/ExtendedChildTestNotInSuite.txt | 6 +- .../Resources/ExtendedRemoveActionGroup.txt | 4 +- .../Resources/ExtendingSkippedTest.txt | 6 +- .../Resources/HookActionsTest.txt | 17 +- .../Resources/LocatorFunctionTest.txt | 27 +-- .../Resources/MergeMassViaInsertAfter.txt | 12 +- .../Resources/MergeMassViaInsertBefore.txt | 12 +- .../Resources/MergedActionGroupTest.txt | 33 +-- .../Resources/MergedReferencesTest.txt | 10 +- .../Resources/MultipleActionGroupsTest.txt | 53 ++--- .../Resources/PageReplacementTest.txt | 25 ++- .../Resources/ParameterArrayTest.txt | 47 ++-- .../Resources/ParentExtendedTest.txt | 6 +- .../PersistedAndXmlEntityArguments.txt | 6 +- .../Resources/PersistedReplacementTest.txt | 26 ++- .../PersistenceActionGroupAppendingTest.txt | 32 ++- .../Resources/PersistenceCustomFieldsTest.txt | 35 ++- .../Resources/SectionReplacementTest.txt | 73 +++--- .../Resources/functionalSuiteHooks.txt | 8 +- .../Allure/Adapter/MagentoAllureAdapter.php | 21 +- .../Codeception/Subscriber/Console.php | 41 +++- .../Handlers/ActionGroupObjectHandler.php | 4 +- .../Test/Objects/ActionGroupObject.php | 4 +- .../Util/TestGenerator.php | 18 +- 65 files changed, 864 insertions(+), 747 deletions(-) diff --git a/dev/tests/verification/Resources/ActionGroupContainsStepKeyInArgText.txt b/dev/tests/verification/Resources/ActionGroupContainsStepKeyInArgText.txt index a9d6c3d27..c98120d03 100644 --- a/dev/tests/verification/Resources/ActionGroupContainsStepKeyInArgText.txt +++ b/dev/tests/verification/Resources/ActionGroupContainsStepKeyInArgText.txt @@ -24,9 +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)"); + $I->comment("Entering Action Group [actionGroup] actionGroupContainsStepKeyInArgValue"); + $I->see("arg1", ".selector"); // stepKey: arg1ActionGroup + $I->comment("Exiting Action Group [actionGroup] actionGroupContainsStepKeyInArgValue"); } /** @@ -38,8 +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)"); + $I->comment("Entering Action Group [actionGroup] actionGroupContainsStepKeyInArgValue"); + $I->see("arg1", ".selector"); // stepKey: arg1ActionGroup + $I->comment("Exiting Action Group [actionGroup] actionGroupContainsStepKeyInArgValue"); } } diff --git a/dev/tests/verification/Resources/ActionGroupMergedViaInsertAfter.txt b/dev/tests/verification/Resources/ActionGroupMergedViaInsertAfter.txt index 1573c0d43..c607cb7b2 100644 --- a/dev/tests/verification/Resources/ActionGroupMergedViaInsertAfter.txt +++ b/dev/tests/verification/Resources/ActionGroupMergedViaInsertAfter.txt @@ -27,13 +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)"); + $I->comment("Entering Action Group [keyone] FunctionalActionGroupForMassMergeAfter"); + $I->fillField("#foo", "foo"); // stepKey: fillField1Keyone + $I->fillField("#bar", "bar"); // stepKey: fillField2Keyone + $I->click("#foo2"); // stepKey: mergeAfterBarKeyone + $I->click("#bar2"); // stepKey: mergeAfterFoo2Keyone + $I->click("#baz2"); // stepKey: mergeAfterBar2Keyone + $I->fillField("#baz", "baz"); // stepKey: fillField3Keyone + $I->comment("Exiting Action Group [keyone] FunctionalActionGroupForMassMergeAfter"); } } diff --git a/dev/tests/verification/Resources/ActionGroupMergedViaInsertBefore.txt b/dev/tests/verification/Resources/ActionGroupMergedViaInsertBefore.txt index 5dda9af14..08281a965 100644 --- a/dev/tests/verification/Resources/ActionGroupMergedViaInsertBefore.txt +++ b/dev/tests/verification/Resources/ActionGroupMergedViaInsertBefore.txt @@ -27,13 +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)"); + $I->comment("Entering Action Group [keyone] FunctionalActionGroupForMassMergeBefore"); + $I->fillField("#foo", "foo"); // stepKey: fillField1Keyone + $I->click("#foo2"); // stepKey: mergeBeforeBarKeyone + $I->click("#bar2"); // stepKey: mergeAfterFoo2Keyone + $I->click("#baz2"); // stepKey: mergeAfterBar2Keyone + $I->fillField("#bar", "bar"); // stepKey: fillField2Keyone + $I->fillField("#baz", "baz"); // stepKey: fillField3Keyone + $I->comment("Exiting Action Group [keyone] FunctionalActionGroupForMassMergeBefore"); } } diff --git a/dev/tests/verification/Resources/ActionGroupToExtend.txt b/dev/tests/verification/Resources/ActionGroupToExtend.txt index 40fdedeb9..b91c06036 100644 --- a/dev/tests/verification/Resources/ActionGroupToExtend.txt +++ b/dev/tests/verification/Resources/ActionGroupToExtend.txt @@ -27,9 +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)"); + $I->comment("Entering Action Group [actionGroup] ActionGroupToExtend"); + $grabProductsActionGroup = $I->grabMultiple("selector"); // stepKey: grabProductsActionGroup + $I->assertCount(99, $grabProductsActionGroup); // stepKey: assertCountActionGroup + $I->comment("Exiting Action Group [actionGroup] ActionGroupToExtend"); } } diff --git a/dev/tests/verification/Resources/ActionGroupUsingCreateData.txt b/dev/tests/verification/Resources/ActionGroupUsingCreateData.txt index f011d307a..6831b0914 100644 --- a/dev/tests/verification/Resources/ActionGroupUsingCreateData.txt +++ b/dev/tests/verification/Resources/ActionGroupUsingCreateData.txt @@ -24,8 +24,8 @@ class ActionGroupUsingCreateDataCest */ public function _before(AcceptanceTester $I) { - $I->comment("Entering Action Group actionGroupWithCreateData (Key1)"); - $I->amGoingTo("create entity that has the stepKey: createCategoryKey1"); + $I->comment("Entering Action Group [Key1] actionGroupWithCreateData"); + $I->comment("[createCategoryKey1] create 'ApiCategory' entity"); PersistedObjectHandler::getInstance()->createEntity( "createCategoryKey1", "hook", @@ -33,7 +33,8 @@ class ActionGroupUsingCreateDataCest [], null ); - $I->amGoingTo("create entity that has the stepKey: createConfigProductKey1"); + + $I->comment("[createConfigProductKey1] create 'ApiConfigurableProduct' entity"); PersistedObjectHandler::getInstance()->createEntity( "createConfigProductKey1", "hook", @@ -41,7 +42,8 @@ class ActionGroupUsingCreateDataCest ["createCategoryKey1"], null ); - $I->comment("Exiting Action Group actionGroupWithCreateData (Key1)"); + + $I->comment("Exiting Action Group [Key1] actionGroupWithCreateData"); } /** diff --git a/dev/tests/verification/Resources/ActionGroupUsingNestedArgument.txt b/dev/tests/verification/Resources/ActionGroupUsingNestedArgument.txt index 8d6bf7a3a..13b67b10f 100644 --- a/dev/tests/verification/Resources/ActionGroupUsingNestedArgument.txt +++ b/dev/tests/verification/Resources/ActionGroupUsingNestedArgument.txt @@ -27,9 +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)"); + $I->comment("Entering Action Group [actionGroup] ActionGroupToExtend"); + $grabProductsActionGroup = $I->grabMultiple("selector"); // stepKey: grabProductsActionGroup + $I->assertCount(99, $grabProductsActionGroup); // stepKey: assertCountActionGroup + $I->comment("Exiting Action Group [actionGroup] ActionGroupToExtend"); } } diff --git a/dev/tests/verification/Resources/ActionGroupWithDataOverrideTest.txt b/dev/tests/verification/Resources/ActionGroupWithDataOverrideTest.txt index a584c0f50..3785b4dd6 100644 --- a/dev/tests/verification/Resources/ActionGroupWithDataOverrideTest.txt +++ b/dev/tests/verification/Resources/ActionGroupWithDataOverrideTest.txt @@ -25,7 +25,7 @@ class ActionGroupWithDataOverrideTestCest */ public function _before(AcceptanceTester $I) { - $I->amGoingTo("create entity that has the stepKey: createPersonParam"); + $I->comment("[createPersonParam] create 'ReplacementPerson' entity"); PersistedObjectHandler::getInstance()->createEntity( "createPersonParam", "hook", @@ -33,10 +33,11 @@ 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)"); + + $I->comment("Entering Action Group [beforeGroup] FunctionalActionGroup"); + $I->fillField("#foo", "myData1"); // stepKey: fillField1BeforeGroup + $I->fillField("#bar", "myData2"); // stepKey: fillField2BeforeGroup + $I->comment("Exiting Action Group [beforeGroup] FunctionalActionGroup"); } /** @@ -45,10 +46,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)"); + $I->comment("Entering Action Group [afterGroup] FunctionalActionGroup"); + $I->fillField("#foo", "myData1"); // stepKey: fillField1AfterGroup + $I->fillField("#bar", "myData2"); // stepKey: fillField2AfterGroup + $I->comment("Exiting Action Group [afterGroup] FunctionalActionGroup"); } /** @@ -57,7 +58,7 @@ class ActionGroupWithDataOverrideTestCest */ public function _failed(AcceptanceTester $I) { - $I->saveScreenshot(); + $I->saveScreenshot(); // stepKey: saveScreenshot } /** @@ -71,14 +72,14 @@ 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"); + $I->amOnPage("/someUrl"); // stepKey: step1 + $I->comment("Entering Action Group [actionGroupWithDataOverride1] FunctionalActionGroupWithData"); + $I->amOnPage("/John/Doe.html"); // stepKey: amOnPage1ActionGroupWithDataOverride1 + $I->fillField("#foo", "John"); // stepKey: fillField1ActionGroupWithDataOverride1 + $I->fillField("#bar", "Doe"); // stepKey: fillField2ActionGroupWithDataOverride1 + $I->searchAndMultiSelectOption("#foo", ["John", "Doe"]); // stepKey: multi1ActionGroupWithDataOverride1 + $I->see("#element .John"); // stepKey: see1ActionGroupWithDataOverride1 + $I->comment("Exiting Action Group [actionGroupWithDataOverride1] FunctionalActionGroupWithData"); + $I->click("loginButton"); // stepKey: step6 } } diff --git a/dev/tests/verification/Resources/ActionGroupWithDataTest.txt b/dev/tests/verification/Resources/ActionGroupWithDataTest.txt index 29d822831..3e812cdd0 100644 --- a/dev/tests/verification/Resources/ActionGroupWithDataTest.txt +++ b/dev/tests/verification/Resources/ActionGroupWithDataTest.txt @@ -25,7 +25,7 @@ class ActionGroupWithDataTestCest */ public function _before(AcceptanceTester $I) { - $I->amGoingTo("create entity that has the stepKey: createPersonParam"); + $I->comment("[createPersonParam] create 'ReplacementPerson' entity"); PersistedObjectHandler::getInstance()->createEntity( "createPersonParam", "hook", @@ -33,10 +33,11 @@ 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)"); + + $I->comment("Entering Action Group [beforeGroup] FunctionalActionGroup"); + $I->fillField("#foo", "myData1"); // stepKey: fillField1BeforeGroup + $I->fillField("#bar", "myData2"); // stepKey: fillField2BeforeGroup + $I->comment("Exiting Action Group [beforeGroup] FunctionalActionGroup"); } /** @@ -45,10 +46,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)"); + $I->comment("Entering Action Group [afterGroup] FunctionalActionGroup"); + $I->fillField("#foo", "myData1"); // stepKey: fillField1AfterGroup + $I->fillField("#bar", "myData2"); // stepKey: fillField2AfterGroup + $I->comment("Exiting Action Group [afterGroup] FunctionalActionGroup"); } /** @@ -57,7 +58,7 @@ class ActionGroupWithDataTestCest */ public function _failed(AcceptanceTester $I) { - $I->saveScreenshot(); + $I->saveScreenshot(); // stepKey: saveScreenshot } /** @@ -71,14 +72,14 @@ 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"); + $I->amOnPage("/someUrl"); // stepKey: step1 + $I->comment("Entering Action Group [actionGroupWithData1] FunctionalActionGroupWithData"); + $I->amOnPage("/Jane/Dane.html"); // stepKey: amOnPage1ActionGroupWithData1 + $I->fillField("#foo", "Jane"); // stepKey: fillField1ActionGroupWithData1 + $I->fillField("#bar", "Dane"); // stepKey: fillField2ActionGroupWithData1 + $I->searchAndMultiSelectOption("#foo", ["Jane", "Dane"]); // stepKey: multi1ActionGroupWithData1 + $I->see("#element .Jane"); // stepKey: see1ActionGroupWithData1 + $I->comment("Exiting Action Group [actionGroupWithData1] FunctionalActionGroupWithData"); + $I->click("loginButton"); // stepKey: step6 } } diff --git a/dev/tests/verification/Resources/ActionGroupWithDefaultArgumentAndStringSelectorParam.txt b/dev/tests/verification/Resources/ActionGroupWithDefaultArgumentAndStringSelectorParam.txt index a66759a89..68f95298d 100644 --- a/dev/tests/verification/Resources/ActionGroupWithDefaultArgumentAndStringSelectorParam.txt +++ b/dev/tests/verification/Resources/ActionGroupWithDefaultArgumentAndStringSelectorParam.txt @@ -29,8 +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)"); + $I->comment("Entering Action Group [actionGroup] actionGroupWithDefaultArgumentAndStringSelectorParam"); + $I->see("John", "#element .test1"); // stepKey: seeFirstNameActionGroup + $I->comment("Exiting Action Group [actionGroup] actionGroupWithDefaultArgumentAndStringSelectorParam"); } } diff --git a/dev/tests/verification/Resources/ActionGroupWithMultipleParameterSelectorsFromDefaultArgument.txt b/dev/tests/verification/Resources/ActionGroupWithMultipleParameterSelectorsFromDefaultArgument.txt index e726a178f..1c211ce4e 100644 --- a/dev/tests/verification/Resources/ActionGroupWithMultipleParameterSelectorsFromDefaultArgument.txt +++ b/dev/tests/verification/Resources/ActionGroupWithMultipleParameterSelectorsFromDefaultArgument.txt @@ -29,8 +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)"); + $I->comment("Entering Action Group [actionGroup] actionGroupWithMultipleParameterSelectorsFromArgument"); + $I->see("Doe", "#John-Doe .test"); // stepKey: seeLastNameActionGroup + $I->comment("Exiting Action Group [actionGroup] actionGroupWithMultipleParameterSelectorsFromArgument"); } } diff --git a/dev/tests/verification/Resources/ActionGroupWithNoArguments.txt b/dev/tests/verification/Resources/ActionGroupWithNoArguments.txt index 751206193..11da2ddf6 100644 --- a/dev/tests/verification/Resources/ActionGroupWithNoArguments.txt +++ b/dev/tests/verification/Resources/ActionGroupWithNoArguments.txt @@ -29,8 +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)"); + $I->comment("Entering Action Group [actionGroup] actionGroupWithoutArguments"); + $I->wait(1); // stepKey: waitForNothingActionGroup + $I->comment("Exiting Action Group [actionGroup] actionGroupWithoutArguments"); } } diff --git a/dev/tests/verification/Resources/ActionGroupWithNoDefaultTest.txt b/dev/tests/verification/Resources/ActionGroupWithNoDefaultTest.txt index fd5846c4a..955596301 100644 --- a/dev/tests/verification/Resources/ActionGroupWithNoDefaultTest.txt +++ b/dev/tests/verification/Resources/ActionGroupWithNoDefaultTest.txt @@ -25,7 +25,7 @@ class ActionGroupWithNoDefaultTestCest */ public function _before(AcceptanceTester $I) { - $I->amGoingTo("create entity that has the stepKey: createPersonParam"); + $I->comment("[createPersonParam] create 'ReplacementPerson' entity"); PersistedObjectHandler::getInstance()->createEntity( "createPersonParam", "hook", @@ -33,10 +33,11 @@ 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)"); + + $I->comment("Entering Action Group [beforeGroup] FunctionalActionGroup"); + $I->fillField("#foo", "myData1"); // stepKey: fillField1BeforeGroup + $I->fillField("#bar", "myData2"); // stepKey: fillField2BeforeGroup + $I->comment("Exiting Action Group [beforeGroup] FunctionalActionGroup"); } /** @@ -45,10 +46,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)"); + $I->comment("Entering Action Group [afterGroup] FunctionalActionGroup"); + $I->fillField("#foo", "myData1"); // stepKey: fillField1AfterGroup + $I->fillField("#bar", "myData2"); // stepKey: fillField2AfterGroup + $I->comment("Exiting Action Group [afterGroup] FunctionalActionGroup"); } /** @@ -57,7 +58,7 @@ class ActionGroupWithNoDefaultTestCest */ public function _failed(AcceptanceTester $I) { - $I->saveScreenshot(); + $I->saveScreenshot(); // stepKey: saveScreenshot } /** @@ -71,12 +72,12 @@ 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"); + $I->amOnPage("/someUrl"); // stepKey: step1 + $I->comment("Entering Action Group [actionGroupWithDataOverride1] FunctionalActionGroupNoDefault"); + $I->fillField("#foo", "Jane"); // stepKey: fillField1ActionGroupWithDataOverride1 + $I->fillField("#bar", "Dane"); // stepKey: fillField2ActionGroupWithDataOverride1 + $I->see("#Jane .Dane"); // stepKey: see2ActionGroupWithDataOverride1 + $I->comment("Exiting Action Group [actionGroupWithDataOverride1] FunctionalActionGroupNoDefault"); + $I->click("loginButton"); // stepKey: step6 } } diff --git a/dev/tests/verification/Resources/ActionGroupWithParameterizedElementWithHyphen.txt b/dev/tests/verification/Resources/ActionGroupWithParameterizedElementWithHyphen.txt index 989c5af5e..7d32e2e68 100644 --- a/dev/tests/verification/Resources/ActionGroupWithParameterizedElementWithHyphen.txt +++ b/dev/tests/verification/Resources/ActionGroupWithParameterizedElementWithHyphen.txt @@ -27,8 +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)"); + $I->comment("Entering Action Group [actionGroup] SectionArgumentWithParameterizedSelector"); + $keyoneActionGroup = $I->executeJS("#element .full-width"); // stepKey: keyoneActionGroup + $I->comment("Exiting Action Group [actionGroup] SectionArgumentWithParameterizedSelector"); } } diff --git a/dev/tests/verification/Resources/ActionGroupWithPassedArgumentAndStringSelectorParam.txt b/dev/tests/verification/Resources/ActionGroupWithPassedArgumentAndStringSelectorParam.txt index 7df77e742..6b85f8b47 100644 --- a/dev/tests/verification/Resources/ActionGroupWithPassedArgumentAndStringSelectorParam.txt +++ b/dev/tests/verification/Resources/ActionGroupWithPassedArgumentAndStringSelectorParam.txt @@ -29,8 +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)"); + $I->comment("Entering Action Group [actionGroup] actionGroupWithDefaultArgumentAndStringSelectorParam"); + $I->see("John" . msq("UniquePerson"), "#element .test1"); // stepKey: seeFirstNameActionGroup + $I->comment("Exiting Action Group [actionGroup] actionGroupWithDefaultArgumentAndStringSelectorParam"); } } diff --git a/dev/tests/verification/Resources/ActionGroupWithPersistedData.txt b/dev/tests/verification/Resources/ActionGroupWithPersistedData.txt index 2f58e390c..aba5c5796 100644 --- a/dev/tests/verification/Resources/ActionGroupWithPersistedData.txt +++ b/dev/tests/verification/Resources/ActionGroupWithPersistedData.txt @@ -25,7 +25,7 @@ class ActionGroupWithPersistedDataCest */ public function _before(AcceptanceTester $I) { - $I->amGoingTo("create entity that has the stepKey: createPersonParam"); + $I->comment("[createPersonParam] create 'ReplacementPerson' entity"); PersistedObjectHandler::getInstance()->createEntity( "createPersonParam", "hook", @@ -33,10 +33,11 @@ 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)"); + + $I->comment("Entering Action Group [beforeGroup] FunctionalActionGroup"); + $I->fillField("#foo", "myData1"); // stepKey: fillField1BeforeGroup + $I->fillField("#bar", "myData2"); // stepKey: fillField2BeforeGroup + $I->comment("Exiting Action Group [beforeGroup] FunctionalActionGroup"); } /** @@ -45,10 +46,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)"); + $I->comment("Entering Action Group [afterGroup] FunctionalActionGroup"); + $I->fillField("#foo", "myData1"); // stepKey: fillField1AfterGroup + $I->fillField("#bar", "myData2"); // stepKey: fillField2AfterGroup + $I->comment("Exiting Action Group [afterGroup] FunctionalActionGroup"); } /** @@ -57,7 +58,7 @@ class ActionGroupWithPersistedDataCest */ public function _failed(AcceptanceTester $I) { - $I->saveScreenshot(); + $I->saveScreenshot(); // stepKey: saveScreenshot } /** @@ -71,7 +72,7 @@ class ActionGroupWithPersistedDataCest */ public function ActionGroupWithPersistedData(AcceptanceTester $I) { - $I->amGoingTo("create entity that has the stepKey: createPerson"); + $I->comment("[createPerson] create 'DefaultPerson' entity"); PersistedObjectHandler::getInstance()->createEntity( "createPerson", "test", @@ -79,12 +80,13 @@ 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)"); + + $I->comment("Entering Action Group [actionGroupWithPersistedData1] FunctionalActionGroupWithData"); + $I->amOnPage("/" . PersistedObjectHandler::getInstance()->retrieveEntityField('createPerson', 'firstname', 'test') . "/" . PersistedObjectHandler::getInstance()->retrieveEntityField('createPerson', 'lastname', 'test') . ".html"); // stepKey: amOnPage1ActionGroupWithPersistedData1 + $I->fillField("#foo", PersistedObjectHandler::getInstance()->retrieveEntityField('createPerson', 'firstname', 'test')); // stepKey: fillField1ActionGroupWithPersistedData1 + $I->fillField("#bar", PersistedObjectHandler::getInstance()->retrieveEntityField('createPerson', 'lastname', 'test')); // stepKey: fillField2ActionGroupWithPersistedData1 + $I->searchAndMultiSelectOption("#foo", [PersistedObjectHandler::getInstance()->retrieveEntityField('createPerson', 'firstname', 'test'), PersistedObjectHandler::getInstance()->retrieveEntityField('createPerson', 'lastname', 'test')]); // stepKey: multi1ActionGroupWithPersistedData1 + $I->see("#element ." . PersistedObjectHandler::getInstance()->retrieveEntityField('createPerson', 'firstname', 'test')); // stepKey: see1ActionGroupWithPersistedData1 + $I->comment("Exiting Action Group [actionGroupWithPersistedData1] FunctionalActionGroupWithData"); } } diff --git a/dev/tests/verification/Resources/ActionGroupWithSectionAndDataAsArguments.txt b/dev/tests/verification/Resources/ActionGroupWithSectionAndDataAsArguments.txt index 34c2a0ea1..20a9c5137 100644 --- a/dev/tests/verification/Resources/ActionGroupWithSectionAndDataAsArguments.txt +++ b/dev/tests/verification/Resources/ActionGroupWithSectionAndDataAsArguments.txt @@ -27,8 +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)"); + $I->comment("Entering Action Group [actionGroup] actionGroupWithSectionAndData"); + $I->waitForElementVisible("#element .John", 10); // stepKey: arg1ActionGroup + $I->comment("Exiting Action Group [actionGroup] actionGroupWithSectionAndData"); } } diff --git a/dev/tests/verification/Resources/ActionGroupWithSimpleDataUsageFromDefaultArgument.txt b/dev/tests/verification/Resources/ActionGroupWithSimpleDataUsageFromDefaultArgument.txt index f4840d88a..52cdeb83d 100644 --- a/dev/tests/verification/Resources/ActionGroupWithSimpleDataUsageFromDefaultArgument.txt +++ b/dev/tests/verification/Resources/ActionGroupWithSimpleDataUsageFromDefaultArgument.txt @@ -29,8 +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)"); + $I->comment("Entering Action Group [actionGroup] actionGroupWithStringUsage"); + $I->see("stringLiteral", "#element .stringLiteral"); // stepKey: see1ActionGroup + $I->comment("Exiting Action Group [actionGroup] actionGroupWithStringUsage"); } } diff --git a/dev/tests/verification/Resources/ActionGroupWithSimpleDataUsageFromPassedArgument.txt b/dev/tests/verification/Resources/ActionGroupWithSimpleDataUsageFromPassedArgument.txt index 4f67da1aa..9ad3dd560 100644 --- a/dev/tests/verification/Resources/ActionGroupWithSimpleDataUsageFromPassedArgument.txt +++ b/dev/tests/verification/Resources/ActionGroupWithSimpleDataUsageFromPassedArgument.txt @@ -29,35 +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)"); + $I->comment("Entering Action Group [actionGroup1] actionGroupWithStringUsage"); + $I->see("overrideString", "#element .overrideString"); // stepKey: see1ActionGroup1 + $I->comment("Exiting Action Group [actionGroup1] actionGroupWithStringUsage"); + $I->comment("Entering Action Group [actionGroup11] actionGroupWithStringUsage"); + $I->see("1", "#element .1"); // stepKey: see1ActionGroup11 + $I->comment("Exiting Action Group [actionGroup11] actionGroupWithStringUsage"); + $I->comment("Entering Action Group [actionGroup12] actionGroupWithStringUsage"); + $I->see("1.5", "#element .1.5"); // stepKey: see1ActionGroup12 + $I->comment("Exiting Action Group [actionGroup12] actionGroupWithStringUsage"); + $I->comment("Entering Action Group [actionGroup13] actionGroupWithStringUsage"); + $I->see("true", "#element .true"); // stepKey: see1ActionGroup13 + $I->comment("Exiting Action Group [actionGroup13] actionGroupWithStringUsage"); + $I->comment("Entering Action Group [actionGroup2] actionGroupWithStringUsage"); + $I->see("simpleData.firstname", "#element .simpleData.firstname"); // stepKey: see1ActionGroup2 + $I->comment("Exiting Action Group [actionGroup2] actionGroupWithStringUsage"); + $I->comment("Entering Action Group [actionGroup3] actionGroupWithStringUsage"); + $I->see(PersistedObjectHandler::getInstance()->retrieveEntityField('persisted', 'data', 'test'), "#element ." . PersistedObjectHandler::getInstance()->retrieveEntityField('persisted', 'data', 'test')); // stepKey: see1ActionGroup3 + $I->comment("Exiting Action Group [actionGroup3] actionGroupWithStringUsage"); + $I->comment("Entering Action Group [actionGroup4] actionGroupWithEntityUsage"); + $I->see("John", "#element .John"); // stepKey: see1ActionGroup4 + $I->comment("Exiting Action Group [actionGroup4] actionGroupWithEntityUsage"); + $I->comment("Entering Action Group [actionGroup5] actionGroupWithEntityUsage"); + $I->see(PersistedObjectHandler::getInstance()->retrieveEntityField('simpleData', 'firstname', 'test'), "#element ." . PersistedObjectHandler::getInstance()->retrieveEntityField('simpleData', 'firstname', 'test')); // stepKey: see1ActionGroup5 + $I->comment("Exiting Action Group [actionGroup5] actionGroupWithEntityUsage"); + $I->comment("Entering Action Group [actionGroup6] actionGroupWithEntityUsage"); + $I->see(PersistedObjectHandler::getInstance()->retrieveEntityField('simpleData', 'firstname[0]', 'test'), "#element ." . PersistedObjectHandler::getInstance()->retrieveEntityField('simpleData', 'firstname[0]', 'test')); // stepKey: see1ActionGroup6 + $I->comment("Exiting Action Group [actionGroup6] actionGroupWithEntityUsage"); + $I->comment("Entering Action Group [actionGroup7] actionGroupWithEntityUsage"); + $I->see(PersistedObjectHandler::getInstance()->retrieveEntityField('simpleData', 'firstname[data_index]', 'test'), "#element ." . PersistedObjectHandler::getInstance()->retrieveEntityField('simpleData', 'firstname[data_index]', 'test')); // stepKey: see1ActionGroup7 + $I->comment("Exiting Action Group [actionGroup7] actionGroupWithEntityUsage"); } } diff --git a/dev/tests/verification/Resources/ActionGroupWithSingleParameterSelectorFromDefaultArgument.txt b/dev/tests/verification/Resources/ActionGroupWithSingleParameterSelectorFromDefaultArgument.txt index 89979bf97..48fc52ff4 100644 --- a/dev/tests/verification/Resources/ActionGroupWithSingleParameterSelectorFromDefaultArgument.txt +++ b/dev/tests/verification/Resources/ActionGroupWithSingleParameterSelectorFromDefaultArgument.txt @@ -29,8 +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)"); + $I->comment("Entering Action Group [actionGroup] actionGroupWithSingleParameterSelectorFromArgument"); + $I->see("Doe", "#element .John"); // stepKey: seeLastNameActionGroup + $I->comment("Exiting Action Group [actionGroup] actionGroupWithSingleParameterSelectorFromArgument"); } } diff --git a/dev/tests/verification/Resources/ActionGroupWithSingleParameterSelectorFromPassedArgument.txt b/dev/tests/verification/Resources/ActionGroupWithSingleParameterSelectorFromPassedArgument.txt index b4707ff0c..97c8bca5b 100644 --- a/dev/tests/verification/Resources/ActionGroupWithSingleParameterSelectorFromPassedArgument.txt +++ b/dev/tests/verification/Resources/ActionGroupWithSingleParameterSelectorFromPassedArgument.txt @@ -29,8 +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)"); + $I->comment("Entering Action Group [actionGroup] actionGroupWithSingleParameterSelectorFromArgument"); + $I->see("Doe", "#element .John" . msq("UniquePerson")); // stepKey: seeLastNameActionGroup + $I->comment("Exiting Action Group [actionGroup] actionGroupWithSingleParameterSelectorFromArgument"); } } diff --git a/dev/tests/verification/Resources/ActionGroupWithStepKeyReferences.txt b/dev/tests/verification/Resources/ActionGroupWithStepKeyReferences.txt index 92b54622c..2f23215c2 100644 --- a/dev/tests/verification/Resources/ActionGroupWithStepKeyReferences.txt +++ b/dev/tests/verification/Resources/ActionGroupWithStepKeyReferences.txt @@ -27,8 +27,8 @@ class ActionGroupWithStepKeyReferencesCest */ public function ActionGroupWithStepKeyReferences(AcceptanceTester $I) { - $I->comment("Entering Action Group FunctionActionGroupWithStepKeyReferences (actionGroup)"); - $I->amGoingTo("create entity that has the stepKey: createSimpleDataActionGroup"); + $I->comment("Entering Action Group [actionGroup] FunctionActionGroupWithStepKeyReferences"); + $I->comment("[createSimpleDataActionGroup] create 'simpleData' entity"); PersistedObjectHandler::getInstance()->createEntity( "createSimpleDataActionGroup", "test", @@ -36,26 +36,29 @@ class ActionGroupWithStepKeyReferencesCest [], null ); - $grabTextDataActionGroup = $I->grabTextFrom(".class"); - $I->fillField(".{$grabTextDataActionGroup}", PersistedObjectHandler::getInstance()->retrieveEntityField('createSimpleDataActionGroup', 'field', 'test')); + + $grabTextDataActionGroup = $I->grabTextFrom(".class"); // stepKey: grabTextDataActionGroup + $I->fillField(".{$grabTextDataActionGroup}", PersistedObjectHandler::getInstance()->retrieveEntityField('createSimpleDataActionGroup', 'field', 'test')); // stepKey: fill1ActionGroup $I->comment("Invocation stepKey will not be appended in non stepKey instances"); - $I->click($action0); - $I->fillField($action1); + $I->click($action0); // stepKey: action0ActionGroup + $I->fillField($action1); // stepKey: action1ActionGroup $I->comment("Invocation stepKey will be appended in non stepKey instances"); - $action3ActionGroup = $I->executeJS($action3ActionGroup); - $action4ActionGroup = $I->magentoCLI($action4ActionGroup, "\"stuffHere\""); - $I->comment($action4ActionGroup); + $action3ActionGroup = $I->executeJS($action3ActionGroup); // stepKey: action3ActionGroup + $action4ActionGroup = $I->magentoCLI($action4ActionGroup, "\"stuffHere\""); $I->comment($action4ActionGroup); + // stepKey: action4ActionGroup $date = new \DateTime(); $date->setTimestamp(strtotime("{$action5}")); $date->setTimezone(new \DateTimeZone("America/Los_Angeles")); $action5ActionGroup = $date->format("H:i:s"); - $action6ActionGroup = $I->formatMoney($action6ActionGroup); - $I->amGoingTo("delete entity that has the createDataKey: {$action7ActionGroupActionGroup}"); + // stepKey: action5ActionGroup + $action6ActionGroup = $I->formatMoney($action6ActionGroup); // stepKey: action6ActionGroup + $I->comment("[action7ActionGroup] delete entity '{$action7ActionGroupActionGroup}'"); PersistedObjectHandler::getInstance()->deleteEntity( "{$action7ActionGroupActionGroup}", "test" ); - $I->amGoingTo("get entity that has the stepKey: action8ActionGroup"); + + $I->comment("[action8ActionGroup] get '{$action8}' entity"); PersistedObjectHandler::getInstance()->getEntity( "action8ActionGroup", "test", @@ -63,14 +66,16 @@ class ActionGroupWithStepKeyReferencesCest [], null ); - $I->amGoingTo("update entity that has the createdDataKey: 1"); + + $I->comment("[action9ActionGroup] update '1' entity to '{$action9}'"); PersistedObjectHandler::getInstance()->updateEntity( "1", "test", "{$action9}", [] ); - $I->amGoingTo("create entity that has the stepKey: action10ActionGroup"); + + $I->comment("[action10ActionGroup] create '{$action10}' entity"); PersistedObjectHandler::getInstance()->createEntity( "action10ActionGroup", "test", @@ -78,12 +83,13 @@ class ActionGroupWithStepKeyReferencesCest [], null ); - $action11ActionGroup = $I->grabAttributeFrom($action11ActionGroup, "someInput"); - $action12ActionGroup = $I->grabCookie($action12ActionGroup, ['domain' => 'www.google.com']); - $action13ActionGroup = $I->grabFromCurrentUrl($action13ActionGroup); - $action14ActionGroup = $I->grabMultiple($action14ActionGroup); - $action15ActionGroup = $I->grabTextFrom($action15ActionGroup); - $action16ActionGroup = $I->grabValueFrom($action16ActionGroup); - $I->comment("Exiting Action Group FunctionActionGroupWithStepKeyReferences (actionGroup)"); + + $action11ActionGroup = $I->grabAttributeFrom($action11ActionGroup, "someInput"); // stepKey: action11ActionGroup + $action12ActionGroup = $I->grabCookie($action12ActionGroup, ['domain' => 'www.google.com']); // stepKey: action12ActionGroup + $action13ActionGroup = $I->grabFromCurrentUrl($action13ActionGroup); // stepKey: action13ActionGroup + $action14ActionGroup = $I->grabMultiple($action14ActionGroup); // stepKey: action14ActionGroup + $action15ActionGroup = $I->grabTextFrom($action15ActionGroup); // stepKey: action15ActionGroup + $action16ActionGroup = $I->grabValueFrom($action16ActionGroup); // stepKey: action16ActionGroup + $I->comment("Exiting Action Group [actionGroup] FunctionActionGroupWithStepKeyReferences"); } } diff --git a/dev/tests/verification/Resources/ActionGroupWithTopLevelPersistedData.txt b/dev/tests/verification/Resources/ActionGroupWithTopLevelPersistedData.txt index 463e5b307..fffaebbfd 100644 --- a/dev/tests/verification/Resources/ActionGroupWithTopLevelPersistedData.txt +++ b/dev/tests/verification/Resources/ActionGroupWithTopLevelPersistedData.txt @@ -25,7 +25,7 @@ class ActionGroupWithTopLevelPersistedDataCest */ public function _before(AcceptanceTester $I) { - $I->amGoingTo("create entity that has the stepKey: createPersonParam"); + $I->comment("[createPersonParam] create 'ReplacementPerson' entity"); PersistedObjectHandler::getInstance()->createEntity( "createPersonParam", "hook", @@ -33,10 +33,11 @@ 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)"); + + $I->comment("Entering Action Group [beforeGroup] FunctionalActionGroup"); + $I->fillField("#foo", "myData1"); // stepKey: fillField1BeforeGroup + $I->fillField("#bar", "myData2"); // stepKey: fillField2BeforeGroup + $I->comment("Exiting Action Group [beforeGroup] FunctionalActionGroup"); } /** @@ -45,10 +46,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)"); + $I->comment("Entering Action Group [afterGroup] FunctionalActionGroup"); + $I->fillField("#foo", "myData1"); // stepKey: fillField1AfterGroup + $I->fillField("#bar", "myData2"); // stepKey: fillField2AfterGroup + $I->comment("Exiting Action Group [afterGroup] FunctionalActionGroup"); } /** @@ -57,7 +58,7 @@ class ActionGroupWithTopLevelPersistedDataCest */ public function _failed(AcceptanceTester $I) { - $I->saveScreenshot(); + $I->saveScreenshot(); // stepKey: saveScreenshot } /** @@ -71,12 +72,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)"); + $I->comment("Entering Action Group [actionGroupWithPersistedData1] FunctionalActionGroupWithData"); + $I->amOnPage("/" . PersistedObjectHandler::getInstance()->retrieveEntityField('createPersonParam', 'firstname', 'test') . "/" . PersistedObjectHandler::getInstance()->retrieveEntityField('createPersonParam', 'lastname', 'test') . ".html"); // stepKey: amOnPage1ActionGroupWithPersistedData1 + $I->fillField("#foo", PersistedObjectHandler::getInstance()->retrieveEntityField('createPersonParam', 'firstname', 'test')); // stepKey: fillField1ActionGroupWithPersistedData1 + $I->fillField("#bar", PersistedObjectHandler::getInstance()->retrieveEntityField('createPersonParam', 'lastname', 'test')); // stepKey: fillField2ActionGroupWithPersistedData1 + $I->searchAndMultiSelectOption("#foo", [PersistedObjectHandler::getInstance()->retrieveEntityField('createPersonParam', 'firstname', 'test'), PersistedObjectHandler::getInstance()->retrieveEntityField('createPersonParam', 'lastname', 'test')]); // stepKey: multi1ActionGroupWithPersistedData1 + $I->see("#element ." . PersistedObjectHandler::getInstance()->retrieveEntityField('createPersonParam', 'firstname', 'test')); // stepKey: see1ActionGroupWithPersistedData1 + $I->comment("Exiting Action Group [actionGroupWithPersistedData1] FunctionalActionGroupWithData"); } } diff --git a/dev/tests/verification/Resources/ArgumentWithSameNameAsElement.txt b/dev/tests/verification/Resources/ArgumentWithSameNameAsElement.txt index d1621fd73..4ccc2d169 100644 --- a/dev/tests/verification/Resources/ArgumentWithSameNameAsElement.txt +++ b/dev/tests/verification/Resources/ArgumentWithSameNameAsElement.txt @@ -25,7 +25,7 @@ class ArgumentWithSameNameAsElementCest */ public function _before(AcceptanceTester $I) { - $I->amGoingTo("create entity that has the stepKey: createPersonParam"); + $I->comment("[createPersonParam] create 'ReplacementPerson' entity"); PersistedObjectHandler::getInstance()->createEntity( "createPersonParam", "hook", @@ -33,10 +33,11 @@ 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)"); + + $I->comment("Entering Action Group [beforeGroup] FunctionalActionGroup"); + $I->fillField("#foo", "myData1"); // stepKey: fillField1BeforeGroup + $I->fillField("#bar", "myData2"); // stepKey: fillField2BeforeGroup + $I->comment("Exiting Action Group [beforeGroup] FunctionalActionGroup"); } /** @@ -45,10 +46,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)"); + $I->comment("Entering Action Group [afterGroup] FunctionalActionGroup"); + $I->fillField("#foo", "myData1"); // stepKey: fillField1AfterGroup + $I->fillField("#bar", "myData2"); // stepKey: fillField2AfterGroup + $I->comment("Exiting Action Group [afterGroup] FunctionalActionGroup"); } /** @@ -57,7 +58,7 @@ class ArgumentWithSameNameAsElementCest */ public function _failed(AcceptanceTester $I) { - $I->saveScreenshot(); + $I->saveScreenshot(); // stepKey: saveScreenshot } /** @@ -71,9 +72,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)"); + $I->comment("Entering Action Group [actionGroup1] FunctionalActionGroupWithTrickyArgument"); + $I->seeElement("#element"); // stepKey: see1ActionGroup1 + $I->seeElement("#element .John"); // stepKey: see2ActionGroup1 + $I->comment("Exiting Action Group [actionGroup1] FunctionalActionGroupWithTrickyArgument"); } } diff --git a/dev/tests/verification/Resources/AssertTest.txt b/dev/tests/verification/Resources/AssertTest.txt index adc764975..15388667a 100644 --- a/dev/tests/verification/Resources/AssertTest.txt +++ b/dev/tests/verification/Resources/AssertTest.txt @@ -24,7 +24,7 @@ class AssertTestCest */ public function _before(AcceptanceTester $I) { - $I->amGoingTo("create entity that has the stepKey: createData1"); + $I->comment("[createData1] create 'ReplacementPerson' entity"); PersistedObjectHandler::getInstance()->createEntity( "createData1", "hook", @@ -32,6 +32,7 @@ class AssertTestCest [], null ); + } /** @@ -43,7 +44,7 @@ class AssertTestCest */ public function AssertTest(AcceptanceTester $I) { - $I->amGoingTo("create entity that has the stepKey: createData2"); + $I->comment("[createData2] create 'UniquePerson' entity"); PersistedObjectHandler::getInstance()->createEntity( "createData2", "test", @@ -51,112 +52,113 @@ class AssertTestCest [], null ); - $grabTextFrom1 = $I->grabTextFrom(".copyright>span"); - $I->assertArrayIsSorted(["1", "2", "3", "4", "5"], "asc"); + + $grabTextFrom1 = $I->grabTextFrom(".copyright>span"); // stepKey: grabTextFrom1 + $I->assertArrayIsSorted(["1", "2", "3", "4", "5"], "asc"); // stepKey: assertSorted1 $I->comment("asserts without variable replacement"); - $I->assertArrayHasKey("apple", ['orange' => 2, 'apple' => 1], "pass"); - $I->assertArrayNotHasKey("kiwi", ['orange' => 2, 'apple' => 1], "pass"); - $I->assertArraySubset([1, 2], [1, 2, 3, 5], "pass"); - $I->assertContains("ab", ['item1' => 'a', 'item2' => 'ab'], "pass"); - $I->assertCount(2, ['a', 'b'], "pass"); - $I->assertEmpty([], "pass"); - $I->assertEquals($text, "Copyright © 2013-2017 Magento, Inc. All rights reserved.", "pass"); - $I->assertEquals("Copyright © 2013-2017 Magento, Inc. All rights reserved.", $text, "pass"); - $I->assertFalse(false, "pass"); - $I->assertFileNotExists("/out.txt", "pass"); - $I->assertFileNotExists($text, "pass"); - $I->assertGreaterOrEquals(2, 5, "pass"); - $I->assertGreaterThan(2, 5, "pass"); - $I->assertGreaterThanOrEqual(2, 5, "pass"); - $I->assertInternalType("string", "xyz", "pass"); - $I->assertInternalType("int", 21, "pass"); - $I->assertInternalType("string", $text, "pass"); - $I->assertLessOrEquals(5, 2, "pass"); - $I->assertLessThan(5, 2, "pass"); - $I->assertLessThanOrEqual(5, 2, "pass"); - $I->assertNotContains("bc", ['item1' => 'a', 'item2' => 'ab'], "pass"); - $I->assertNotContains("bc", $text, "pass"); - $I->assertNotEmpty([1, 2], "pass"); - $I->assertNotEmpty($text, "pass"); - $I->assertNotEquals(2, 5, "pass", 0); - $I->assertNotNull("abc", "pass"); - $I->assertNotNull($text, "pass"); - $I->assertNotRegExp("/foo/", "bar", "pass"); - $I->assertNotSame("log", "tag", "pass"); - $I->assertRegExp("/foo/", "foo", "pass"); - $I->assertSame("bar", "bar", "pass"); - $I->assertStringStartsNotWith("a", "banana", "pass"); - $I->assertStringStartsWith("a", "apple", "pass"); - $I->assertTrue(true, "pass"); + $I->assertArrayHasKey("apple", ['orange' => 2, 'apple' => 1], "pass"); // stepKey: assertArrayHasKey + $I->assertArrayNotHasKey("kiwi", ['orange' => 2, 'apple' => 1], "pass"); // stepKey: assertArrayNotHasKey + $I->assertArraySubset([1, 2], [1, 2, 3, 5], "pass"); // stepKey: assertArraySubset + $I->assertContains("ab", ['item1' => 'a', 'item2' => 'ab'], "pass"); // stepKey: assertContains + $I->assertCount(2, ['a', 'b'], "pass"); // stepKey: assertCount + $I->assertEmpty([], "pass"); // stepKey: assertEmpty + $I->assertEquals($text, "Copyright © 2013-2017 Magento, Inc. All rights reserved.", "pass"); // stepKey: assertEquals1 + $I->assertEquals("Copyright © 2013-2017 Magento, Inc. All rights reserved.", $text, "pass"); // stepKey: assertEquals2 + $I->assertFalse(false, "pass"); // stepKey: assertFalse1 + $I->assertFileNotExists("/out.txt", "pass"); // stepKey: assertFileNotExists1 + $I->assertFileNotExists($text, "pass"); // stepKey: assertFileNotExists2 + $I->assertGreaterOrEquals(2, 5, "pass"); // stepKey: assertGreaterOrEquals + $I->assertGreaterThan(2, 5, "pass"); // stepKey: assertGreaterthan + $I->assertGreaterThanOrEqual(2, 5, "pass"); // stepKey: assertGreaterThanOrEqual + $I->assertInternalType("string", "xyz", "pass"); // stepKey: assertInternalType1 + $I->assertInternalType("int", 21, "pass"); // stepKey: assertInternalType2 + $I->assertInternalType("string", $text, "pass"); // stepKey: assertInternalType3 + $I->assertLessOrEquals(5, 2, "pass"); // stepKey: assertLessOrEquals + $I->assertLessThan(5, 2, "pass"); // stepKey: assertLessThan + $I->assertLessThanOrEqual(5, 2, "pass"); // stepKey: assertLessThanOrEquals + $I->assertNotContains("bc", ['item1' => 'a', 'item2' => 'ab'], "pass"); // stepKey: assertNotContains1 + $I->assertNotContains("bc", $text, "pass"); // stepKey: assertNotContains2 + $I->assertNotEmpty([1, 2], "pass"); // stepKey: assertNotEmpty1 + $I->assertNotEmpty($text, "pass"); // stepKey: assertNotEmpty2 + $I->assertNotEquals(2, 5, "pass", 0); // stepKey: assertNotEquals + $I->assertNotNull("abc", "pass"); // stepKey: assertNotNull1 + $I->assertNotNull($text, "pass"); // stepKey: assertNotNull2 + $I->assertNotRegExp("/foo/", "bar", "pass"); // stepKey: assertNotRegExp + $I->assertNotSame("log", "tag", "pass"); // stepKey: assertNotSame + $I->assertRegExp("/foo/", "foo", "pass"); // stepKey: assertRegExp + $I->assertSame("bar", "bar", "pass"); // stepKey: assertSame + $I->assertStringStartsNotWith("a", "banana", "pass"); // stepKey: assertStringStartsNotWith + $I->assertStringStartsWith("a", "apple", "pass"); // stepKey: assertStringStartsWith + $I->assertTrue(true, "pass"); // stepKey: assertTrue $I->comment("asserts backward compatible"); - $I->assertArrayHasKey("apple", ['orange' => 2, 'apple' => 1], "pass"); - $I->assertArrayNotHasKey("kiwi", ['orange' => 2, 'apple' => 1], "pass"); - $I->assertArraySubset([1, 2], [1, 2, 3, 5], "pass"); - $I->assertContains("ab", ['item1' => 'a', 'item2' => 'ab'], "pass"); - $I->assertCount(2, ['a', 'b'], "pass"); - $I->assertEmpty([], "pass"); - $I->assertEquals($text, "Copyright © 2013-2017 Magento, Inc. All rights reserved.", "pass"); - $I->assertEquals("Copyright © 2013-2017 Magento, Inc. All rights reserved.", $text, "pass"); - $I->assertFalse(false, "pass"); - $I->assertFileNotExists("/out.txt", "pass"); - $I->assertFileNotExists($text, "pass"); - $I->assertGreaterOrEquals(2, 5, "pass"); - $I->assertGreaterThan(2, 5, "pass"); - $I->assertGreaterThanOrEqual(2, 5, "pass"); - $I->assertInternalType("string", "xyz", "pass"); - $I->assertInternalType("int", 21, "pass"); - $I->assertInternalType("string", $text, "pass"); - $I->assertLessOrEquals(5, 2, "pass"); - $I->assertLessThan(5, 2, "pass"); - $I->assertLessThanOrEqual(5, 2, "pass"); - $I->assertNotContains("bc", ['item1' => 'a', 'item2' => 'ab'], "pass"); - $I->assertNotContains("bc", $text, "pass"); - $I->assertNotEmpty([1, 2], "pass"); - $I->assertNotEmpty($text, "pass"); - $I->assertNotEquals(2, 5, "pass", 0); - $I->assertNotNull("abc", "pass"); - $I->assertNotNull($text, "pass"); - $I->assertNotRegExp("/foo/", "bar", "pass"); - $I->assertNotSame("log", "tag", "pass"); - $I->assertRegExp("/foo/", "foo", "pass"); - $I->assertSame("bar", "bar", "pass"); - $I->assertStringStartsNotWith("a", "banana", "pass"); - $I->assertStringStartsWith("a", "apple", "pass"); - $I->assertTrue(true, "pass"); - $I->assertElementContainsAttribute("#username", "class", "admin__control-text"); - $I->assertInstanceOf(User::class, $text, "pass"); - $I->assertNotInstanceOf(User::class, 21, "pass"); - $I->assertFileExists($text, "pass"); - $I->assertIsEmpty($text, "pass"); - $I->assertNull($text, "pass"); - $I->expectException(new MyException('exception msg'), function() {$this->doSomethingBad();}); + $I->assertArrayHasKey("apple", ['orange' => 2, 'apple' => 1], "pass"); // stepKey: assertArrayHasKeyBackwardCompatible + $I->assertArrayNotHasKey("kiwi", ['orange' => 2, 'apple' => 1], "pass"); // stepKey: assertArrayNotHasKeyBackwardCompatible + $I->assertArraySubset([1, 2], [1, 2, 3, 5], "pass"); // stepKey: assertArraySubsetBackwardCompatible + $I->assertContains("ab", ['item1' => 'a', 'item2' => 'ab'], "pass"); // stepKey: assertContainsBackwardCompatible + $I->assertCount(2, ['a', 'b'], "pass"); // stepKey: assertCountBackwardCompatible + $I->assertEmpty([], "pass"); // stepKey: assertEmptyBackwardCompatible + $I->assertEquals($text, "Copyright © 2013-2017 Magento, Inc. All rights reserved.", "pass"); // stepKey: assertEquals1BackwardCompatible + $I->assertEquals("Copyright © 2013-2017 Magento, Inc. All rights reserved.", $text, "pass"); // stepKey: assertEquals2BackwardCompatible + $I->assertFalse(false, "pass"); // stepKey: assertFalse1BackwardCompatible + $I->assertFileNotExists("/out.txt", "pass"); // stepKey: assertFileNotExists1BackwardCompatible + $I->assertFileNotExists($text, "pass"); // stepKey: assertFileNotExists2BackwardCompatible + $I->assertGreaterOrEquals(2, 5, "pass"); // stepKey: assertGreaterOrEqualsBackwardCompatible + $I->assertGreaterThan(2, 5, "pass"); // stepKey: assertGreaterThanBackwardCompatible + $I->assertGreaterThanOrEqual(2, 5, "pass"); // stepKey: assertGreaterThanOrEqualBackwardCompatible + $I->assertInternalType("string", "xyz", "pass"); // stepKey: assertInternalType1BackwardCompatible + $I->assertInternalType("int", 21, "pass"); // stepKey: assertInternalType2BackwardCompatible + $I->assertInternalType("string", $text, "pass"); // stepKey: assertInternalType3BackwardCompatible + $I->assertLessOrEquals(5, 2, "pass"); // stepKey: assertLessOrEqualBackwardCompatibles + $I->assertLessThan(5, 2, "pass"); // stepKey: assertLessThanBackwardCompatible + $I->assertLessThanOrEqual(5, 2, "pass"); // stepKey: assertLessThanOrEqualBackwardCompatible + $I->assertNotContains("bc", ['item1' => 'a', 'item2' => 'ab'], "pass"); // stepKey: assertNotContains1BackwardCompatible + $I->assertNotContains("bc", $text, "pass"); // stepKey: assertNotContains2BackwardCompatible + $I->assertNotEmpty([1, 2], "pass"); // stepKey: assertNotEmpty1BackwardCompatible + $I->assertNotEmpty($text, "pass"); // stepKey: assertNotEmpty2BackwardCompatible + $I->assertNotEquals(2, 5, "pass", 0); // stepKey: assertNotEqualsBackwardCompatible + $I->assertNotNull("abc", "pass"); // stepKey: assertNotNull1BackwardCompatible + $I->assertNotNull($text, "pass"); // stepKey: assertNotNull2BackwardCompatible + $I->assertNotRegExp("/foo/", "bar", "pass"); // stepKey: assertNotRegExpBackwardCompatible + $I->assertNotSame("log", "tag", "pass"); // stepKey: assertNotSameBackwardCompatible + $I->assertRegExp("/foo/", "foo", "pass"); // stepKey: assertRegExpBackwardCompatible + $I->assertSame("bar", "bar", "pass"); // stepKey: assertSameBackwardCompatible + $I->assertStringStartsNotWith("a", "banana", "pass"); // stepKey: assertStringStartsNotWithBackwardCompatible + $I->assertStringStartsWith("a", "apple", "pass"); // stepKey: assertStringStartsWithBackwardCompatible + $I->assertTrue(true, "pass"); // stepKey: assertTrueBackwardCompatible + $I->assertElementContainsAttribute("#username", "class", "admin__control-text"); // stepKey: assertElementContainsAttributeBackwardCompatible + $I->assertInstanceOf(User::class, $text, "pass"); // stepKey: assertInstanceOfBackwardCompatible + $I->assertNotInstanceOf(User::class, 21, "pass"); // stepKey: assertNotInstanceOfBackwardCompatible + $I->assertFileExists($text, "pass"); // stepKey: assertFileExistsBackwardCompatible + $I->assertIsEmpty($text, "pass"); // stepKey: assertIsEmptyBackwardCompatible + $I->assertNull($text, "pass"); // stepKey: assertNullBackwardCompatible + $I->expectException(new MyException('exception msg'), function() {$this->doSomethingBad();}); // stepKey: expectExceptionBackwardCompatible $I->comment("string type that use created data"); - $I->assertStringStartsWith("D", PersistedObjectHandler::getInstance()->retrieveEntityField('createData1', 'lastname', 'test') . ", " . PersistedObjectHandler::getInstance()->retrieveEntityField('createData1', 'firstname', 'test'), "fail"); - $I->assertStringStartsNotWith("W", PersistedObjectHandler::getInstance()->retrieveEntityField('createData2', 'firstname', 'test') . ", " . PersistedObjectHandler::getInstance()->retrieveEntityField('createData2', 'lastname', 'test'), "pass"); - $I->assertEquals(PersistedObjectHandler::getInstance()->retrieveEntityField('createData1', 'lastname', 'test'), PersistedObjectHandler::getInstance()->retrieveEntityField('createData1', 'lastname', 'test'), "pass"); + $I->assertStringStartsWith("D", PersistedObjectHandler::getInstance()->retrieveEntityField('createData1', 'lastname', 'test') . ", " . PersistedObjectHandler::getInstance()->retrieveEntityField('createData1', 'firstname', 'test'), "fail"); // stepKey: assert1 + $I->assertStringStartsNotWith("W", PersistedObjectHandler::getInstance()->retrieveEntityField('createData2', 'firstname', 'test') . ", " . PersistedObjectHandler::getInstance()->retrieveEntityField('createData2', 'lastname', 'test'), "pass"); // stepKey: assert2 + $I->assertEquals(PersistedObjectHandler::getInstance()->retrieveEntityField('createData1', 'lastname', 'test'), PersistedObjectHandler::getInstance()->retrieveEntityField('createData1', 'lastname', 'test'), "pass"); // stepKey: assert5 $I->comment("array type that use created data"); - $I->assertArraySubset([PersistedObjectHandler::getInstance()->retrieveEntityField('createData1', 'lastname', 'test'), PersistedObjectHandler::getInstance()->retrieveEntityField('createData1', 'firstname', 'test')], [PersistedObjectHandler::getInstance()->retrieveEntityField('createData1', 'lastname', 'test'), PersistedObjectHandler::getInstance()->retrieveEntityField('createData1', 'firstname', 'test'), "1"], "pass"); - $I->assertArraySubset([PersistedObjectHandler::getInstance()->retrieveEntityField('createData2', 'firstname', 'test'), PersistedObjectHandler::getInstance()->retrieveEntityField('createData2', 'lastname', 'test')], [PersistedObjectHandler::getInstance()->retrieveEntityField('createData2', 'firstname', 'test'), PersistedObjectHandler::getInstance()->retrieveEntityField('createData2', 'lastname', 'test'), "1"], "pass"); - $I->assertArrayHasKey("lastname", ['lastname' => PersistedObjectHandler::getInstance()->retrieveEntityField('createData1', 'lastname', 'test'), 'firstname' => PersistedObjectHandler::getInstance()->retrieveEntityField('createData1', 'firstname', 'test')], "pass"); - $I->assertArrayHasKey("lastname", ['lastname' => PersistedObjectHandler::getInstance()->retrieveEntityField('createData2', 'lastname', 'test'), 'firstname' => PersistedObjectHandler::getInstance()->retrieveEntityField('createData2', 'firstname', 'test')], "pass"); - $I->assertInstanceOf(User::class, $text, "pass"); - $I->assertNotInstanceOf(User::class, 21, "pass"); - $I->assertFileExists($text, "pass"); - $I->assertFileExists("AssertCest.php", "pass"); - $I->assertIsEmpty($text, "pass"); - $I->assertNull($text, "pass"); - $I->expectException(new MyException('exception msg'), function() {$this->doSomethingBad();}); - $I->fail("fail"); - $I->fail(PersistedObjectHandler::getInstance()->retrieveEntityField('createData2', 'firstname', 'test') . " " . PersistedObjectHandler::getInstance()->retrieveEntityField('createData2', 'lastname', 'test')); - $I->fail(PersistedObjectHandler::getInstance()->retrieveEntityField('createData1', 'firstname', 'test') . " " . PersistedObjectHandler::getInstance()->retrieveEntityField('createData1', 'lastname', 'test')); - $I->assertElementContainsAttribute("#username", "class", "admin__control-text"); - $I->assertElementContainsAttribute("#username", "name", "login[username]"); - $I->assertElementContainsAttribute("#username", "autofocus", "true"); - $I->assertElementContainsAttribute("#username", "data-validate", "{required:true}"); - $I->assertElementContainsAttribute(".admin__menu-overlay", "style", "display: none;"); - $I->assertElementContainsAttribute(".admin__menu-overlay", "border", "0"); - $I->assertElementContainsAttribute("#username", "value", PersistedObjectHandler::getInstance()->retrieveEntityField('createData2', 'firstname', 'test')); - $I->assertElementContainsAttribute("#username", "value", PersistedObjectHandler::getInstance()->retrieveEntityField('createData1', 'firstname', 'test')); - $I->assertEquals("John", "Doe", "pass"); + $I->assertArraySubset([PersistedObjectHandler::getInstance()->retrieveEntityField('createData1', 'lastname', 'test'), PersistedObjectHandler::getInstance()->retrieveEntityField('createData1', 'firstname', 'test')], [PersistedObjectHandler::getInstance()->retrieveEntityField('createData1', 'lastname', 'test'), PersistedObjectHandler::getInstance()->retrieveEntityField('createData1', 'firstname', 'test'), "1"], "pass"); // stepKey: assert9 + $I->assertArraySubset([PersistedObjectHandler::getInstance()->retrieveEntityField('createData2', 'firstname', 'test'), PersistedObjectHandler::getInstance()->retrieveEntityField('createData2', 'lastname', 'test')], [PersistedObjectHandler::getInstance()->retrieveEntityField('createData2', 'firstname', 'test'), PersistedObjectHandler::getInstance()->retrieveEntityField('createData2', 'lastname', 'test'), "1"], "pass"); // stepKey: assert10 + $I->assertArrayHasKey("lastname", ['lastname' => PersistedObjectHandler::getInstance()->retrieveEntityField('createData1', 'lastname', 'test'), 'firstname' => PersistedObjectHandler::getInstance()->retrieveEntityField('createData1', 'firstname', 'test')], "pass"); // stepKey: assert3 + $I->assertArrayHasKey("lastname", ['lastname' => PersistedObjectHandler::getInstance()->retrieveEntityField('createData2', 'lastname', 'test'), 'firstname' => PersistedObjectHandler::getInstance()->retrieveEntityField('createData2', 'firstname', 'test')], "pass"); // stepKey: assert4 + $I->assertInstanceOf(User::class, $text, "pass"); // stepKey: assertInstanceOf + $I->assertNotInstanceOf(User::class, 21, "pass"); // stepKey: assertNotInstanceOf + $I->assertFileExists($text, "pass"); // stepKey: assertFileExists2 + $I->assertFileExists("AssertCest.php", "pass"); // stepKey: assertFileExists3 + $I->assertIsEmpty($text, "pass"); // stepKey: assertIsEmpty + $I->assertNull($text, "pass"); // stepKey: assertNull + $I->expectException(new MyException('exception msg'), function() {$this->doSomethingBad();}); // stepKey: expectException + $I->fail("fail"); // stepKey: fail + $I->fail(PersistedObjectHandler::getInstance()->retrieveEntityField('createData2', 'firstname', 'test') . " " . PersistedObjectHandler::getInstance()->retrieveEntityField('createData2', 'lastname', 'test')); // stepKey: assert7 + $I->fail(PersistedObjectHandler::getInstance()->retrieveEntityField('createData1', 'firstname', 'test') . " " . PersistedObjectHandler::getInstance()->retrieveEntityField('createData1', 'lastname', 'test')); // stepKey: assert8 + $I->assertElementContainsAttribute("#username", "class", "admin__control-text"); // stepKey: assertElementContainsAttribute1 + $I->assertElementContainsAttribute("#username", "name", "login[username]"); // stepKey: assertElementContainsAttribute2 + $I->assertElementContainsAttribute("#username", "autofocus", "true"); // stepKey: assertElementContainsAttribute3 + $I->assertElementContainsAttribute("#username", "data-validate", "{required:true}"); // stepKey: assertElementContainsAttribute4 + $I->assertElementContainsAttribute(".admin__menu-overlay", "style", "display: none;"); // stepKey: assertElementContainsAttribute5 + $I->assertElementContainsAttribute(".admin__menu-overlay", "border", "0"); // stepKey: assertElementContainsAttribute6 + $I->assertElementContainsAttribute("#username", "value", PersistedObjectHandler::getInstance()->retrieveEntityField('createData2', 'firstname', 'test')); // stepKey: assertElementContainsAttribute7 + $I->assertElementContainsAttribute("#username", "value", PersistedObjectHandler::getInstance()->retrieveEntityField('createData1', 'firstname', 'test')); // stepKey: assertElementContainsAttribute8 + $I->assertEquals("John", "Doe", "pass"); // stepKey: assertEqualsEntity } } diff --git a/dev/tests/verification/Resources/BasicActionGroupTest.txt b/dev/tests/verification/Resources/BasicActionGroupTest.txt index d62c2919d..17e5e2bdf 100644 --- a/dev/tests/verification/Resources/BasicActionGroupTest.txt +++ b/dev/tests/verification/Resources/BasicActionGroupTest.txt @@ -25,7 +25,7 @@ class BasicActionGroupTestCest */ public function _before(AcceptanceTester $I) { - $I->amGoingTo("create entity that has the stepKey: createPersonParam"); + $I->comment("[createPersonParam] create 'ReplacementPerson' entity"); PersistedObjectHandler::getInstance()->createEntity( "createPersonParam", "hook", @@ -33,10 +33,11 @@ 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)"); + + $I->comment("Entering Action Group [beforeGroup] FunctionalActionGroup"); + $I->fillField("#foo", "myData1"); // stepKey: fillField1BeforeGroup + $I->fillField("#bar", "myData2"); // stepKey: fillField2BeforeGroup + $I->comment("Exiting Action Group [beforeGroup] FunctionalActionGroup"); } /** @@ -50,11 +51,11 @@ 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"); + $I->amOnPage("/someUrl"); // stepKey: step1 + $I->comment("Entering Action Group [actionGroup1] FunctionalActionGroup"); + $I->fillField("#foo", "myData1"); // stepKey: fillField1ActionGroup1 + $I->fillField("#bar", "myData2"); // stepKey: fillField2ActionGroup1 + $I->comment("Exiting Action Group [actionGroup1] FunctionalActionGroup"); + $I->click("loginButton"); // stepKey: step6 } } diff --git a/dev/tests/verification/Resources/BasicFunctionalTest.txt b/dev/tests/verification/Resources/BasicFunctionalTest.txt index fd5f0f165..b3ab7ea9c 100644 --- a/dev/tests/verification/Resources/BasicFunctionalTest.txt +++ b/dev/tests/verification/Resources/BasicFunctionalTest.txt @@ -26,7 +26,7 @@ class BasicFunctionalTestCest */ public function _before(AcceptanceTester $I) { - $I->amOnPage("/beforeUrl"); + $I->amOnPage("/beforeUrl"); // stepKey: beforeAmOnPageKey } /** @@ -35,7 +35,7 @@ class BasicFunctionalTestCest */ public function _after(AcceptanceTester $I) { - $I->amOnPage("/afterUrl"); + $I->amOnPage("/afterUrl"); // stepKey: afterAmOnPageKey } /** @@ -44,7 +44,7 @@ class BasicFunctionalTestCest */ public function _failed(AcceptanceTester $I) { - $I->saveScreenshot(); + $I->saveScreenshot(); // stepKey: saveScreenshot } /** @@ -61,110 +61,114 @@ class BasicFunctionalTestCest $I->comment(""); $I->comment(""); $I->comment("seeComment"); - $someVarDefinition = $I->grabValueFrom(); - $I->acceptPopup(); - $I->amOnPage("/test/url"); - $I->appendField(".functionalTestSelector"); - $I->attachFile(".functionalTestSelector", "testFileAttachment"); - $I->cancelPopup(); - $I->checkOption(".functionalTestSelector"); - $I->click(".functionalTestSelector"); - $I->clickWithLeftButton(".functionalTestSelector"); - $I->clickWithRightButton(".functionalTestSelector"); - $I->clickWithLeftButton("#element#element .200", 200, 300); - $I->clickWithRightButton("#element .4123#element", 200, 300); - $I->closeTab(); - $I->conditionalClick(".functionalTestSelector", ".functionalDependentTestSelector", true); - $I->amGoingTo("delete entity that has the createDataKey: createKey1"); + $someVarDefinition = $I->grabValueFrom(); // stepKey: someVarDefinition + $I->acceptPopup(); // stepKey: acceptPopupKey1 + $I->amOnPage("/test/url"); // stepKey: amOnPageKey1 + $I->appendField(".functionalTestSelector"); // stepKey: appendFieldKey1 + $I->attachFile(".functionalTestSelector", "testFileAttachment"); // stepKey: attachFileKey1 + $I->cancelPopup(); // stepKey: cancelPopupKey1 + $I->checkOption(".functionalTestSelector"); // stepKey: checkOptionKey1 + $I->click(".functionalTestSelector"); // stepKey: clickKey1 + $I->clickWithLeftButton(".functionalTestSelector"); // stepKey: clickWithLeftButtonKey1 + $I->clickWithRightButton(".functionalTestSelector"); // stepKey: clickWithRightButtonKey1 + $I->clickWithLeftButton("#element#element .200", 200, 300); // stepKey: clickWithLeftButtonKeyXY1 + $I->clickWithRightButton("#element .4123#element", 200, 300); // stepKey: clickWithRightButtonKeyXY1 + $I->closeTab(); // stepKey: closeTabKey1 + $I->conditionalClick(".functionalTestSelector", ".functionalDependentTestSelector", true); // stepKey: conditionalClickKey1 + $I->comment("[deleteKey1] delete entity 'createKey1'"); PersistedObjectHandler::getInstance()->deleteEntity( "createKey1", "test" ); + $I->deleteEntityByUrl("/V1/categories{$grabbedData}"); - $I->dontSee("someInput", ".functionalTestSelector"); - $I->dontSeeCheckboxIsChecked(".functionalTestSelector"); - $I->dontSeeCookie("someInput"); - $I->dontSeeCurrentUrlEquals("/functionalUrl"); - $I->dontSeeCurrentUrlMatches("/[0-9]+/"); - $I->dontSeeElement(".functionalTestSelector"); - $I->dontSeeElementInDOM(".functionalTestSelector"); - $I->dontSeeInCurrentUrl("/functionalUrl"); - $I->dontSeeInField(".functionalTestSelector"); - $I->dontSeeInPageSource("someInput"); - $I->dontSeeInSource(""); - $I->dontSeeInTitle("someInput"); - $I->dontSeeLink("someInput", "/functionalUrl"); - $I->dontSeeOptionIsSelected(".functionalTestSelector", "someInput"); - $I->doubleClick(".functionalTestSelector"); - $I->dragAndDrop(".functionalTestSelector", ".functionalTestSelector2"); - $I->dragAndDrop(".functionalTestSelector", ".functionalTestSelector2", 100, 900); - $executeJSKey1 = $I->executeJS("someJSFunction"); - $I->fillField(".functionalTestSelector", "someInput"); - $I->fillField(".functionalTestSelector", "0"); + + $I->dontSee("someInput", ".functionalTestSelector"); // stepKey: dontSeeKey1 + $I->dontSeeCheckboxIsChecked(".functionalTestSelector"); // stepKey: dontSeeCheckboxIsCheckedKey1 + $I->dontSeeCookie("someInput"); // stepKey: dontSeeCookieKey1 + $I->dontSeeCurrentUrlEquals("/functionalUrl"); // stepKey: dontSeeCurrentUrlEqualsKey1 + $I->dontSeeCurrentUrlMatches("/[0-9]+/"); // stepKey: dontSeeCurrentUrlMatchesKey1 + $I->dontSeeElement(".functionalTestSelector"); // stepKey: dontSeeElementKey1 + $I->dontSeeElementInDOM(".functionalTestSelector"); // stepKey: dontSeeElementInDOMKey1 + $I->dontSeeInCurrentUrl("/functionalUrl"); // stepKey: dontSeeInCurrentUrlKey1 + $I->dontSeeInField(".functionalTestSelector"); // stepKey: dontSeeInFieldKey1 + $I->dontSeeInPageSource("someInput"); // stepKey: dontSeeInPageSourceKey1 + $I->dontSeeInSource(""); // stepKey: dontSeeInSourceKey1 + $I->dontSeeInTitle("someInput"); // stepKey: dontSeeInTitleKey1 + $I->dontSeeLink("someInput", "/functionalUrl"); // stepKey: dontSeeLinkKey1 + $I->dontSeeOptionIsSelected(".functionalTestSelector", "someInput"); // stepKey: dontSeeOptionIsSelectedKey1 + $I->doubleClick(".functionalTestSelector"); // stepKey: doubleClickKey1 + $I->dragAndDrop(".functionalTestSelector", ".functionalTestSelector2"); // stepKey: dragAndDropKey1 + $I->dragAndDrop(".functionalTestSelector", ".functionalTestSelector2", 100, 900); // stepKey: dragAndDropKey2 + $executeJSKey1 = $I->executeJS("someJSFunction"); // stepKey: executeJSKey1 + $I->fillField(".functionalTestSelector", "someInput"); // stepKey: fillFieldKey1 + $I->fillField(".functionalTestSelector", "0"); // stepKey: fillFieldKey2 $date = new \DateTime(); $date->setTimestamp(strtotime("Now")); $date->setTimezone(new \DateTimeZone("America/Los_Angeles")); $generateDateKey = $date->format("H:i:s"); + // stepKey: generateDateKey $date = new \DateTime(); $date->setTimestamp(strtotime("Now")); $date->setTimezone(new \DateTimeZone("UTC")); $generateDateKey2 = $date->format("H:i:s"); - $grabAttributeFromKey1 = $I->grabAttributeFrom(".functionalTestSelector", "someInput"); - $grabCookieKey1 = $I->grabCookie("grabCookieInput", ['domain' => 'www.google.com']); - $grabFromCurrentUrlKey1 = $I->grabFromCurrentUrl("/grabCurrentUrl"); - $grabMultipleKey1 = $I->grabMultiple(".functionalTestSelector"); - $grabTextFromKey1 = $I->grabTextFrom(".functionalTestSelector"); - $grabValueFromKey1 = $I->grabValueFrom(".functionalTestSelector"); - $magentoCli1 = $I->magentoCLI("maintenance:enable", "\"stuffHere\""); - $I->comment($magentoCli1); - $I->makeScreenshot("screenShotInput"); - $I->maximizeWindow(); - $I->moveBack(); - $I->moveForward(); - $I->moveMouseOver(".functionalTestSelector"); - $I->openNewTab(); - $I->pauseExecution(); - $I->performOn("#selector", function(\WebDriverElement $el) {return $el->isDisplayed();}, 10); - $I->pressKey("#page", "a"); - $I->pressKey("#page", ['ctrl', 'a'],'new'); - $I->pressKey("#page", ['shift', '111'],'1','x'); - $I->pressKey("#page", ['ctrl', 'a'],\Facebook\WebDriver\WebDriverKeys::DELETE); - $I->reloadPage(); - $I->resetCookie("cookieInput"); - $I->resizeWindow(0, 0); - $I->scrollTo(".functionalTestSelector"); - $I->see("someInput", ".functionalTestSelector"); - $I->seeCheckboxIsChecked(".functionalTestSelector"); - $I->seeCookie("someInput"); - $I->seeCurrentUrlEquals("/functionalUrl"); - $I->seeCurrentUrlMatches("/[0-9]+/"); - $I->seeElement(".functionalTestSelector"); - $I->seeElementInDOM(".functionalTestSelector"); - $I->seeInCurrentUrl("/functionalUrl"); - $I->seeInField(".functionalTestSelector", "someInput"); - $I->seeInPageSource(""); - $I->seeInPopup("someInput"); - $I->seeInSource(""); - $I->seeInTitle("someInput"); - $I->seeLink("someInput", "/functionalUrl"); - $I->seeNumberOfElements(".functionalTestSelector"); - $I->seeOptionIsSelected(".functionalTestSelector", "someInput"); - $I->selectOption(".functionalTestSelector"); - $I->selectMultipleOptions(".filter", ".option", ['opt1', 'opt2']); - $I->setCookie("someInput", "someCookieValue"); - $I->switchToIFrame("someInput"); - $I->switchToNextTab(); - $I->switchToPreviousTab(); - $I->switchToWindow(); - $I->typeInPopup("someInput"); - $I->uncheckOption(".functionalTestSelector"); - $I->unselectOption(".functionalTestSelector", "someInput"); - $I->wait(30); - $I->waitForElement(".functionalTestSelector", 30); - $I->waitForElementNotVisible(".functionalTestSelector", 30); - $I->waitForElementVisible(".functionalTestSelector", 30); - $I->waitForElementChange("#selector", function(\WebDriverElement $el) {return $el->isDisplayed();}, 10); - $I->waitForJS("someJsFunction", 30); - $I->waitForText("someInput", 30, ".functionalTestSelector"); + // stepKey: generateDateKey2 + $grabAttributeFromKey1 = $I->grabAttributeFrom(".functionalTestSelector", "someInput"); // stepKey: grabAttributeFromKey1 + $grabCookieKey1 = $I->grabCookie("grabCookieInput", ['domain' => 'www.google.com']); // stepKey: grabCookieKey1 + $grabFromCurrentUrlKey1 = $I->grabFromCurrentUrl("/grabCurrentUrl"); // stepKey: grabFromCurrentUrlKey1 + $grabMultipleKey1 = $I->grabMultiple(".functionalTestSelector"); // stepKey: grabMultipleKey1 + $grabTextFromKey1 = $I->grabTextFrom(".functionalTestSelector"); // stepKey: grabTextFromKey1 + $grabValueFromKey1 = $I->grabValueFrom(".functionalTestSelector"); // stepKey: grabValueFromKey1 + $magentoCli1 = $I->magentoCLI("maintenance:enable", "\"stuffHere\""); $I->comment($magentoCli1); + // stepKey: magentoCli1 + $I->makeScreenshot("screenShotInput"); // stepKey: makeScreenshotKey1 + $I->maximizeWindow(); // stepKey: maximizeWindowKey1 + $I->moveBack(); // stepKey: moveBackKey1 + $I->moveForward(); // stepKey: moveForwardKey1 + $I->moveMouseOver(".functionalTestSelector"); // stepKey: moveMouseOverKey1 + $I->openNewTab(); // stepKey: openNewTabKey1 + $I->pauseExecution(); // stepKey: pauseExecutionKey1 + $I->performOn("#selector", function(\WebDriverElement $el) {return $el->isDisplayed();}, 10); // stepKey: performOnKey1 + $I->pressKey("#page", "a"); // stepKey: pressKey1 + $I->pressKey("#page", ['ctrl', 'a'],'new'); // stepKey: pressKey2 + $I->pressKey("#page", ['shift', '111'],'1','x'); // stepKey: pressKey3 + $I->pressKey("#page", ['ctrl', 'a'],\Facebook\WebDriver\WebDriverKeys::DELETE); // stepKey: pressKey4 + $I->reloadPage(); // stepKey: reloadPageKey1 + $I->resetCookie("cookieInput"); // stepKey: resetCookieKey1 + $I->resizeWindow(0, 0); // stepKey: resizeWindowKey1 + $I->scrollTo(".functionalTestSelector"); // stepKey: scrollToKey1 + $I->see("someInput", ".functionalTestSelector"); // stepKey: seeKey1 + $I->seeCheckboxIsChecked(".functionalTestSelector"); // stepKey: seeCheckboxIsCheckedKey1 + $I->seeCookie("someInput"); // stepKey: seeCookieKey1 + $I->seeCurrentUrlEquals("/functionalUrl"); // stepKey: seeCurrentUrlEqualsKey1 + $I->seeCurrentUrlMatches("/[0-9]+/"); // stepKey: seeCurrentUrlMatchesKey1 + $I->seeElement(".functionalTestSelector"); // stepKey: seeElementKey1 + $I->seeElementInDOM(".functionalTestSelector"); // stepKey: seeElementInDOMKey1 + $I->seeInCurrentUrl("/functionalUrl"); // stepKey: seeInCurrentUrlKey1 + $I->seeInField(".functionalTestSelector", "someInput"); // stepKey: seeInFieldKey1 + $I->seeInPageSource(""); // stepKey: seeInPageSourceKey1 + $I->seeInPopup("someInput"); // stepKey: seeInPopupKey1 + $I->seeInSource(""); // stepKey: seeInSourceKey1 + $I->seeInTitle("someInput"); // stepKey: seeInTitleKey1 + $I->seeLink("someInput", "/functionalUrl"); // stepKey: seeLinkKey1 + $I->seeNumberOfElements(".functionalTestSelector"); // stepKey: seeNumberOfElementsKey1 + $I->seeOptionIsSelected(".functionalTestSelector", "someInput"); // stepKey: seeOptionIsSelectedKey1 + $I->selectOption(".functionalTestSelector"); // stepKey: selectOptionKey1 + $I->selectMultipleOptions(".filter", ".option", ['opt1', 'opt2']); // stepKey: selectMultipleOpts1 + $I->setCookie("someInput", "someCookieValue"); // stepKey: setCookieKey1 + $I->switchToIFrame("someInput"); // stepKey: switchToIFrameKey1 + $I->switchToNextTab(); // stepKey: switchToNextTabKey1 + $I->switchToPreviousTab(); // stepKey: switchToPreviousTabKey1 + $I->switchToWindow(); // stepKey: switchToWindowKey1 + $I->typeInPopup("someInput"); // stepKey: typeInPopupKey1 + $I->uncheckOption(".functionalTestSelector"); // stepKey: uncheckOptionKey1 + $I->unselectOption(".functionalTestSelector", "someInput"); // stepKey: unselectOptionKey1 + $I->wait(30); // stepKey: waitKey1 + $I->waitForElement(".functionalTestSelector", 30); // stepKey: waitForElementKey1 + $I->waitForElementNotVisible(".functionalTestSelector", 30); // stepKey: waitForElementNotVisibleKey1 + $I->waitForElementVisible(".functionalTestSelector", 30); // stepKey: waitForElementVisibleKey1 + $I->waitForElementChange("#selector", function(\WebDriverElement $el) {return $el->isDisplayed();}, 10); // stepKey: waitForElementChangeKey1 + $I->waitForJS("someJsFunction", 30); // stepKey: waitForJSKey1 + $I->waitForText("someInput", 30, ".functionalTestSelector"); // stepKey: waitForText1 } } diff --git a/dev/tests/verification/Resources/BasicMergeTest.txt b/dev/tests/verification/Resources/BasicMergeTest.txt index 2f66f2ce4..8b311dac2 100644 --- a/dev/tests/verification/Resources/BasicMergeTest.txt +++ b/dev/tests/verification/Resources/BasicMergeTest.txt @@ -27,8 +27,8 @@ class BasicMergeTestCest */ public function _before(AcceptanceTester $I) { - $I->amOnPage("/beforeUrl"); - $I->see("#before2"); + $I->amOnPage("/beforeUrl"); // stepKey: before1 + $I->see("#before2"); // stepKey: before2 } /** @@ -37,7 +37,7 @@ class BasicMergeTestCest */ public function _after(AcceptanceTester $I) { - $I->amOnPage("/afterUrl1"); + $I->amOnPage("/afterUrl1"); // stepKey: after1 } /** @@ -46,7 +46,7 @@ class BasicMergeTestCest */ public function _failed(AcceptanceTester $I) { - $I->saveScreenshot(); + $I->saveScreenshot(); // stepKey: saveScreenshot } /** @@ -60,20 +60,20 @@ class BasicMergeTestCest */ public function BasicMergeTest(AcceptanceTester $I) { - $I->amOnPage("/step1"); - $I->click("#step2"); - $I->fillField("#username", "step3"); - $I->click("#step4"); - $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"); + $I->amOnPage("/step1"); // stepKey: step1 + $I->click("#step2"); // stepKey: step2 + $I->fillField("#username", "step3"); // stepKey: step3 + $I->click("#step4"); // stepKey: step4 + $I->fillField("#password", "step5"); // stepKey: step5 + $I->click("#step6Merged"); // stepKey: step6Merge + $I->click("#element .Jane .step7Merge"); // stepKey: step7Merge + $I->comment("Entering Action Group [step8Merge] FunctionalActionGroupWithData"); + $I->amOnPage("/Jane/Dane.html"); // stepKey: amOnPage1Step8Merge + $I->fillField("#foo", "Jane"); // stepKey: fillField1Step8Merge + $I->fillField("#bar", "Dane"); // stepKey: fillField2Step8Merge + $I->searchAndMultiSelectOption("#foo", ["Jane", "Dane"]); // stepKey: multi1Step8Merge + $I->see("#element .Jane"); // stepKey: see1Step8Merge + $I->comment("Exiting Action Group [step8Merge] FunctionalActionGroupWithData"); + $I->click("#step10MergedInResult"); // stepKey: step10 } } diff --git a/dev/tests/verification/Resources/CharacterReplacementTest.txt b/dev/tests/verification/Resources/CharacterReplacementTest.txt index c1fddf69b..94459d3b1 100644 --- a/dev/tests/verification/Resources/CharacterReplacementTest.txt +++ b/dev/tests/verification/Resources/CharacterReplacementTest.txt @@ -27,13 +27,13 @@ class CharacterReplacementTestCest */ public function CharacterReplacementTest(AcceptanceTester $I) { - $I->click("#element"); - $I->fillField("#element", "7700 West Parmer Lane"); - $I->click("#element .abcdefghijklmnopqrstuvwxyz1234567890"); - $I->click("#element .`~!@#$%^&*()-_=+{}[]|\;:\".,>click("#element .words, and, commas, and, spaces"); - $I->click("#abcdefghijklmnopqrstuvwxyz1234567890 .abcdefghijklmnopqrstuvwxyz1234567890"); - $I->click("#`~!@#$%^&*()-_=+{}[]|\;:\".,>click("#words, and, commas, and, spaces .words, and, commas, and, spaces"); + $I->click("#element"); // stepKey: charsInSectionElement + $I->fillField("#element", "7700 West Parmer Lane"); // stepKey: charsInDataRef + $I->click("#element .abcdefghijklmnopqrstuvwxyz1234567890"); // stepKey: allChars1 + $I->click("#element .`~!@#$%^&*()-_=+{}[]|\;:\".,>click("#element .words, and, commas, and, spaces"); // stepKey: allChars3 + $I->click("#abcdefghijklmnopqrstuvwxyz1234567890 .abcdefghijklmnopqrstuvwxyz1234567890"); // stepKey: allChars4 + $I->click("#`~!@#$%^&*()-_=+{}[]|\;:\".,>click("#words, and, commas, and, spaces .words, and, commas, and, spaces"); // stepKey: allChars6 } } diff --git a/dev/tests/verification/Resources/ChildExtendedTestAddHooks.txt b/dev/tests/verification/Resources/ChildExtendedTestAddHooks.txt index 27c9a99c6..4c8ec1ea1 100644 --- a/dev/tests/verification/Resources/ChildExtendedTestAddHooks.txt +++ b/dev/tests/verification/Resources/ChildExtendedTestAddHooks.txt @@ -26,7 +26,7 @@ class ChildExtendedTestAddHooksCest */ public function _before(AcceptanceTester $I) { - $I->amOnPage("/beforeUrl"); + $I->amOnPage("/beforeUrl"); // stepKey: beforeAmOnPageKey } /** @@ -35,7 +35,7 @@ class ChildExtendedTestAddHooksCest */ public function _after(AcceptanceTester $I) { - $I->amOnPage("/afterUrl"); + $I->amOnPage("/afterUrl"); // stepKey: afterAmOnPageKey } /** @@ -44,7 +44,7 @@ class ChildExtendedTestAddHooksCest */ public function _failed(AcceptanceTester $I) { - $I->saveScreenshot(); + $I->saveScreenshot(); // stepKey: saveScreenshot } /** diff --git a/dev/tests/verification/Resources/ChildExtendedTestMerging.txt b/dev/tests/verification/Resources/ChildExtendedTestMerging.txt index 788818272..a59d141b4 100644 --- a/dev/tests/verification/Resources/ChildExtendedTestMerging.txt +++ b/dev/tests/verification/Resources/ChildExtendedTestMerging.txt @@ -26,9 +26,9 @@ class ChildExtendedTestMergingCest */ public function _before(AcceptanceTester $I) { - $I->amOnPage("/firstUrl"); - $I->amOnPage("/beforeUrl"); - $I->amOnPage("/lastUrl"); + $I->amOnPage("/firstUrl"); // stepKey: firstBeforeAmOnPageKey + $I->amOnPage("/beforeUrl"); // stepKey: beforeAmOnPageKey + $I->amOnPage("/lastUrl"); // stepKey: lastBefore } /** @@ -37,7 +37,7 @@ class ChildExtendedTestMergingCest */ public function _after(AcceptanceTester $I) { - $I->amOnPage("/afterUrl"); + $I->amOnPage("/afterUrl"); // stepKey: afterAmOnPageKey } /** @@ -46,7 +46,7 @@ class ChildExtendedTestMergingCest */ public function _failed(AcceptanceTester $I) { - $I->saveScreenshot(); + $I->saveScreenshot(); // stepKey: saveScreenshot } /** diff --git a/dev/tests/verification/Resources/ChildExtendedTestRemoveAction.txt b/dev/tests/verification/Resources/ChildExtendedTestRemoveAction.txt index 40a3184c9..b1eb8340b 100644 --- a/dev/tests/verification/Resources/ChildExtendedTestRemoveAction.txt +++ b/dev/tests/verification/Resources/ChildExtendedTestRemoveAction.txt @@ -26,7 +26,7 @@ class ChildExtendedTestRemoveActionCest */ public function _before(AcceptanceTester $I) { - $I->amOnPage("/beforeUrl"); + $I->amOnPage("/beforeUrl"); // stepKey: beforeAmOnPageKey } /** @@ -35,7 +35,7 @@ class ChildExtendedTestRemoveActionCest */ public function _after(AcceptanceTester $I) { - $I->amOnPage("/afterUrl"); + $I->amOnPage("/afterUrl"); // stepKey: afterAmOnPageKey } /** @@ -44,7 +44,7 @@ class ChildExtendedTestRemoveActionCest */ public function _failed(AcceptanceTester $I) { - $I->saveScreenshot(); + $I->saveScreenshot(); // stepKey: saveScreenshot } /** diff --git a/dev/tests/verification/Resources/ChildExtendedTestRemoveHookAction.txt b/dev/tests/verification/Resources/ChildExtendedTestRemoveHookAction.txt index 7419e681a..cd0e6b049 100644 --- a/dev/tests/verification/Resources/ChildExtendedTestRemoveHookAction.txt +++ b/dev/tests/verification/Resources/ChildExtendedTestRemoveHookAction.txt @@ -34,7 +34,7 @@ class ChildExtendedTestRemoveHookActionCest */ public function _after(AcceptanceTester $I) { - $I->amOnPage("/afterUrl"); + $I->amOnPage("/afterUrl"); // stepKey: afterAmOnPageKey } /** @@ -43,7 +43,7 @@ class ChildExtendedTestRemoveHookActionCest */ public function _failed(AcceptanceTester $I) { - $I->saveScreenshot(); + $I->saveScreenshot(); // stepKey: saveScreenshot } /** diff --git a/dev/tests/verification/Resources/ChildExtendedTestReplace.txt b/dev/tests/verification/Resources/ChildExtendedTestReplace.txt index 18b1984c0..6c699b7db 100644 --- a/dev/tests/verification/Resources/ChildExtendedTestReplace.txt +++ b/dev/tests/verification/Resources/ChildExtendedTestReplace.txt @@ -26,7 +26,7 @@ class ChildExtendedTestReplaceCest */ public function _before(AcceptanceTester $I) { - $I->amOnPage("/beforeUrl"); + $I->amOnPage("/beforeUrl"); // stepKey: beforeAmOnPageKey } /** @@ -35,7 +35,7 @@ class ChildExtendedTestReplaceCest */ public function _after(AcceptanceTester $I) { - $I->amOnPage("/afterUrl"); + $I->amOnPage("/afterUrl"); // stepKey: afterAmOnPageKey } /** @@ -44,7 +44,7 @@ class ChildExtendedTestReplaceCest */ public function _failed(AcceptanceTester $I) { - $I->saveScreenshot(); + $I->saveScreenshot(); // stepKey: saveScreenshot } /** diff --git a/dev/tests/verification/Resources/ChildExtendedTestReplaceHook.txt b/dev/tests/verification/Resources/ChildExtendedTestReplaceHook.txt index 90ebf3676..82184a206 100644 --- a/dev/tests/verification/Resources/ChildExtendedTestReplaceHook.txt +++ b/dev/tests/verification/Resources/ChildExtendedTestReplaceHook.txt @@ -26,7 +26,7 @@ class ChildExtendedTestReplaceHookCest */ public function _before(AcceptanceTester $I) { - $I->amOnPage("/slightlyDifferentBeforeUrl"); + $I->amOnPage("/slightlyDifferentBeforeUrl"); // stepKey: beforeAmOnPageKey } /** @@ -35,7 +35,7 @@ class ChildExtendedTestReplaceHookCest */ public function _after(AcceptanceTester $I) { - $I->amOnPage("/afterUrl"); + $I->amOnPage("/afterUrl"); // stepKey: afterAmOnPageKey } /** @@ -44,7 +44,7 @@ class ChildExtendedTestReplaceHookCest */ public function _failed(AcceptanceTester $I) { - $I->saveScreenshot(); + $I->saveScreenshot(); // stepKey: saveScreenshot } /** diff --git a/dev/tests/verification/Resources/DataActionsTest.txt b/dev/tests/verification/Resources/DataActionsTest.txt index cac3b72cd..5d1ee9e00 100644 --- a/dev/tests/verification/Resources/DataActionsTest.txt +++ b/dev/tests/verification/Resources/DataActionsTest.txt @@ -24,7 +24,7 @@ class DataActionsTestCest */ public function _before(AcceptanceTester $I) { - $I->amGoingTo("create entity that has the stepKey: createdInBefore"); + $I->comment("[createdInBefore] create 'entity' entity"); PersistedObjectHandler::getInstance()->createEntity( "createdInBefore", "hook", @@ -32,18 +32,21 @@ class DataActionsTestCest [], null ); - $I->amGoingTo("update entity that has the createdDataKey: createdInBefore"); + + $I->comment("[updateInBefore] update 'createdInBefore' entity to 'entity'"); PersistedObjectHandler::getInstance()->updateEntity( "createdInBefore", "hook", "entity", [] ); - $I->amGoingTo("delete entity that has the createDataKey: createdInBefore"); + + $I->comment("[deleteInBefore] delete entity 'createdInBefore'"); PersistedObjectHandler::getInstance()->deleteEntity( "createdInBefore", "hook" ); + } /** @@ -55,7 +58,7 @@ class DataActionsTestCest */ public function DataActionsTest(AcceptanceTester $I) { - $I->amGoingTo("create entity that has the stepKey: createdInTest"); + $I->comment("[createdInTest] create 'entity' entity"); PersistedObjectHandler::getInstance()->createEntity( "createdInTest", "test", @@ -63,29 +66,34 @@ class DataActionsTestCest [], null ); - $I->amGoingTo("update entity that has the createdDataKey: createdInTest"); + + $I->comment("[updateInTest] update 'createdInTest' entity to 'entity'"); PersistedObjectHandler::getInstance()->updateEntity( "createdInTest", "test", "entity", [] ); - $I->amGoingTo("delete entity that has the createDataKey: createdInTest"); + + $I->comment("[deleteInTest] delete entity 'createdInTest'"); PersistedObjectHandler::getInstance()->deleteEntity( "createdInTest", "test" ); - $I->amGoingTo("update entity that has the createdDataKey: createdInBefore"); + + $I->comment("[updatedDataOutOfScope] update 'createdInBefore' entity to 'entity'"); PersistedObjectHandler::getInstance()->updateEntity( "createdInBefore", "test", "entity", [] ); - $I->amGoingTo("delete entity that has the createDataKey: createdInBefore"); + + $I->comment("[deleteDataOutOfScope] delete entity 'createdInBefore'"); PersistedObjectHandler::getInstance()->deleteEntity( "createdInBefore", "test" ); + } } diff --git a/dev/tests/verification/Resources/DataReplacementTest.txt b/dev/tests/verification/Resources/DataReplacementTest.txt index 60dd2faae..8cc671d3d 100644 --- a/dev/tests/verification/Resources/DataReplacementTest.txt +++ b/dev/tests/verification/Resources/DataReplacementTest.txt @@ -27,31 +27,31 @@ class DataReplacementTestCest */ public function DataReplacementTest(AcceptanceTester $I) { - $I->fillField("#selector", "StringBefore John StringAfter"); - $I->seeCurrentUrlMatches("~\/John~i"); - $I->fillField("#John", "input"); - $I->dragAndDrop("#John", "Doe"); - $I->conditionalClick("Doe", "#John", true); - $I->amOnUrl("John.html"); - $I->searchAndMultiSelectOption("#selector", ["John", "Doe"]); - $I->fillField("#selector", "StringBefore " . msq("uniqueData") . "John StringAfter"); - $I->fillField("#" . msq("uniqueData") . "John", "input"); - $I->dragAndDrop("#" . msq("uniqueData") . "John", msq("uniqueData") . "John"); - $I->conditionalClick(msq("uniqueData") . "John", "#" . msq("uniqueData") . "John", true); - $I->amOnUrl(msq("uniqueData") . "John.html"); - $I->searchAndMultiSelectOption("#selector", [msq("uniqueData") . "John", "Doe"]); - $I->click("#" . msq("uniqueData") . "John#" . msq("uniqueData") . "John"); - $I->click("#Doe" . msq("uniqueData") . "#Doe" . msq("uniqueData")); - $I->fillField("#selector", "StringBefore Doe" . msq("uniqueData") . " StringAfter"); - $I->fillField("#Doe" . msq("uniqueData"), "input"); - $I->dragAndDrop("#Doe" . msq("uniqueData"), "Doe" . msq("uniqueData")); - $I->conditionalClick("Doe" . msq("uniqueData"), "#Doe" . msq("uniqueData"), true); - $I->amOnUrl("Doe" . msq("uniqueData") . ".html"); - $I->searchAndMultiSelectOption("#selector", ["John", "Doe" . msq("uniqueData")]); - $I->searchAndMultiSelectOption("#selector", [msq("uniqueData") . "John", "Doe" . msq("uniqueData")]); - $I->selectMultipleOptions("#Doe" . msq("uniqueData"), "#element", [msq("uniqueData") . "John", "Doe" . msq("uniqueData")]); - $I->fillField(".selector", "0"); - $insertCommand = $I->magentoCLI("do something Doe" . msq("uniqueData") . " with uniqueness"); - $I->comment($insertCommand); + $I->fillField("#selector", "StringBefore John StringAfter"); // stepKey: inputReplace + $I->seeCurrentUrlMatches("~\/John~i"); // stepKey: seeInRegex + $I->fillField("#John", "input"); // stepKey: selectorReplace + $I->dragAndDrop("#John", "Doe"); // stepKey: selector12Replace + $I->conditionalClick("Doe", "#John", true); // stepKey: dependentSelectorReplace + $I->amOnUrl("John.html"); // stepKey: urlReplace + $I->searchAndMultiSelectOption("#selector", ["John", "Doe"]); // stepKey: parameterArrayReplacement + $I->fillField("#selector", "StringBefore " . msq("uniqueData") . "John StringAfter"); // stepKey: inputPrefixReplaceMSQPrefix + $I->fillField("#" . msq("uniqueData") . "John", "input"); // stepKey: selectorReplaceMSQPrefix + $I->dragAndDrop("#" . msq("uniqueData") . "John", msq("uniqueData") . "John"); // stepKey: selector12ReplaceMSQPrefix + $I->conditionalClick(msq("uniqueData") . "John", "#" . msq("uniqueData") . "John", true); // stepKey: dependentSelectorReplaceMSQPrefix + $I->amOnUrl(msq("uniqueData") . "John.html"); // stepKey: urlReplaceMSQPrefix + $I->searchAndMultiSelectOption("#selector", [msq("uniqueData") . "John", "Doe"]); // stepKey: parameterArrayReplacementMSQPrefix + $I->click("#" . msq("uniqueData") . "John#" . msq("uniqueData") . "John"); // stepKey: selectorReplaceDupedMSQPrefix + $I->click("#Doe" . msq("uniqueData") . "#Doe" . msq("uniqueData")); // stepKey: selectorReplaceDupedMSQSuffix + $I->fillField("#selector", "StringBefore Doe" . msq("uniqueData") . " StringAfter"); // stepKey: inputReplaceMSQSuffix + $I->fillField("#Doe" . msq("uniqueData"), "input"); // stepKey: selectorReplaceMSQSuffix + $I->dragAndDrop("#Doe" . msq("uniqueData"), "Doe" . msq("uniqueData")); // stepKey: selector12ReplaceMSQSuffix + $I->conditionalClick("Doe" . msq("uniqueData"), "#Doe" . msq("uniqueData"), true); // stepKey: dependentSelectorReplaceMSQSuffix + $I->amOnUrl("Doe" . msq("uniqueData") . ".html"); // stepKey: urlReplaceMSQSuffix + $I->searchAndMultiSelectOption("#selector", ["John", "Doe" . msq("uniqueData")]); // stepKey: parameterArrayReplacementMSQSuffix + $I->searchAndMultiSelectOption("#selector", [msq("uniqueData") . "John", "Doe" . msq("uniqueData")]); // stepKey: parameterArrayReplacementMSQBoth + $I->selectMultipleOptions("#Doe" . msq("uniqueData"), "#element", [msq("uniqueData") . "John", "Doe" . msq("uniqueData")]); // stepKey: multiSelectDataReplacement + $I->fillField(".selector", "0"); // stepKey: insertZero + $insertCommand = $I->magentoCLI("do something Doe" . msq("uniqueData") . " with uniqueness"); $I->comment($insertCommand); + // stepKey: insertCommand } } diff --git a/dev/tests/verification/Resources/ExecuteInSeleniumTest.txt b/dev/tests/verification/Resources/ExecuteInSeleniumTest.txt index 323b2ffb9..0fbee0550 100644 --- a/dev/tests/verification/Resources/ExecuteInSeleniumTest.txt +++ b/dev/tests/verification/Resources/ExecuteInSeleniumTest.txt @@ -27,6 +27,6 @@ class ExecuteInSeleniumTestCest */ public function ExecuteInSeleniumTest(AcceptanceTester $I) { - $I->executeInSelenium(function ($webdriver) { return 'Hello, World!'}); + $I->executeInSelenium(function ($webdriver) { return 'Hello, World!'}); // stepKey: executeInSeleniumStep } } diff --git a/dev/tests/verification/Resources/ExecuteJsEscapingTest.txt b/dev/tests/verification/Resources/ExecuteJsEscapingTest.txt index 6dd8ef3db..19140eaf9 100644 --- a/dev/tests/verification/Resources/ExecuteJsEscapingTest.txt +++ b/dev/tests/verification/Resources/ExecuteJsEscapingTest.txt @@ -27,10 +27,10 @@ class ExecuteJsEscapingTestCest */ public function ExecuteJsEscapingTest(AcceptanceTester $I) { - $javaVariableEscape = $I->executeJS("return \$javascriptVariable"); - $mftfVariableNotEscaped = $I->executeJS("return {$doNotEscape}"); - $persistedDataNotEscaped = $I->executeJS("return " . PersistedObjectHandler::getInstance()->retrieveEntityField('persisted', 'data', 'test')); - $hookPersistedDataNotEscaped = $I->executeJS("return " . PersistedObjectHandler::getInstance()->retrieveEntityField('persisted', 'data', 'test')); - $addNewAttributeForRule = $I->executeJS("document.querySelector('entity option[value=" . PersistedObjectHandler::getInstance()->retrieveEntityField('productAttribute', 'attribute_code', 'test') . "]').setAttribute('selected', 'selected')"); + $javaVariableEscape = $I->executeJS("return \$javascriptVariable"); // stepKey: javaVariableEscape + $mftfVariableNotEscaped = $I->executeJS("return {$doNotEscape}"); // stepKey: mftfVariableNotEscaped + $persistedDataNotEscaped = $I->executeJS("return " . PersistedObjectHandler::getInstance()->retrieveEntityField('persisted', 'data', 'test')); // stepKey: persistedDataNotEscaped + $hookPersistedDataNotEscaped = $I->executeJS("return " . PersistedObjectHandler::getInstance()->retrieveEntityField('persisted', 'data', 'test')); // stepKey: hookPersistedDataNotEscaped + $addNewAttributeForRule = $I->executeJS("document.querySelector('entity option[value=" . PersistedObjectHandler::getInstance()->retrieveEntityField('productAttribute', 'attribute_code', 'test') . "]').setAttribute('selected', 'selected')"); // stepKey: addNewAttributeForRule } } diff --git a/dev/tests/verification/Resources/ExtendParentDataTest.txt b/dev/tests/verification/Resources/ExtendParentDataTest.txt index 41bea9d6f..a80f3cf19 100644 --- a/dev/tests/verification/Resources/ExtendParentDataTest.txt +++ b/dev/tests/verification/Resources/ExtendParentDataTest.txt @@ -27,7 +27,7 @@ class ExtendParentDataTestCest */ public function ExtendParentDataTest(AcceptanceTester $I) { - $I->amGoingTo("create entity that has the stepKey: simpleDataKey"); + $I->comment("[simpleDataKey] create 'extendParentData' entity"); PersistedObjectHandler::getInstance()->createEntity( "simpleDataKey", "test", @@ -35,10 +35,11 @@ class ExtendParentDataTestCest [], null ); - $I->searchAndMultiSelectOption("#selector", ["otherName"]); - $I->searchAndMultiSelectOption("#selector", ["extendName"]); - $I->searchAndMultiSelectOption("#selector", ["item"]); - $I->searchAndMultiSelectOption("#selector", [msq("extendParentData") . "prename"]); - $I->searchAndMultiSelectOption("#selector", ["postnameExtend" . msq("extendParentData")]); + + $I->searchAndMultiSelectOption("#selector", ["otherName"]); // stepKey: getName + $I->searchAndMultiSelectOption("#selector", ["extendName"]); // stepKey: getNameExtend + $I->searchAndMultiSelectOption("#selector", ["item"]); // stepKey: emptyPost + $I->searchAndMultiSelectOption("#selector", [msq("extendParentData") . "prename"]); // stepKey: originalPre + $I->searchAndMultiSelectOption("#selector", ["postnameExtend" . msq("extendParentData")]); // stepKey: secondUniquePre } } diff --git a/dev/tests/verification/Resources/ExtendedActionGroup.txt b/dev/tests/verification/Resources/ExtendedActionGroup.txt index e321bfec1..66ecdbd8a 100644 --- a/dev/tests/verification/Resources/ExtendedActionGroup.txt +++ b/dev/tests/verification/Resources/ExtendedActionGroup.txt @@ -27,12 +27,12 @@ class ExtendedActionGroupCest */ public function ExtendedActionGroup(AcceptanceTester $I) { - $I->comment("Entering Action Group extendTestActionGroup (actionGroup)"); + $I->comment("Entering Action Group [actionGroup] extendTestActionGroup"); $I->comment("New Input Before"); - $grabProductsActionGroup = $I->grabMultiple("notASelector"); + $grabProductsActionGroup = $I->grabMultiple("notASelector"); // stepKey: grabProductsActionGroup $I->comment("New Input After"); - $I->assertCount(99, $grabProductsActionGroup); - $I->assertCount(8000, $grabProductsActionGroup); - $I->comment("Exiting Action Group extendTestActionGroup (actionGroup)"); + $I->assertCount(99, $grabProductsActionGroup); // stepKey: assertCountActionGroup + $I->assertCount(8000, $grabProductsActionGroup); // stepKey: assertSecondCountActionGroup + $I->comment("Exiting Action Group [actionGroup] extendTestActionGroup"); } } diff --git a/dev/tests/verification/Resources/ExtendedChildTestInSuiteCest.txt b/dev/tests/verification/Resources/ExtendedChildTestInSuiteCest.txt index da343e0e1..2483617d1 100644 --- a/dev/tests/verification/Resources/ExtendedChildTestInSuiteCest.txt +++ b/dev/tests/verification/Resources/ExtendedChildTestInSuiteCest.txt @@ -26,7 +26,7 @@ class ExtendedChildTestInSuiteCest */ public function _before(AcceptanceTester $I) { - $I->amOnPage("/beforeUrl"); + $I->amOnPage("/beforeUrl"); // stepKey: beforeAmOnPageKey } /** @@ -35,7 +35,7 @@ class ExtendedChildTestInSuiteCest */ public function _after(AcceptanceTester $I) { - $I->amOnPage("/afterUrl"); + $I->amOnPage("/afterUrl"); // stepKey: afterAmOnPageKey } /** @@ -44,7 +44,7 @@ class ExtendedChildTestInSuiteCest */ public function _failed(AcceptanceTester $I) { - $I->saveScreenshot(); + $I->saveScreenshot(); // stepKey: saveScreenshot } /** diff --git a/dev/tests/verification/Resources/ExtendedChildTestNotInSuite.txt b/dev/tests/verification/Resources/ExtendedChildTestNotInSuite.txt index cba6db454..cb5fc2e12 100644 --- a/dev/tests/verification/Resources/ExtendedChildTestNotInSuite.txt +++ b/dev/tests/verification/Resources/ExtendedChildTestNotInSuite.txt @@ -25,7 +25,7 @@ class ExtendedChildTestNotInSuiteCest */ public function _before(AcceptanceTester $I) { - $I->amOnPage("/beforeUrl"); + $I->amOnPage("/beforeUrl"); // stepKey: beforeAmOnPageKey } /** @@ -34,7 +34,7 @@ class ExtendedChildTestNotInSuiteCest */ public function _after(AcceptanceTester $I) { - $I->amOnPage("/afterUrl"); + $I->amOnPage("/afterUrl"); // stepKey: afterAmOnPageKey } /** @@ -43,7 +43,7 @@ class ExtendedChildTestNotInSuiteCest */ public function _failed(AcceptanceTester $I) { - $I->saveScreenshot(); + $I->saveScreenshot(); // stepKey: saveScreenshot } /** diff --git a/dev/tests/verification/Resources/ExtendedRemoveActionGroup.txt b/dev/tests/verification/Resources/ExtendedRemoveActionGroup.txt index 6d7e26d87..eed17340e 100644 --- a/dev/tests/verification/Resources/ExtendedRemoveActionGroup.txt +++ b/dev/tests/verification/Resources/ExtendedRemoveActionGroup.txt @@ -27,7 +27,7 @@ class ExtendedRemoveActionGroupCest */ public function ExtendedRemoveActionGroup(AcceptanceTester $I) { - $I->comment("Entering Action Group extendRemoveTestActionGroup (actionGroup)"); - $I->comment("Exiting Action Group extendRemoveTestActionGroup (actionGroup)"); + $I->comment("Entering Action Group [actionGroup] extendRemoveTestActionGroup"); + $I->comment("Exiting Action Group [actionGroup] extendRemoveTestActionGroup"); } } diff --git a/dev/tests/verification/Resources/ExtendingSkippedTest.txt b/dev/tests/verification/Resources/ExtendingSkippedTest.txt index 2275de057..b5632c030 100644 --- a/dev/tests/verification/Resources/ExtendingSkippedTest.txt +++ b/dev/tests/verification/Resources/ExtendingSkippedTest.txt @@ -26,7 +26,7 @@ class ExtendingSkippedTestCest */ public function _before(AcceptanceTester $I) { - $I->amOnPage("/beforeUrl"); + $I->amOnPage("/beforeUrl"); // stepKey: beforeAmOnPageKey } /** @@ -35,7 +35,7 @@ class ExtendingSkippedTestCest */ public function _after(AcceptanceTester $I) { - $I->amOnPage("/afterUrl"); + $I->amOnPage("/afterUrl"); // stepKey: afterAmOnPageKey } /** @@ -44,7 +44,7 @@ class ExtendingSkippedTestCest */ public function _failed(AcceptanceTester $I) { - $I->saveScreenshot(); + $I->saveScreenshot(); // stepKey: saveScreenshot } /** diff --git a/dev/tests/verification/Resources/HookActionsTest.txt b/dev/tests/verification/Resources/HookActionsTest.txt index 70e4ece10..74a49eca3 100644 --- a/dev/tests/verification/Resources/HookActionsTest.txt +++ b/dev/tests/verification/Resources/HookActionsTest.txt @@ -24,7 +24,7 @@ class HookActionsTestCest */ public function _before(AcceptanceTester $I) { - $I->amGoingTo("create entity that has the stepKey: sampleCreateBefore"); + $I->comment("[sampleCreateBefore] create 'sampleCreatedEntity' entity"); PersistedObjectHandler::getInstance()->createEntity( "sampleCreateBefore", "hook", @@ -32,12 +32,14 @@ class HookActionsTestCest [], null ); - $I->amGoingTo("delete entity that has the createDataKey: sampleCreateBefore"); + + $I->comment("[sampleDeleteBefore] delete entity 'sampleCreateBefore'"); PersistedObjectHandler::getInstance()->deleteEntity( "sampleCreateBefore", "hook" ); - $I->amGoingTo("create entity that has the stepKey: sampleCreateForAfter"); + + $I->comment("[sampleCreateForAfter] create 'sampleCreatedEntity' entity"); PersistedObjectHandler::getInstance()->createEntity( "sampleCreateForAfter", "hook", @@ -45,6 +47,7 @@ class HookActionsTestCest [], null ); + } /** @@ -53,7 +56,7 @@ class HookActionsTestCest */ public function _after(AcceptanceTester $I) { - $I->amGoingTo("create entity that has the stepKey: sampleCreateAfter"); + $I->comment("[sampleCreateAfter] create 'sampleCreatedEntity' entity"); PersistedObjectHandler::getInstance()->createEntity( "sampleCreateAfter", "hook", @@ -61,11 +64,13 @@ class HookActionsTestCest [], null ); - $I->amGoingTo("delete entity that has the createDataKey: sampleCreateForAfter"); + + $I->comment("[sampleDeleteAfter] delete entity 'sampleCreateForAfter'"); PersistedObjectHandler::getInstance()->deleteEntity( "sampleCreateForAfter", "hook" ); + } /** @@ -74,7 +79,7 @@ class HookActionsTestCest */ public function _failed(AcceptanceTester $I) { - $I->saveScreenshot(); + $I->saveScreenshot(); // stepKey: saveScreenshot } /** diff --git a/dev/tests/verification/Resources/LocatorFunctionTest.txt b/dev/tests/verification/Resources/LocatorFunctionTest.txt index bde511aac..4c96f100b 100644 --- a/dev/tests/verification/Resources/LocatorFunctionTest.txt +++ b/dev/tests/verification/Resources/LocatorFunctionTest.txt @@ -27,7 +27,7 @@ class LocatorFunctionTestCest */ public function LocatorFunctionTest(AcceptanceTester $I) { - $I->amGoingTo("create entity that has the stepKey: data"); + $I->comment("[data] create 'ReplacementPerson' entity"); PersistedObjectHandler::getInstance()->createEntity( "data", "test", @@ -35,17 +35,18 @@ class LocatorFunctionTestCest [], null ); - $I->click(Locator::contains("'label'", "'Name'")); - $I->click(Locator::contains("'label'", "'Name'")); - $I->click(Locator::find("'img'", ['title' => 'diagram'])); - $I->click(Locator::contains("string", "'Name'")); - $I->click(Locator::contains("John", "'Name'")); - $I->click(Locator::contains(PersistedObjectHandler::getInstance()->retrieveEntityField('data', 'key', 'test'), "'Name'")); - $I->click(Locator::contains("string1", "string2")); - $I->click(Locator::contains("John", "Doe")); - $I->click(Locator::contains(PersistedObjectHandler::getInstance()->retrieveEntityField('data', 'key1', 'test'), PersistedObjectHandler::getInstance()->retrieveEntityField('data', 'key2', 'test'))); - $I->click(Locator::contains("string1", "John")); - $I->click(Locator::contains("string1", PersistedObjectHandler::getInstance()->retrieveEntityField('data', 'key1', 'test'))); - $I->click(Locator::contains("John", PersistedObjectHandler::getInstance()->retrieveEntityField('data', 'key1', 'test'))); + + $I->click(Locator::contains("'label'", "'Name'")); // stepKey: SimpleLocator + $I->click(Locator::contains("'label'", "'Name'")); // stepKey: SimpleLocatorNonShorthand + $I->click(Locator::find("'img'", ['title' => 'diagram'])); // stepKey: ArrayLocator + $I->click(Locator::contains("string", "'Name'")); // stepKey: OneParamLiteral + $I->click(Locator::contains("John", "'Name'")); // stepKey: OneParamData + $I->click(Locator::contains(PersistedObjectHandler::getInstance()->retrieveEntityField('data', 'key', 'test'), "'Name'")); // stepKey: OneParamPersisted + $I->click(Locator::contains("string1", "string2")); // stepKey: TwoParamLiteral + $I->click(Locator::contains("John", "Doe")); // stepKey: TwoParamData + $I->click(Locator::contains(PersistedObjectHandler::getInstance()->retrieveEntityField('data', 'key1', 'test'), PersistedObjectHandler::getInstance()->retrieveEntityField('data', 'key2', 'test'))); // stepKey: TwoParamPersisted + $I->click(Locator::contains("string1", "John")); // stepKey: TwoParamMix1 + $I->click(Locator::contains("string1", PersistedObjectHandler::getInstance()->retrieveEntityField('data', 'key1', 'test'))); // stepKey: TwoParamMix2 + $I->click(Locator::contains("John", PersistedObjectHandler::getInstance()->retrieveEntityField('data', 'key1', 'test'))); // stepKey: TwoParamMix3 } } diff --git a/dev/tests/verification/Resources/MergeMassViaInsertAfter.txt b/dev/tests/verification/Resources/MergeMassViaInsertAfter.txt index 5c5091566..2588e679a 100644 --- a/dev/tests/verification/Resources/MergeMassViaInsertAfter.txt +++ b/dev/tests/verification/Resources/MergeMassViaInsertAfter.txt @@ -27,11 +27,11 @@ class MergeMassViaInsertAfterCest */ public function MergeMassViaInsertAfter(AcceptanceTester $I) { - $I->fillField("#foo", "foo"); - $I->fillField("#bar", "bar"); - $I->click("#mergeOne"); - $I->click("#mergeTwo"); - $I->click("#mergeThree"); - $I->fillField("#baz", "baz"); + $I->fillField("#foo", "foo"); // stepKey: fillField1 + $I->fillField("#bar", "bar"); // stepKey: fillField2 + $I->click("#mergeOne"); // stepKey: clickOne + $I->click("#mergeTwo"); // stepKey: clickTwo + $I->click("#mergeThree"); // stepKey: clickThree + $I->fillField("#baz", "baz"); // stepKey: fillField3 } } diff --git a/dev/tests/verification/Resources/MergeMassViaInsertBefore.txt b/dev/tests/verification/Resources/MergeMassViaInsertBefore.txt index 94982ec21..7f220c2b7 100644 --- a/dev/tests/verification/Resources/MergeMassViaInsertBefore.txt +++ b/dev/tests/verification/Resources/MergeMassViaInsertBefore.txt @@ -27,11 +27,11 @@ class MergeMassViaInsertBeforeCest */ public function MergeMassViaInsertBefore(AcceptanceTester $I) { - $I->fillField("#foo", "foo"); - $I->click("#mergeOne"); - $I->click("#mergeTwo"); - $I->click("#mergeThree"); - $I->fillField("#bar", "bar"); - $I->fillField("#baz", "baz"); + $I->fillField("#foo", "foo"); // stepKey: fillField1 + $I->click("#mergeOne"); // stepKey: clickOne + $I->click("#mergeTwo"); // stepKey: clickTwo + $I->click("#mergeThree"); // stepKey: clickThree + $I->fillField("#bar", "bar"); // stepKey: fillField2 + $I->fillField("#baz", "baz"); // stepKey: fillField3 } } diff --git a/dev/tests/verification/Resources/MergedActionGroupTest.txt b/dev/tests/verification/Resources/MergedActionGroupTest.txt index 3a5da8725..03ab1287b 100644 --- a/dev/tests/verification/Resources/MergedActionGroupTest.txt +++ b/dev/tests/verification/Resources/MergedActionGroupTest.txt @@ -25,7 +25,7 @@ class MergedActionGroupTestCest */ public function _before(AcceptanceTester $I) { - $I->amGoingTo("create entity that has the stepKey: createPersonParam"); + $I->comment("[createPersonParam] create 'ReplacementPerson' entity"); PersistedObjectHandler::getInstance()->createEntity( "createPersonParam", "hook", @@ -33,10 +33,11 @@ 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)"); + + $I->comment("Entering Action Group [beforeGroup] FunctionalActionGroup"); + $I->fillField("#foo", "myData1"); // stepKey: fillField1BeforeGroup + $I->fillField("#bar", "myData2"); // stepKey: fillField2BeforeGroup + $I->comment("Exiting Action Group [beforeGroup] FunctionalActionGroup"); } /** @@ -45,10 +46,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)"); + $I->comment("Entering Action Group [afterGroup] FunctionalActionGroup"); + $I->fillField("#foo", "myData1"); // stepKey: fillField1AfterGroup + $I->fillField("#bar", "myData2"); // stepKey: fillField2AfterGroup + $I->comment("Exiting Action Group [afterGroup] FunctionalActionGroup"); } /** @@ -57,7 +58,7 @@ class MergedActionGroupTestCest */ public function _failed(AcceptanceTester $I) { - $I->saveScreenshot(); + $I->saveScreenshot(); // stepKey: saveScreenshot } /** @@ -71,11 +72,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)"); + $I->comment("Entering Action Group [actionGroupForMerge] FunctionalActionGroupForMerge"); + $I->see(".merge .Jane"); // stepKey: myMergedSeeElementActionGroupForMerge + $I->see("#element .Jane"); // stepKey: see1ActionGroupForMerge + $I->amOnPage("/Jane/Dane.html"); // stepKey: amOnPage1ActionGroupForMerge + $I->click(".merge .Dane"); // stepKey: myMergedClickActionGroupForMerge + $I->comment("Exiting Action Group [actionGroupForMerge] FunctionalActionGroupForMerge"); } } diff --git a/dev/tests/verification/Resources/MergedReferencesTest.txt b/dev/tests/verification/Resources/MergedReferencesTest.txt index 3f47703b9..456f66cc1 100644 --- a/dev/tests/verification/Resources/MergedReferencesTest.txt +++ b/dev/tests/verification/Resources/MergedReferencesTest.txt @@ -26,7 +26,7 @@ class MergedReferencesTestCest */ public function _before(AcceptanceTester $I) { - $I->amOnPage("/beforeUrl"); + $I->amOnPage("/beforeUrl"); // stepKey: before1 } /** @@ -35,7 +35,7 @@ class MergedReferencesTestCest */ public function _after(AcceptanceTester $I) { - $I->amOnPage("/afterUrl"); + $I->amOnPage("/afterUrl"); // stepKey: after1 } /** @@ -44,7 +44,7 @@ class MergedReferencesTestCest */ public function _failed(AcceptanceTester $I) { - $I->saveScreenshot(); + $I->saveScreenshot(); // stepKey: saveScreenshot } /** @@ -58,7 +58,7 @@ class MergedReferencesTestCest */ public function MergedReferencesTest(AcceptanceTester $I) { - $I->fillField("#merge", "merged"); - $I->fillField("#newElement", "newField"); + $I->fillField("#merge", "merged"); // stepKey: fillField1 + $I->fillField("#newElement", "newField"); // stepKey: fillField2 } } diff --git a/dev/tests/verification/Resources/MultipleActionGroupsTest.txt b/dev/tests/verification/Resources/MultipleActionGroupsTest.txt index ba99de0cb..e0796ae39 100644 --- a/dev/tests/verification/Resources/MultipleActionGroupsTest.txt +++ b/dev/tests/verification/Resources/MultipleActionGroupsTest.txt @@ -25,7 +25,7 @@ class MultipleActionGroupsTestCest */ public function _before(AcceptanceTester $I) { - $I->amGoingTo("create entity that has the stepKey: createPersonParam"); + $I->comment("[createPersonParam] create 'ReplacementPerson' entity"); PersistedObjectHandler::getInstance()->createEntity( "createPersonParam", "hook", @@ -33,10 +33,11 @@ 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)"); + + $I->comment("Entering Action Group [beforeGroup] FunctionalActionGroup"); + $I->fillField("#foo", "myData1"); // stepKey: fillField1BeforeGroup + $I->fillField("#bar", "myData2"); // stepKey: fillField2BeforeGroup + $I->comment("Exiting Action Group [beforeGroup] FunctionalActionGroup"); } /** @@ -45,10 +46,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)"); + $I->comment("Entering Action Group [afterGroup] FunctionalActionGroup"); + $I->fillField("#foo", "myData1"); // stepKey: fillField1AfterGroup + $I->fillField("#bar", "myData2"); // stepKey: fillField2AfterGroup + $I->comment("Exiting Action Group [afterGroup] FunctionalActionGroup"); } /** @@ -57,7 +58,7 @@ class MultipleActionGroupsTestCest */ public function _failed(AcceptanceTester $I) { - $I->saveScreenshot(); + $I->saveScreenshot(); // stepKey: saveScreenshot } /** @@ -71,21 +72,21 @@ 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)"); + $I->amOnPage("/someUrl"); // stepKey: step1 + $I->comment("Entering Action Group [actionGroup1] FunctionalActionGroupWithData"); + $I->amOnPage("/Jane/Dane.html"); // stepKey: amOnPage1ActionGroup1 + $I->fillField("#foo", "Jane"); // stepKey: fillField1ActionGroup1 + $I->fillField("#bar", "Dane"); // stepKey: fillField2ActionGroup1 + $I->searchAndMultiSelectOption("#foo", ["Jane", "Dane"]); // stepKey: multi1ActionGroup1 + $I->see("#element .Jane"); // stepKey: see1ActionGroup1 + $I->comment("Exiting Action Group [actionGroup1] FunctionalActionGroupWithData"); + $I->click("loginButton"); // stepKey: step6 + $I->comment("Entering Action Group [actionGroupWithDataOverride2] FunctionalActionGroupWithData"); + $I->amOnPage("/John/Doe.html"); // stepKey: amOnPage1ActionGroupWithDataOverride2 + $I->fillField("#foo", "John"); // stepKey: fillField1ActionGroupWithDataOverride2 + $I->fillField("#bar", "Doe"); // stepKey: fillField2ActionGroupWithDataOverride2 + $I->searchAndMultiSelectOption("#foo", ["John", "Doe"]); // stepKey: multi1ActionGroupWithDataOverride2 + $I->see("#element .John"); // stepKey: see1ActionGroupWithDataOverride2 + $I->comment("Exiting Action Group [actionGroupWithDataOverride2] FunctionalActionGroupWithData"); } } diff --git a/dev/tests/verification/Resources/PageReplacementTest.txt b/dev/tests/verification/Resources/PageReplacementTest.txt index 01ddedf78..6b27b55b1 100644 --- a/dev/tests/verification/Resources/PageReplacementTest.txt +++ b/dev/tests/verification/Resources/PageReplacementTest.txt @@ -27,7 +27,7 @@ class PageReplacementTestCest */ public function PageReplacementTest(AcceptanceTester $I) { - $I->amGoingTo("create entity that has the stepKey: datakey"); + $I->comment("[datakey] create 'simpleData' entity"); PersistedObjectHandler::getInstance()->createEntity( "datakey", "test", @@ -35,16 +35,17 @@ class PageReplacementTestCest [], null ); - $I->amOnPage("/page.html"); - $I->amOnPage("/StringLiteral/page.html"); - $I->amOnPage("/John/page.html"); - $I->amOnPage("/" . PersistedObjectHandler::getInstance()->retrieveEntityField('datakey', 'firstname', 'test') . "/page.html"); - $I->amOnPage("/StringLiteral1/StringLiteral2.html"); - $I->amOnPage("/John/StringLiteral2.html"); - $I->amOnPage("/John/" . PersistedObjectHandler::getInstance()->retrieveEntityField('datakey', 'firstname', 'test') . ".html"); - $I->amOnPage("/" . PersistedObjectHandler::getInstance()->retrieveEntityField('datakey', 'firstname', 'test') . "/StringLiteral2.html"); - $I->amOnPage("/" . getenv("MAGENTO_BACKEND_NAME") . "/backend"); - $I->amOnPage("/" . getenv("MAGENTO_BACKEND_NAME") . "/StringLiteral/page.html"); - $I->amOnUrl("http://myFullUrl.com/"); + + $I->amOnPage("/page.html"); // stepKey: noParamPage + $I->amOnPage("/StringLiteral/page.html"); // stepKey: oneParamPageString + $I->amOnPage("/John/page.html"); // stepKey: oneParamPageData + $I->amOnPage("/" . PersistedObjectHandler::getInstance()->retrieveEntityField('datakey', 'firstname', 'test') . "/page.html"); // stepKey: oneParamPagePersist + $I->amOnPage("/StringLiteral1/StringLiteral2.html"); // stepKey: twoParamPageString + $I->amOnPage("/John/StringLiteral2.html"); // stepKey: twoParamPageStringData + $I->amOnPage("/John/" . PersistedObjectHandler::getInstance()->retrieveEntityField('datakey', 'firstname', 'test') . ".html"); // stepKey: twoParamPageDataPersist + $I->amOnPage("/" . PersistedObjectHandler::getInstance()->retrieveEntityField('datakey', 'firstname', 'test') . "/StringLiteral2.html"); // stepKey: twoParamPagePersistString + $I->amOnPage("/" . getenv("MAGENTO_BACKEND_NAME") . "/backend"); // stepKey: onAdminPage + $I->amOnPage("/" . getenv("MAGENTO_BACKEND_NAME") . "/StringLiteral/page.html"); // stepKey: oneParamAdminPageString + $I->amOnUrl("http://myFullUrl.com/"); // stepKey: onExternalPage } } diff --git a/dev/tests/verification/Resources/ParameterArrayTest.txt b/dev/tests/verification/Resources/ParameterArrayTest.txt index 76e1bed32..8f49ca05c 100644 --- a/dev/tests/verification/Resources/ParameterArrayTest.txt +++ b/dev/tests/verification/Resources/ParameterArrayTest.txt @@ -27,7 +27,7 @@ class ParameterArrayTestCest */ public function ParameterArrayTest(AcceptanceTester $I) { - $I->amGoingTo("create entity that has the stepKey: simpleDataKey"); + $I->comment("[simpleDataKey] create 'simpleParamData' entity"); PersistedObjectHandler::getInstance()->createEntity( "simpleDataKey", "test", @@ -35,27 +35,28 @@ class ParameterArrayTestCest [], null ); - $I->searchAndMultiSelectOption("#selector", ["name"]); - $I->searchAndMultiSelectOption("#selector", [msq("simpleParamData") . "prename"]); - $I->searchAndMultiSelectOption("#selector", ["postname" . msq("simpleParamData")]); - $I->searchAndMultiSelectOption("#selector", [PersistedObjectHandler::getInstance()->retrieveEntityField('simpleDataKey', 'name', 'test')]); - $I->searchAndMultiSelectOption("#selector", ["name", PersistedObjectHandler::getInstance()->retrieveEntityField('simpleDataKey', 'name', 'test')]); - $I->searchAndMultiSelectOption("#selector", ['someKey' => PersistedObjectHandler::getInstance()->retrieveEntityField('simpleDataKey', 'name', 'test')]); - $I->searchAndMultiSelectOption("#selector", ['someKey' => "name"]); - $I->searchAndMultiSelectOption("#selector", ['someKey' => msq("simpleParamData") . "prename"]); - $I->searchAndMultiSelectOption("#selector", ['someKey' => "postname" . msq("simpleParamData")]); - $I->unselectOption("#selector", ['foo']); - $I->unselectOption("#selector", ['foo', 'bar']); - $I->unselectOption("#selector", ["name"]); - $I->unselectOption("#selector", [msq("simpleParamData") . "prename"]); - $I->unselectOption("#selector", ["postname" . msq("simpleParamData")]); - $I->unselectOption("#selector", [PersistedObjectHandler::getInstance()->retrieveEntityField('simpleDataKey', 'name', 'test')]); - $I->unselectOption("#selector", ["name", PersistedObjectHandler::getInstance()->retrieveEntityField('simpleDataKey', 'name', 'test')]); - $I->pressKey("#selector", PersistedObjectHandler::getInstance()->retrieveEntityField('simpleDataKey', 'name', 'test'), ['ctrl', 'a'],\Facebook\WebDriver\WebDriverKeys::DELETE,PersistedObjectHandler::getInstance()->retrieveEntityField('simpleDataKey', 'name', 'test')); - $I->pressKey("#selector", ['ctrl', 'a'], 10, 20,\Facebook\WebDriver\WebDriverKeys::DELETE,PersistedObjectHandler::getInstance()->retrieveEntityField('simpleDataKey', 'name', 'test')); - $I->pressKey("#selector", ['ctrl', 'a'],'new', 10, 20,\Facebook\WebDriver\WebDriverKeys::DELETE,PersistedObjectHandler::getInstance()->retrieveEntityField('simpleDataKey', 'name', 'test')); - $I->pressKey("#selector", ['ctrl', 'a'],'new', 1, ['ctrl'], ['shift', 'ctrl', 'del'], [PersistedObjectHandler::getInstance()->retrieveEntityField('simpleDataKey', 'name', 'test'), 'a', "name"]); - $I->pressKey("#selector", ['ctrl', 'a'],'new', 1, ['ctrl'], ['shift', 'ctrl', 'del'], 0, [PersistedObjectHandler::getInstance()->retrieveEntityField('simpleDataKey', 'name', 'test'), PersistedObjectHandler::getInstance()->retrieveEntityField('simpleDataKey', 'name', 'test')]); - $I->pressKey("#selector", ['ctrl', 'a'],'new', 1, ['ctrl'], ['shift', 'ctrl', 'del'], [msq("simpleParamData") . "prename", "postname" . msq("simpleParamData")]); + + $I->searchAndMultiSelectOption("#selector", ["name"]); // stepKey: xmlSimpleReplace + $I->searchAndMultiSelectOption("#selector", [msq("simpleParamData") . "prename"]); // stepKey: xmlPrefix + $I->searchAndMultiSelectOption("#selector", ["postname" . msq("simpleParamData")]); // stepKey: xmlSuffix + $I->searchAndMultiSelectOption("#selector", [PersistedObjectHandler::getInstance()->retrieveEntityField('simpleDataKey', 'name', 'test')]); // stepKey: persistSimple + $I->searchAndMultiSelectOption("#selector", ["name", PersistedObjectHandler::getInstance()->retrieveEntityField('simpleDataKey', 'name', 'test')]); // stepKey: persistXmlSimple + $I->searchAndMultiSelectOption("#selector", ['someKey' => PersistedObjectHandler::getInstance()->retrieveEntityField('simpleDataKey', 'name', 'test')]); // stepKey: literalKeyToPersist + $I->searchAndMultiSelectOption("#selector", ['someKey' => "name"]); // stepKey: literalKeyToStatic + $I->searchAndMultiSelectOption("#selector", ['someKey' => msq("simpleParamData") . "prename"]); // stepKey: literalKeyToPrefixUnique + $I->searchAndMultiSelectOption("#selector", ['someKey' => "postname" . msq("simpleParamData")]); // stepKey: literalKeyToSuffixUnique + $I->unselectOption("#selector", ['foo']); // stepKey: 000 + $I->unselectOption("#selector", ['foo', 'bar']); // stepKey: 001 + $I->unselectOption("#selector", ["name"]); // stepKey: 002 + $I->unselectOption("#selector", [msq("simpleParamData") . "prename"]); // stepKey: 003 + $I->unselectOption("#selector", ["postname" . msq("simpleParamData")]); // stepKey: 004 + $I->unselectOption("#selector", [PersistedObjectHandler::getInstance()->retrieveEntityField('simpleDataKey', 'name', 'test')]); // stepKey: 005 + $I->unselectOption("#selector", ["name", PersistedObjectHandler::getInstance()->retrieveEntityField('simpleDataKey', 'name', 'test')]); // stepKey: 006 + $I->pressKey("#selector", PersistedObjectHandler::getInstance()->retrieveEntityField('simpleDataKey', 'name', 'test'), ['ctrl', 'a'],\Facebook\WebDriver\WebDriverKeys::DELETE,PersistedObjectHandler::getInstance()->retrieveEntityField('simpleDataKey', 'name', 'test')); // stepKey: pressKey001 + $I->pressKey("#selector", ['ctrl', 'a'], 10, 20,\Facebook\WebDriver\WebDriverKeys::DELETE,PersistedObjectHandler::getInstance()->retrieveEntityField('simpleDataKey', 'name', 'test')); // stepKey: pressKey002 + $I->pressKey("#selector", ['ctrl', 'a'],'new', 10, 20,\Facebook\WebDriver\WebDriverKeys::DELETE,PersistedObjectHandler::getInstance()->retrieveEntityField('simpleDataKey', 'name', 'test')); // stepKey: pressKey003 + $I->pressKey("#selector", ['ctrl', 'a'],'new', 1, ['ctrl'], ['shift', 'ctrl', 'del'], [PersistedObjectHandler::getInstance()->retrieveEntityField('simpleDataKey', 'name', 'test'), 'a', "name"]); // stepKey: pressKey004 + $I->pressKey("#selector", ['ctrl', 'a'],'new', 1, ['ctrl'], ['shift', 'ctrl', 'del'], 0, [PersistedObjectHandler::getInstance()->retrieveEntityField('simpleDataKey', 'name', 'test'), PersistedObjectHandler::getInstance()->retrieveEntityField('simpleDataKey', 'name', 'test')]); // stepKey: pressKey005 + $I->pressKey("#selector", ['ctrl', 'a'],'new', 1, ['ctrl'], ['shift', 'ctrl', 'del'], [msq("simpleParamData") . "prename", "postname" . msq("simpleParamData")]); // stepKey: pressKey006 } } diff --git a/dev/tests/verification/Resources/ParentExtendedTest.txt b/dev/tests/verification/Resources/ParentExtendedTest.txt index c3d7217b3..7c0375190 100644 --- a/dev/tests/verification/Resources/ParentExtendedTest.txt +++ b/dev/tests/verification/Resources/ParentExtendedTest.txt @@ -26,7 +26,7 @@ class ParentExtendedTestCest */ public function _before(AcceptanceTester $I) { - $I->amOnPage("/beforeUrl"); + $I->amOnPage("/beforeUrl"); // stepKey: beforeAmOnPageKey } /** @@ -35,7 +35,7 @@ class ParentExtendedTestCest */ public function _after(AcceptanceTester $I) { - $I->amOnPage("/afterUrl"); + $I->amOnPage("/afterUrl"); // stepKey: afterAmOnPageKey } /** @@ -44,7 +44,7 @@ class ParentExtendedTestCest */ public function _failed(AcceptanceTester $I) { - $I->saveScreenshot(); + $I->saveScreenshot(); // stepKey: saveScreenshot } /** diff --git a/dev/tests/verification/Resources/PersistedAndXmlEntityArguments.txt b/dev/tests/verification/Resources/PersistedAndXmlEntityArguments.txt index 510e99018..7840afc76 100644 --- a/dev/tests/verification/Resources/PersistedAndXmlEntityArguments.txt +++ b/dev/tests/verification/Resources/PersistedAndXmlEntityArguments.txt @@ -27,8 +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)"); + $I->comment("Entering Action Group [afterGroup] FunctionalActionGroupWithXmlAndPersistedData"); + $I->seeInCurrentUrl("/" . PersistedObjectHandler::getInstance()->retrieveEntityField('persistedInTest', 'urlKey', 'test') . ".html?___store=" . msq("uniqueData") . "John"); // stepKey: checkUrlAfterGroup + $I->comment("Exiting Action Group [afterGroup] FunctionalActionGroupWithXmlAndPersistedData"); } } diff --git a/dev/tests/verification/Resources/PersistedReplacementTest.txt b/dev/tests/verification/Resources/PersistedReplacementTest.txt index c19e33ee7..2c5d99bc2 100644 --- a/dev/tests/verification/Resources/PersistedReplacementTest.txt +++ b/dev/tests/verification/Resources/PersistedReplacementTest.txt @@ -24,7 +24,7 @@ class PersistedReplacementTestCest */ public function _before(AcceptanceTester $I) { - $I->amGoingTo("create entity that has the stepKey: createData1"); + $I->comment("[createData1] create 'ReplacementPerson' entity"); PersistedObjectHandler::getInstance()->createEntity( "createData1", "hook", @@ -32,6 +32,7 @@ class PersistedReplacementTestCest [], null ); + } /** @@ -43,7 +44,7 @@ class PersistedReplacementTestCest */ public function PersistedReplacementTest(AcceptanceTester $I) { - $I->amGoingTo("create entity that has the stepKey: createdData"); + $I->comment("[createdData] create 'simpleData' entity"); PersistedObjectHandler::getInstance()->createEntity( "createdData", "test", @@ -51,15 +52,16 @@ class PersistedReplacementTestCest [], null ); - $I->fillField("#selector", "StringBefore " . PersistedObjectHandler::getInstance()->retrieveEntityField('createdData', 'firstname', 'test') . " StringAfter"); - $I->fillField("#" . PersistedObjectHandler::getInstance()->retrieveEntityField('createdData', 'firstname', 'test'), "input"); - $I->fillField("#" . getenv("MAGENTO_BASE_URL") . "#" . PersistedObjectHandler::getInstance()->retrieveEntityField('createdData', 'firstname', 'test'), "input"); - $I->fillSecretField("#" . CredentialStore::getInstance()->getSecret("SECRET_PARAM") . "#" . PersistedObjectHandler::getInstance()->retrieveEntityField('createdData', 'firstname', 'test'), "input"); - $I->dragAndDrop("#" . PersistedObjectHandler::getInstance()->retrieveEntityField('createdData', 'firstname', 'test'), PersistedObjectHandler::getInstance()->retrieveEntityField('createdData', 'lastname', 'test')); - $I->conditionalClick(PersistedObjectHandler::getInstance()->retrieveEntityField('createdData', 'lastname', 'test'), "#" . PersistedObjectHandler::getInstance()->retrieveEntityField('createdData', 'firstname', 'test'), true); - $I->amOnUrl(PersistedObjectHandler::getInstance()->retrieveEntityField('createdData', 'firstname', 'test') . ".html"); - $I->searchAndMultiSelectOption("#selector", [PersistedObjectHandler::getInstance()->retrieveEntityField('createdData', 'firstname', 'test'), PersistedObjectHandler::getInstance()->retrieveEntityField('createdData', 'lastname', 'test')]); - $I->fillField("#selector", "John " . PersistedObjectHandler::getInstance()->retrieveEntityField('createdData', 'firstname', 'test') . " stringLiteral"); - $I->searchAndMultiSelectOption("#selector", [PersistedObjectHandler::getInstance()->retrieveEntityField('createdData', 'firstname', 'test'), "John", "stringLiteral"]); + + $I->fillField("#selector", "StringBefore " . PersistedObjectHandler::getInstance()->retrieveEntityField('createdData', 'firstname', 'test') . " StringAfter"); // stepKey: inputReplace + $I->fillField("#" . PersistedObjectHandler::getInstance()->retrieveEntityField('createdData', 'firstname', 'test'), "input"); // stepKey: selectorReplace + $I->fillField("#" . getenv("MAGENTO_BASE_URL") . "#" . PersistedObjectHandler::getInstance()->retrieveEntityField('createdData', 'firstname', 'test'), "input"); // stepKey: selectorReplace2 + $I->fillSecretField("#" . CredentialStore::getInstance()->getSecret("SECRET_PARAM") . "#" . PersistedObjectHandler::getInstance()->retrieveEntityField('createdData', 'firstname', 'test'), "input"); // stepKey: selectorReplace3 + $I->dragAndDrop("#" . PersistedObjectHandler::getInstance()->retrieveEntityField('createdData', 'firstname', 'test'), PersistedObjectHandler::getInstance()->retrieveEntityField('createdData', 'lastname', 'test')); // stepKey: selector12Replace + $I->conditionalClick(PersistedObjectHandler::getInstance()->retrieveEntityField('createdData', 'lastname', 'test'), "#" . PersistedObjectHandler::getInstance()->retrieveEntityField('createdData', 'firstname', 'test'), true); // stepKey: dependentSelectorReplace + $I->amOnUrl(PersistedObjectHandler::getInstance()->retrieveEntityField('createdData', 'firstname', 'test') . ".html"); // stepKey: urlReplace + $I->searchAndMultiSelectOption("#selector", [PersistedObjectHandler::getInstance()->retrieveEntityField('createdData', 'firstname', 'test'), PersistedObjectHandler::getInstance()->retrieveEntityField('createdData', 'lastname', 'test')]); // stepKey: parameterArrayReplacement + $I->fillField("#selector", "John " . PersistedObjectHandler::getInstance()->retrieveEntityField('createdData', 'firstname', 'test') . " stringLiteral"); // stepKey: allTypesMixed + $I->searchAndMultiSelectOption("#selector", [PersistedObjectHandler::getInstance()->retrieveEntityField('createdData', 'firstname', 'test'), "John", "stringLiteral"]); // stepKey: parameterArrayMixed } } diff --git a/dev/tests/verification/Resources/PersistenceActionGroupAppendingTest.txt b/dev/tests/verification/Resources/PersistenceActionGroupAppendingTest.txt index e255a0338..af6507abc 100644 --- a/dev/tests/verification/Resources/PersistenceActionGroupAppendingTest.txt +++ b/dev/tests/verification/Resources/PersistenceActionGroupAppendingTest.txt @@ -24,8 +24,8 @@ class PersistenceActionGroupAppendingTestCest */ public function _before(AcceptanceTester $I) { - $I->comment("Entering Action Group DataPersistenceAppendingActionGroup (ACTIONGROUPBEFORE)"); - $I->amGoingTo("create entity that has the stepKey: createDataACTIONGROUPBEFORE"); + $I->comment("Entering Action Group [ACTIONGROUPBEFORE] DataPersistenceAppendingActionGroup"); + $I->comment("[createDataACTIONGROUPBEFORE] create 'entity' entity"); PersistedObjectHandler::getInstance()->createEntity( "createDataACTIONGROUPBEFORE", "hook", @@ -33,19 +33,22 @@ class PersistenceActionGroupAppendingTestCest [], null ); - $I->amGoingTo("update entity that has the createdDataKey: createDataACTIONGROUPBEFORE"); + + $I->comment("[updateDataACTIONGROUPBEFORE] update 'createDataACTIONGROUPBEFORE' entity to 'newEntity'"); PersistedObjectHandler::getInstance()->updateEntity( "createDataACTIONGROUPBEFORE", "hook", "newEntity", [] ); - $I->amGoingTo("delete entity that has the createDataKey: createDataACTIONGROUPBEFORE"); + + $I->comment("[deleteDataACTIONGROUPBEFORE] delete entity 'createDataACTIONGROUPBEFORE'"); PersistedObjectHandler::getInstance()->deleteEntity( "createDataACTIONGROUPBEFORE", "hook" ); - $I->amGoingTo("get entity that has the stepKey: getDataACTIONGROUPBEFORE"); + + $I->comment("[getDataACTIONGROUPBEFORE] get 'someEneity' entity"); PersistedObjectHandler::getInstance()->getEntity( "getDataACTIONGROUPBEFORE", "hook", @@ -53,8 +56,9 @@ class PersistenceActionGroupAppendingTestCest [], null ); + $I->comment(PersistedObjectHandler::getInstance()->retrieveEntityField('createData', 'field', 'hook')); - $I->comment("Exiting Action Group DataPersistenceAppendingActionGroup (ACTIONGROUPBEFORE)"); + $I->comment("Exiting Action Group [ACTIONGROUPBEFORE] DataPersistenceAppendingActionGroup"); } /** @@ -66,8 +70,8 @@ class PersistenceActionGroupAppendingTestCest */ public function PersistenceActionGroupAppendingTest(AcceptanceTester $I) { - $I->comment("Entering Action Group DataPersistenceAppendingActionGroup (ACTIONGROUP)"); - $I->amGoingTo("create entity that has the stepKey: createDataACTIONGROUP"); + $I->comment("Entering Action Group [ACTIONGROUP] DataPersistenceAppendingActionGroup"); + $I->comment("[createDataACTIONGROUP] create 'entity' entity"); PersistedObjectHandler::getInstance()->createEntity( "createDataACTIONGROUP", "test", @@ -75,19 +79,22 @@ class PersistenceActionGroupAppendingTestCest [], null ); - $I->amGoingTo("update entity that has the createdDataKey: createDataACTIONGROUP"); + + $I->comment("[updateDataACTIONGROUP] update 'createDataACTIONGROUP' entity to 'newEntity'"); PersistedObjectHandler::getInstance()->updateEntity( "createDataACTIONGROUP", "test", "newEntity", [] ); - $I->amGoingTo("delete entity that has the createDataKey: createDataACTIONGROUP"); + + $I->comment("[deleteDataACTIONGROUP] delete entity 'createDataACTIONGROUP'"); PersistedObjectHandler::getInstance()->deleteEntity( "createDataACTIONGROUP", "test" ); - $I->amGoingTo("get entity that has the stepKey: getDataACTIONGROUP"); + + $I->comment("[getDataACTIONGROUP] get 'someEneity' entity"); PersistedObjectHandler::getInstance()->getEntity( "getDataACTIONGROUP", "test", @@ -95,7 +102,8 @@ class PersistenceActionGroupAppendingTestCest [], null ); + $I->comment(PersistedObjectHandler::getInstance()->retrieveEntityField('createDataACTIONGROUP', 'field', 'test')); - $I->comment("Exiting Action Group DataPersistenceAppendingActionGroup (ACTIONGROUP)"); + $I->comment("Exiting Action Group [ACTIONGROUP] DataPersistenceAppendingActionGroup"); } } diff --git a/dev/tests/verification/Resources/PersistenceCustomFieldsTest.txt b/dev/tests/verification/Resources/PersistenceCustomFieldsTest.txt index 2db1b498f..92b128808 100644 --- a/dev/tests/verification/Resources/PersistenceCustomFieldsTest.txt +++ b/dev/tests/verification/Resources/PersistenceCustomFieldsTest.txt @@ -25,8 +25,10 @@ class PersistenceCustomFieldsTestCest public function _before(AcceptanceTester $I) { $createData1Fields['firstname'] = "Mac"; + // stepKey: createData1Firstname $createData1Fields['lastname'] = "Doe"; - $I->amGoingTo("create entity that has the stepKey: createData1"); + // stepKey: createData1Lastname + $I->comment("[createData1] create 'DefaultPerson' entity"); PersistedObjectHandler::getInstance()->createEntity( "createData1", "hook", @@ -34,8 +36,10 @@ class PersistenceCustomFieldsTestCest [], $createData1Fields ); + $createData2Fields['firstname'] = PersistedObjectHandler::getInstance()->retrieveEntityField('createData1', 'firstname', 'hook'); - $I->amGoingTo("create entity that has the stepKey: createData2"); + // stepKey: createData2Firstname + $I->comment("[createData2] create 'uniqueData' entity"); PersistedObjectHandler::getInstance()->createEntity( "createData2", "hook", @@ -43,6 +47,7 @@ class PersistenceCustomFieldsTestCest ["createData1"], $createData2Fields ); + } /** @@ -55,8 +60,10 @@ class PersistenceCustomFieldsTestCest public function PersistenceCustomFieldsTest(AcceptanceTester $I) { $createdDataFields['favoriteIndex'] = "1"; + // stepKey: createdDataFavoriteIndex $createdDataFields['middlename'] = "Kovacs"; - $I->amGoingTo("create entity that has the stepKey: createdData"); + // stepKey: createdDataMiddlename + $I->comment("[createdData] create 'simpleData' entity"); PersistedObjectHandler::getInstance()->createEntity( "createdData", "test", @@ -64,9 +71,12 @@ class PersistenceCustomFieldsTestCest [], $createdDataFields ); + $createdData3Fields['firstname'] = "Takeshi"; + // stepKey: createdData3Firstname $createdData3Fields['lastname'] = "Kovacs"; - $I->amGoingTo("create entity that has the stepKey: createdData3"); + // stepKey: createdData3Lastname + $I->comment("[createdData3] create 'UniquePerson' entity"); PersistedObjectHandler::getInstance()->createEntity( "createdData3", "test", @@ -74,9 +84,11 @@ class PersistenceCustomFieldsTestCest ["createdData"], $createdData3Fields ); - $I->comment("Entering Action Group PersistenceActionGroup (createdAG)"); + + $I->comment("Entering Action Group [createdAG] PersistenceActionGroup"); $createDataAG1CreatedAGFields['firstname'] = "string1"; - $I->amGoingTo("create entity that has the stepKey: createDataAG1CreatedAG"); + // stepKey: createDataAG1FirstnameCreatedAG + $I->comment("[createDataAG1CreatedAG] create 'simpleData' entity"); PersistedObjectHandler::getInstance()->createEntity( "createDataAG1CreatedAG", "test", @@ -84,8 +96,10 @@ class PersistenceCustomFieldsTestCest [], $createDataAG1CreatedAGFields ); + $createDataAG2CreatedAGFields['firstname'] = "Jane"; - $I->amGoingTo("create entity that has the stepKey: createDataAG2CreatedAG"); + // stepKey: createDataAG2FirstnameCreatedAG + $I->comment("[createDataAG2CreatedAG] create 'simpleData' entity"); PersistedObjectHandler::getInstance()->createEntity( "createDataAG2CreatedAG", "test", @@ -93,8 +107,10 @@ class PersistenceCustomFieldsTestCest [], $createDataAG2CreatedAGFields ); + $createDataAG3CreatedAGFields['firstname'] = PersistedObjectHandler::getInstance()->retrieveEntityField('createdData3', 'firstname', 'test'); - $I->amGoingTo("create entity that has the stepKey: createDataAG3CreatedAG"); + // stepKey: createDataAG3FirstnameCreatedAG + $I->comment("[createDataAG3CreatedAG] create 'simpleData' entity"); PersistedObjectHandler::getInstance()->createEntity( "createDataAG3CreatedAG", "test", @@ -102,6 +118,7 @@ class PersistenceCustomFieldsTestCest [], $createDataAG3CreatedAGFields ); - $I->comment("Exiting Action Group PersistenceActionGroup (createdAG)"); + + $I->comment("Exiting Action Group [createdAG] PersistenceActionGroup"); } } diff --git a/dev/tests/verification/Resources/SectionReplacementTest.txt b/dev/tests/verification/Resources/SectionReplacementTest.txt index c4d738811..a237faf38 100644 --- a/dev/tests/verification/Resources/SectionReplacementTest.txt +++ b/dev/tests/verification/Resources/SectionReplacementTest.txt @@ -27,26 +27,26 @@ class SectionReplacementTestCest */ public function SectionReplacementTest(AcceptanceTester $I) { - $I->click("#element"); - $I->click("#foo"); - $I->waitForPageLoad(30); - $I->click("#element .stringLiteral"); - $I->click("#stringLiteral1 .stringLiteral2"); - $I->click("#stringLiteral1-stringLiteral2 .stringLiteral3"); - $I->click("#stringLiteral1-stringLiteral2 .stringLiteral1 [stringLiteral3]"); - $I->click("#element .John"); - $I->click("#John .Doe"); - $I->click("#John-Doe .Tiberius"); - $I->click("#John-Doe .John [Tiberius]"); - $I->click("#element ." . msq("uniqueData") . "John"); - $I->click("#" . msq("uniqueData") . "John .stringLiteral2"); - $I->click("#" . msq("uniqueData") . "John-stringLiteral2 .stringLiteral3"); - $I->click("#" . msq("uniqueData") . "John-stringLiteral2 ." . msq("uniqueData") . "John [stringLiteral3]"); - $I->click("#element .Doe" . msq("uniqueData")); - $I->click("#Doe" . msq("uniqueData") . " .stringLiteral2"); - $I->click("#Doe" . msq("uniqueData") . "-stringLiteral2 .stringLiteral3"); - $I->click("#Doe" . msq("uniqueData") . "-stringLiteral2 .Doe" . msq("uniqueData") . " [stringLiteral3]"); - $I->amGoingTo("create entity that has the stepKey: createdData"); + $I->click("#element"); // stepKey: selectorReplace + $I->click("#foo"); // stepKey: selectorReplaceTimeout + $I->waitForPageLoad(30); // stepKey: selectorReplaceTimeoutWaitForPageLoad + $I->click("#element .stringLiteral"); // stepKey: selectorReplaceOneParam + $I->click("#stringLiteral1 .stringLiteral2"); // stepKey: selectorReplaceTwoParam + $I->click("#stringLiteral1-stringLiteral2 .stringLiteral3"); // stepKey: selectorReplaceThreeParam + $I->click("#stringLiteral1-stringLiteral2 .stringLiteral1 [stringLiteral3]"); // stepKey: selectorReplaceThreeParamOneDupe + $I->click("#element .John"); // stepKey: selectorReplaceOneParamDataRef + $I->click("#John .Doe"); // stepKey: selectorReplaceTwoParamDataRef + $I->click("#John-Doe .Tiberius"); // stepKey: selectorReplaceThreeParamDataRef + $I->click("#John-Doe .John [Tiberius]"); // stepKey: selectorReplaceThreeParamOneDupeDataRef + $I->click("#element ." . msq("uniqueData") . "John"); // stepKey: selectorReplaceOneParamDataRefMSQPrefix + $I->click("#" . msq("uniqueData") . "John .stringLiteral2"); // stepKey: selectorReplaceTwoParamDataRefMSQPrefix + $I->click("#" . msq("uniqueData") . "John-stringLiteral2 .stringLiteral3"); // stepKey: selectorReplaceThreeParamDataRefMSQPrefix + $I->click("#" . msq("uniqueData") . "John-stringLiteral2 ." . msq("uniqueData") . "John [stringLiteral3]"); // stepKey: selectorReplaceThreeParamOneDupeDataRefMSQPrefix + $I->click("#element .Doe" . msq("uniqueData")); // stepKey: selectorReplaceOneParamDataRefMSQSuffix + $I->click("#Doe" . msq("uniqueData") . " .stringLiteral2"); // stepKey: selectorReplaceTwoParamDataRefMSQSuffix + $I->click("#Doe" . msq("uniqueData") . "-stringLiteral2 .stringLiteral3"); // stepKey: selectorReplaceThreeParamDataRefMSQSuffix + $I->click("#Doe" . msq("uniqueData") . "-stringLiteral2 .Doe" . msq("uniqueData") . " [stringLiteral3]"); // stepKey: selectorReplaceThreeParamOneDupeDataRefMSQSuffix + $I->comment("[createdData] create 'simpleData' entity"); PersistedObjectHandler::getInstance()->createEntity( "createdData", "test", @@ -54,21 +54,22 @@ class SectionReplacementTestCest [], null ); - $I->click("#element ." . PersistedObjectHandler::getInstance()->retrieveEntityField('createdData', 'firstname', 'test')); - $I->click("#" . PersistedObjectHandler::getInstance()->retrieveEntityField('createdData', 'firstname', 'test') . " .stringLiteral2"); - $I->click("#" . PersistedObjectHandler::getInstance()->retrieveEntityField('createdData', 'firstname', 'test') . "-stringLiteral2 .stringLiteral3"); - $I->click("#" . PersistedObjectHandler::getInstance()->retrieveEntityField('createdData', 'firstname', 'test') . "-stringLiteral2 ." . PersistedObjectHandler::getInstance()->retrieveEntityField('createdData', 'firstname', 'test') . " [stringLiteral3]"); - $I->click("#element .{$data}"); - $I->click("#{$data1} .{$data2}"); - $I->click("#{$data1}-{$data2} .{$data3}"); - $I->click("#John-Doe .John [Tiberius]"); - $I->click("#stringLiteral1-" . PersistedObjectHandler::getInstance()->retrieveEntityField('createdData', 'firstname', 'test') . " .John"); - $I->click("#stringLiteral1-" . PersistedObjectHandler::getInstance()->retrieveEntityField('createdData', 'firstname', 'test') . " .{$data}"); - $I->click("#stringLiteral1-" . PersistedObjectHandler::getInstance()->retrieveEntityField('createdData', 'firstname', 'test') . " ." . msq("uniqueData") . "John"); - $I->click("#stringLiteral1-" . PersistedObjectHandler::getInstance()->retrieveEntityField('createdData', 'firstname', 'test') . " .Doe" . msq("uniqueData")); - $I->click("#element .1#element .2"); - $I->click("#element .1#element .{$data}"); - $I->click("(//div[@data-role='slide'])[1]/a[@data-element='link'][contains(@href,'')]"); - $I->click("(//div[@data-role='slide'])[1]/a[@data-element='link'][contains(@href,' ')]"); + + $I->click("#element ." . PersistedObjectHandler::getInstance()->retrieveEntityField('createdData', 'firstname', 'test')); // stepKey: selectorReplaceOneParamPersisted + $I->click("#" . PersistedObjectHandler::getInstance()->retrieveEntityField('createdData', 'firstname', 'test') . " .stringLiteral2"); // stepKey: selectorReplaceTwoParamPersisted + $I->click("#" . PersistedObjectHandler::getInstance()->retrieveEntityField('createdData', 'firstname', 'test') . "-stringLiteral2 .stringLiteral3"); // stepKey: selectorReplaceThreeParamPersisted + $I->click("#" . PersistedObjectHandler::getInstance()->retrieveEntityField('createdData', 'firstname', 'test') . "-stringLiteral2 ." . PersistedObjectHandler::getInstance()->retrieveEntityField('createdData', 'firstname', 'test') . " [stringLiteral3]"); // stepKey: selectorReplaceThreeParamOneDupePersisted + $I->click("#element .{$data}"); // stepKey: selectorReplaceOneParamVariable + $I->click("#{$data1} .{$data2}"); // stepKey: selectorReplaceTwoParamVariable + $I->click("#{$data1}-{$data2} .{$data3}"); // stepKey: selectorReplaceThreeParamVariable + $I->click("#John-Doe .John [Tiberius]"); // stepKey: selectorReplaceThreeParamVariableOneDupe + $I->click("#stringLiteral1-" . PersistedObjectHandler::getInstance()->retrieveEntityField('createdData', 'firstname', 'test') . " .John"); // stepKey: selectorReplaceThreeParamMixed1 + $I->click("#stringLiteral1-" . PersistedObjectHandler::getInstance()->retrieveEntityField('createdData', 'firstname', 'test') . " .{$data}"); // stepKey: selectorReplaceThreeParamMixed2 + $I->click("#stringLiteral1-" . PersistedObjectHandler::getInstance()->retrieveEntityField('createdData', 'firstname', 'test') . " ." . msq("uniqueData") . "John"); // stepKey: selectorReplaceThreeParamMixedMSQPrefix + $I->click("#stringLiteral1-" . PersistedObjectHandler::getInstance()->retrieveEntityField('createdData', 'firstname', 'test') . " .Doe" . msq("uniqueData")); // stepKey: selectorReplaceThreeParamMixedMSQSuffix + $I->click("#element .1#element .2"); // stepKey: selectorReplaceTwoParamElements + $I->click("#element .1#element .{$data}"); // stepKey: selectorReplaceTwoParamMixedTypes + $I->click("(//div[@data-role='slide'])[1]/a[@data-element='link'][contains(@href,'')]"); // stepKey: selectorParamWithEmptyString + $I->click("(//div[@data-role='slide'])[1]/a[@data-element='link'][contains(@href,' ')]"); // stepKey: selectorParamWithASpace } } diff --git a/dev/tests/verification/Resources/functionalSuiteHooks.txt b/dev/tests/verification/Resources/functionalSuiteHooks.txt index d9ff2a344..ee0770ce8 100644 --- a/dev/tests/verification/Resources/functionalSuiteHooks.txt +++ b/dev/tests/verification/Resources/functionalSuiteHooks.txt @@ -60,9 +60,9 @@ class functionalSuiteHooks extends \Codeception\GroupObject $createFields ); $webDriver->click(PersistedObjectHandler::getInstance()->retrieveEntityField('create', 'data', 'suite')); - print("Entering Action Group actionGroupWithTwoArguments (AC)"); + print("Entering Action Group [AC] actionGroupWithTwoArguments"); $webDriver->see("John", msq("uniqueData") . "John"); - print("Exiting Action Group actionGroupWithTwoArguments (AC)"); + print("Exiting Action Group [AC] actionGroupWithTwoArguments"); // reset configuration and close session $this->getModule('\Magento\FunctionalTestingFramework\Module\MagentoWebDriver')->_resetConfig(); @@ -122,9 +122,9 @@ class functionalSuiteHooks extends \Codeception\GroupObject $webDriver->_initializeSession(); $webDriver->amOnPage("some.url"); $webDriver->deleteEntityByUrl("deleteThis"); - print("Entering Action Group actionGroupWithTwoArguments (AC)"); + print("Entering Action Group [AC] actionGroupWithTwoArguments"); $webDriver->see("John", msq("uniqueData") . "John"); - print("Exiting Action Group actionGroupWithTwoArguments (AC)"); + print("Exiting Action Group [AC] actionGroupWithTwoArguments"); } 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 2784555af..512fcafaf 100644 --- a/src/Magento/FunctionalTestingFramework/Allure/Adapter/MagentoAllureAdapter.php +++ b/src/Magento/FunctionalTestingFramework/Allure/Adapter/MagentoAllureAdapter.php @@ -32,7 +32,11 @@ class MagentoAllureAdapter extends AllureCodeception { const STEP_PASSED = "passed"; - + /** + * Test files cache. + * + * @var array + */ private $testFiles = []; /** @@ -234,18 +238,27 @@ function () use ($rootStep, $formattedSteps) { $this->getLifecycle()->fire(new TestCaseFinishedEvent()); } + /** + * Reading stepKey from file. + * + * @param string $stepLine + * @return string|null + */ private function retrieveStepKey($stepLine) { $stepKey = null; list($filePath, $stepLine) = explode(":", $stepLine); - $prevStepLine = $stepLine - 2; + $stepLine = $stepLine - 1; if (!array_key_exists($filePath, $this->testFiles)) { $this->testFiles[$filePath] = explode(PHP_EOL, file_get_contents($filePath)); } - $testFile = $this->testFiles[$filePath]; + $testLineTrimmed = substr( + $this->testFiles[$filePath][$stepLine], + strpos($this->testFiles[$filePath][$stepLine], '//') + ); - list($stepKey) = sscanf($testFile[$prevStepLine], TestGenerator::STEP_KEY_ANNOTATION); + list($stepKey) = sscanf($testLineTrimmed, TestGenerator::STEP_KEY_ANNOTATION); return $stepKey; } diff --git a/src/Magento/FunctionalTestingFramework/Codeception/Subscriber/Console.php b/src/Magento/FunctionalTestingFramework/Codeception/Subscriber/Console.php index 6f4bc4461..6cec4ea69 100644 --- a/src/Magento/FunctionalTestingFramework/Codeception/Subscriber/Console.php +++ b/src/Magento/FunctionalTestingFramework/Codeception/Subscriber/Console.php @@ -1,4 +1,9 @@ steps or !$e->getTest() instanceof ScenarioDriven) { @@ -43,6 +59,12 @@ public function beforeStep(StepEvent $e) $this->printStepKeys($e->getStep()); } + /** + * Print output to cli with stepKey. + * + * @param Step $step + * @return void + */ private function printStepKeys(Step $step) { if ($step instanceof Comment and $step->__toString() == '') { @@ -71,7 +93,9 @@ private function printStepKeys(Step $step) } /** - * @param $string + * Message instance. + * + * @param string $string * @return Message */ private function message($string = '') @@ -79,18 +103,27 @@ private function message($string = '') return $this->messageFactory->message($string); } + /** + * Reading stepKey from file. + * + * @param string $stepLine + * @return string|null + */ private function retrieveStepKey($stepLine) { $stepKey = null; list($filePath, $stepLine) = explode(":", $stepLine); - $prevStepLine = $stepLine - 2; + $stepLine = $stepLine - 1; if (!array_key_exists($filePath, $this->testFiles)) { $this->testFiles[$filePath] = explode(PHP_EOL, file_get_contents($filePath)); } - $testFile = $this->testFiles[$filePath]; + $testLineTrimmed = substr( + $this->testFiles[$filePath][$stepLine], + strpos($this->testFiles[$filePath][$stepLine], '//') + ); - list($stepKey) = sscanf($testFile[$prevStepLine], TestGenerator::STEP_KEY_ANNOTATION); + list($stepKey) = sscanf($testLineTrimmed, TestGenerator::STEP_KEY_ANNOTATION); return $stepKey; } diff --git a/src/Magento/FunctionalTestingFramework/Test/Handlers/ActionGroupObjectHandler.php b/src/Magento/FunctionalTestingFramework/Test/Handlers/ActionGroupObjectHandler.php index d4a46adb9..18a6402ea 100644 --- a/src/Magento/FunctionalTestingFramework/Test/Handlers/ActionGroupObjectHandler.php +++ b/src/Magento/FunctionalTestingFramework/Test/Handlers/ActionGroupObjectHandler.php @@ -107,9 +107,9 @@ private function initActionGroups() $parsedActionGroups = $actionGroupParser->readActionGroupData(); $actionGroupObjectExtractor = new ActionGroupObjectExtractor(); + $neededActionGroup = $parsedActionGroups[ActionGroupObjectHandler::ACTION_GROUP_ROOT]; - foreach ($parsedActionGroups[ActionGroupObjectHandler::ACTION_GROUP_ROOT] as - $actionGroupName => $actionGroupData) { + foreach ($neededActionGroup as $actionGroupName => $actionGroupData) { if (!is_array($actionGroupData)) { continue; } diff --git a/src/Magento/FunctionalTestingFramework/Test/Objects/ActionGroupObject.php b/src/Magento/FunctionalTestingFramework/Test/Objects/ActionGroupObject.php index ef2e11c03..1e86cff77 100644 --- a/src/Magento/FunctionalTestingFramework/Test/Objects/ActionGroupObject.php +++ b/src/Magento/FunctionalTestingFramework/Test/Objects/ActionGroupObject.php @@ -532,8 +532,8 @@ private function replaceCreateDataKeys($action, $replacementStepKeys) */ private function addContextCommentsToActionList($actionList, $actionReferenceKey) { - $actionStartComment = self::ACTION_GROUP_CONTEXT_START . $this->name . " (" . $actionReferenceKey . ")"; - $actionEndComment = self::ACTION_GROUP_CONTEXT_END . $this->name . " (" . $actionReferenceKey . ")"; + $actionStartComment = self::ACTION_GROUP_CONTEXT_START . "[" . $actionReferenceKey . "] " . $this->name; + $actionEndComment = self::ACTION_GROUP_CONTEXT_END . "[" . $actionReferenceKey . "] " . $this->name; $startAction = new ActionObject( $actionStartComment, ActionObject::ACTION_TYPE_COMMENT, diff --git a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php index 977027c4d..a49256202 100644 --- a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php +++ b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php @@ -39,7 +39,8 @@ class TestGenerator const SUITE_SCOPE = 'suite'; const PRESSKEY_ARRAY_ANCHOR_KEY = '987654321098765432109876543210'; const PERSISTED_OBJECT_NOTATION_REGEX = '/\${1,2}[\w.\[\]]+\${1,2}/'; - const STEP_KEY_ANNOTATION = "\t\t/** @stepKey %s */"; + const NO_STEPKEY_ACTIONS = ['comment', 'createData', 'deleteData', 'updateData', 'getData']; + const STEP_KEY_ANNOTATION = " // stepKey: %s"; /** * Path to the export dir. @@ -699,9 +700,6 @@ public function generateStepsPhp($actionObjects, $generationScope = TestGenerato $storeCode = $customActionAttributes['storeCode']; } - if ($actionObject->getType() !== 'comment') { - $testSteps .= PHP_EOL . sprintf(self::STEP_KEY_ANNOTATION, $stepKey) . PHP_EOL; - } switch ($actionObject->getType()) { case "createData": $entity = $customActionAttributes['entity']; @@ -737,7 +735,7 @@ public function generateStepsPhp($actionObjects, $generationScope = TestGenerato } elseif ($generationScope == TestGenerator::SUITE_SCOPE) { $scope = PersistedObjectHandler::SUITE_SCOPE; } - + $createEntityFunctionCall = "\t\tPersistedObjectHandler::getInstance()->createEntity("; $createEntityFunctionCall .= "\n\t\t\t\"{$stepKey}\","; $createEntityFunctionCall .= "\n\t\t\t\"{$scope}\","; @@ -815,7 +813,7 @@ public function generateStepsPhp($actionObjects, $generationScope = TestGenerato $key, $updateEntity ); - + // Build array of requiredEntities $requiredEntityKeys = []; foreach ($actionObject->getCustomActionAttributes() as $actionAttribute) { @@ -1305,6 +1303,10 @@ public function generateStepsPhp($actionObjects, $generationScope = TestGenerato $parameter ); } + if (!in_array($actionObject->getType(), self::NO_STEPKEY_ACTIONS)) { + $testSteps .= sprintf(self::STEP_KEY_ANNOTATION, $stepKey); + } + $testSteps .= PHP_EOL; } return $testSteps; @@ -1801,7 +1803,7 @@ private function wrapFunctionCall($actor, $action, ...$args) } $args = $this->resolveAllRuntimeReferences($args); $args = $this->resolveTestVariable($args, $action->getActionOrigin()); - $output .= implode(", ", array_filter($args, function($value) { return $value !== null; })) . ");\n"; + $output .= implode(", ", array_filter($args, function($value) { return $value !== null; })) . ");"; return $output; } @@ -1833,7 +1835,7 @@ private function wrapFunctionCallWithReturnValue($returnVariable, $actor, $actio } $args = $this->resolveAllRuntimeReferences($args); $args = $this->resolveTestVariable($args, $action->getActionOrigin()); - $output .= implode(", ", array_filter($args, function($value) { return $value !== null; })) . ");\n"; + $output .= implode(", ", array_filter($args, function($value) { return $value !== null; })) . ");"; return $output; } // @codingStandardsIgnoreEnd From 8aee6af47b424a441260c145034d9dedf03532d9 Mon Sep 17 00:00:00 2001 From: Alex Kolesnyk Date: Thu, 6 Jun 2019 11:57:00 -0500 Subject: [PATCH 08/29] MQE-659: [ALLURE] Include the test "stepKey" in the MFTF Allure Report - test fixes --- .../ActionGroupWithStepKeyReferences.txt | 7 +- .../Resources/BasicFunctionalTest.txt | 9 +- .../Resources/DataReplacementTest.txt | 5 +- .../Allure/Adapter/MagentoAllureAdapter.php | 23 ++++- .../Codeception/Subscriber/Console.php | 91 +++++++++++++------ .../Util/TestGenerator.php | 11 ++- 6 files changed, 102 insertions(+), 44 deletions(-) diff --git a/dev/tests/verification/Resources/ActionGroupWithStepKeyReferences.txt b/dev/tests/verification/Resources/ActionGroupWithStepKeyReferences.txt index 2f23215c2..336cd6610 100644 --- a/dev/tests/verification/Resources/ActionGroupWithStepKeyReferences.txt +++ b/dev/tests/verification/Resources/ActionGroupWithStepKeyReferences.txt @@ -44,13 +44,14 @@ class ActionGroupWithStepKeyReferencesCest $I->fillField($action1); // stepKey: action1ActionGroup $I->comment("Invocation stepKey will be appended in non stepKey instances"); $action3ActionGroup = $I->executeJS($action3ActionGroup); // stepKey: action3ActionGroup - $action4ActionGroup = $I->magentoCLI($action4ActionGroup, "\"stuffHere\""); $I->comment($action4ActionGroup); - // stepKey: action4ActionGroup + $action4ActionGroup = $I->magentoCLI($action4ActionGroup, "\"stuffHere\""); // stepKey: action4ActionGroup + $I->comment($action4ActionGroup); + $date = new \DateTime(); $date->setTimestamp(strtotime("{$action5}")); $date->setTimezone(new \DateTimeZone("America/Los_Angeles")); $action5ActionGroup = $date->format("H:i:s"); - // stepKey: action5ActionGroup + $action6ActionGroup = $I->formatMoney($action6ActionGroup); // stepKey: action6ActionGroup $I->comment("[action7ActionGroup] delete entity '{$action7ActionGroupActionGroup}'"); PersistedObjectHandler::getInstance()->deleteEntity( diff --git a/dev/tests/verification/Resources/BasicFunctionalTest.txt b/dev/tests/verification/Resources/BasicFunctionalTest.txt index b3ab7ea9c..3cb373a4c 100644 --- a/dev/tests/verification/Resources/BasicFunctionalTest.txt +++ b/dev/tests/verification/Resources/BasicFunctionalTest.txt @@ -107,20 +107,21 @@ class BasicFunctionalTestCest $date->setTimestamp(strtotime("Now")); $date->setTimezone(new \DateTimeZone("America/Los_Angeles")); $generateDateKey = $date->format("H:i:s"); - // stepKey: generateDateKey + $date = new \DateTime(); $date->setTimestamp(strtotime("Now")); $date->setTimezone(new \DateTimeZone("UTC")); $generateDateKey2 = $date->format("H:i:s"); - // stepKey: generateDateKey2 + $grabAttributeFromKey1 = $I->grabAttributeFrom(".functionalTestSelector", "someInput"); // stepKey: grabAttributeFromKey1 $grabCookieKey1 = $I->grabCookie("grabCookieInput", ['domain' => 'www.google.com']); // stepKey: grabCookieKey1 $grabFromCurrentUrlKey1 = $I->grabFromCurrentUrl("/grabCurrentUrl"); // stepKey: grabFromCurrentUrlKey1 $grabMultipleKey1 = $I->grabMultiple(".functionalTestSelector"); // stepKey: grabMultipleKey1 $grabTextFromKey1 = $I->grabTextFrom(".functionalTestSelector"); // stepKey: grabTextFromKey1 $grabValueFromKey1 = $I->grabValueFrom(".functionalTestSelector"); // stepKey: grabValueFromKey1 - $magentoCli1 = $I->magentoCLI("maintenance:enable", "\"stuffHere\""); $I->comment($magentoCli1); - // stepKey: magentoCli1 + $magentoCli1 = $I->magentoCLI("maintenance:enable", "\"stuffHere\""); // stepKey: magentoCli1 + $I->comment($magentoCli1); + $I->makeScreenshot("screenShotInput"); // stepKey: makeScreenshotKey1 $I->maximizeWindow(); // stepKey: maximizeWindowKey1 $I->moveBack(); // stepKey: moveBackKey1 diff --git a/dev/tests/verification/Resources/DataReplacementTest.txt b/dev/tests/verification/Resources/DataReplacementTest.txt index 8cc671d3d..211dfd5a1 100644 --- a/dev/tests/verification/Resources/DataReplacementTest.txt +++ b/dev/tests/verification/Resources/DataReplacementTest.txt @@ -51,7 +51,8 @@ class DataReplacementTestCest $I->searchAndMultiSelectOption("#selector", [msq("uniqueData") . "John", "Doe" . msq("uniqueData")]); // stepKey: parameterArrayReplacementMSQBoth $I->selectMultipleOptions("#Doe" . msq("uniqueData"), "#element", [msq("uniqueData") . "John", "Doe" . msq("uniqueData")]); // stepKey: multiSelectDataReplacement $I->fillField(".selector", "0"); // stepKey: insertZero - $insertCommand = $I->magentoCLI("do something Doe" . msq("uniqueData") . " with uniqueness"); $I->comment($insertCommand); - // stepKey: insertCommand + $insertCommand = $I->magentoCLI("do something Doe" . msq("uniqueData") . " with uniqueness"); // stepKey: insertCommand + $I->comment($insertCommand); + } } diff --git a/src/Magento/FunctionalTestingFramework/Allure/Adapter/MagentoAllureAdapter.php b/src/Magento/FunctionalTestingFramework/Allure/Adapter/MagentoAllureAdapter.php index 512fcafaf..bce6ec339 100644 --- a/src/Magento/FunctionalTestingFramework/Allure/Adapter/MagentoAllureAdapter.php +++ b/src/Magento/FunctionalTestingFramework/Allure/Adapter/MagentoAllureAdapter.php @@ -196,17 +196,31 @@ public function testEnd() $formattedSteps = []; $actionGroupStepContainer = null; + $actionGroupStepKey = null; foreach ($rootStep->getSteps() as $step) { + if ($actionGroupStepKey !== null) { + $stepKey = str_replace($actionGroupStepKey, '', $step->getName()); + if ($stepKey !== '[]' && $stepKey !== null) { + $step->setName($stepKey); + } + } // 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; + + preg_match('/\[(?.*)\]/', $step->getName(), $matches); + if (!empty($matches['actionGroupStepKey'])) { + $actionGroupStepKey = ucfirst($matches['actionGroupStepKey']); + } continue; } + // if actionGroup ended, add stack to steps if (stripos($step->getName(), ActionGroupObject::ACTION_GROUP_CONTEXT_END) !== false) { $formattedSteps[] = $actionGroupStepContainer; $actionGroupStepContainer = null; + $actionGroupStepKey = null; continue; } @@ -253,12 +267,11 @@ private function retrieveStepKey($stepLine) if (!array_key_exists($filePath, $this->testFiles)) { $this->testFiles[$filePath] = explode(PHP_EOL, file_get_contents($filePath)); } - $testLineTrimmed = substr( - $this->testFiles[$filePath][$stepLine], - strpos($this->testFiles[$filePath][$stepLine], '//') - ); - list($stepKey) = sscanf($testLineTrimmed, TestGenerator::STEP_KEY_ANNOTATION); + preg_match("/\/\/ stepKey: (?.*)/", $this->testFiles[$filePath][$stepLine], $matches); + if (!empty($matches['stepKey'])) { + $stepKey = $matches['stepKey']; + } return $stepKey; } diff --git a/src/Magento/FunctionalTestingFramework/Codeception/Subscriber/Console.php b/src/Magento/FunctionalTestingFramework/Codeception/Subscriber/Console.php index 6cec4ea69..bc830e3cf 100644 --- a/src/Magento/FunctionalTestingFramework/Codeception/Subscriber/Console.php +++ b/src/Magento/FunctionalTestingFramework/Codeception/Subscriber/Console.php @@ -1,31 +1,13 @@ steps or !$e->getTest() instanceof ScenarioDriven) { + if ($this->silent or !$this->steps or !$e->getTest() instanceof ScenarioDriven) { return; } + $metaStep = $e->getStep()->getMetaStep(); if ($metaStep and $this->metaStep != $metaStep) { $this->message(' ' . $metaStep->getPrefix()) @@ -59,6 +49,20 @@ public function beforeStep(StepEvent $e) $this->printStepKeys($e->getStep()); } + /** + * If step failed we move back from action group to test scope + * + * @param StepEvent $e + * @return void + */ + public function afterStep(StepEvent $e) + { + parent::afterStep($e); + if ($e->getStep()->hasFailed()) { + $this->actionGroupStepKey = null; + } + } + /** * Print output to cli with stepKey. * @@ -73,20 +77,44 @@ private function printStepKeys(Step $step) $stepKey = $this->retrieveStepKey($step->getLine()); - $msg = $this->message(' '); - if ($this->metaStep) { + $isActionGroup = (strpos($step->__toString(), ActionGroupObject::ACTION_GROUP_CONTEXT_START) !== false); + if ($isActionGroup) { + preg_match('/\[(?.*)\]/', $step->__toString(), $matches); + if (!empty($matches['actionGroupStepKey'])) { + $this->actionGroupStepKey = ucfirst($matches['actionGroupStepKey']); + } + } + + if (strpos($step->__toString(), ActionGroupObject::ACTION_GROUP_CONTEXT_END) !== false) { + $this->actionGroupStepKey = null; + return; + } + + $msg = $this->message(); + if ($this->metaStep || ($this->actionGroupStepKey !== null && !$isActionGroup)) { $msg->append(' '); } if ($stepKey !== null) { $msg->append(OutputFormatter::escape("[" . $stepKey . "] ")); + $msg->style('bold'); } if (!$this->metaStep) { $msg->style('bold'); } - $msg->append(OutputFormatter::escape($step->toString($this->width))); - if ($this->metaStep) { + $stepString = str_replace( + [ActionGroupObject::ACTION_GROUP_CONTEXT_START, ActionGroupObject::ACTION_GROUP_CONTEXT_END], + '', + $step->toString(150) + ); + + + $msg->append(OutputFormatter::escape($stepString)); + if ($isActionGroup) { + $msg->style('comment'); + } + if ($this->metaStep || ($this->actionGroupStepKey !== null && !$isActionGroup)) { $msg->style('info'); } $msg->writeln(); @@ -118,12 +146,17 @@ private function retrieveStepKey($stepLine) if (!array_key_exists($filePath, $this->testFiles)) { $this->testFiles[$filePath] = explode(PHP_EOL, file_get_contents($filePath)); } - $testLineTrimmed = substr( - $this->testFiles[$filePath][$stepLine], - strpos($this->testFiles[$filePath][$stepLine], '//') - ); - list($stepKey) = sscanf($testLineTrimmed, TestGenerator::STEP_KEY_ANNOTATION); + preg_match("/\/\/ stepKey: (?.*)/", $this->testFiles[$filePath][$stepLine], $matches); + if (!empty($matches['stepKey'])) { + $stepKey = $matches['stepKey']; + } + + if ($this->actionGroupStepKey !== null) { + $stepKey = str_replace($this->actionGroupStepKey, '', $stepKey); + } + + $stepKey = $stepKey === '[]' ? null : $stepKey; return $stepKey; } diff --git a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php index a49256202..628145e66 100644 --- a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php +++ b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php @@ -39,7 +39,15 @@ class TestGenerator const SUITE_SCOPE = 'suite'; const PRESSKEY_ARRAY_ANCHOR_KEY = '987654321098765432109876543210'; const PERSISTED_OBJECT_NOTATION_REGEX = '/\${1,2}[\w.\[\]]+\${1,2}/'; - const NO_STEPKEY_ACTIONS = ['comment', 'createData', 'deleteData', 'updateData', 'getData']; + const NO_STEPKEY_ACTIONS = [ + 'comment', + 'createData', + 'deleteData', + 'updateData', + 'getData', + 'magentoCLI', + 'generateDate' + ]; const STEP_KEY_ANNOTATION = " // stepKey: %s"; /** @@ -1262,6 +1270,7 @@ public function generateStepsPhp($actionObjects, $generationScope = TestGenerato $command, $arguments ); + $testSteps .= sprintf(self::STEP_KEY_ANNOTATION, $stepKey) . PHP_EOL; $testSteps .= sprintf( "\t\t$%s->comment(\$%s);\n", $actor, From ff1236472e496496d1d4db84e759960d49b287b3 Mon Sep 17 00:00:00 2001 From: John S Date: Thu, 6 Jun 2019 13:05:00 -0500 Subject: [PATCH 09/29] MQE-1580: Remove the "page" attribute from the Action Group annotations node. - Correcting the expected Text in the Static Test. --- dev/tests/unit/Resources/alteredDocumentation.txt | 1 + dev/tests/unit/Resources/basicDocumentation.txt | 1 + 2 files changed, 2 insertions(+) diff --git a/dev/tests/unit/Resources/alteredDocumentation.txt b/dev/tests/unit/Resources/alteredDocumentation.txt index 5e4d70774..bdb3daae3 100644 --- a/dev/tests/unit/Resources/alteredDocumentation.txt +++ b/dev/tests/unit/Resources/alteredDocumentation.txt @@ -8,3 +8,4 @@ This documentation contains a list of all Action Groups. **Located In**: - filename *** + diff --git a/dev/tests/unit/Resources/basicDocumentation.txt b/dev/tests/unit/Resources/basicDocumentation.txt index 43f1c9521..fd5156087 100644 --- a/dev/tests/unit/Resources/basicDocumentation.txt +++ b/dev/tests/unit/Resources/basicDocumentation.txt @@ -8,3 +8,4 @@ This documentation contains a list of all Action Groups. **Located In**: - filename *** + From 17b8b9d8fb42e90e9cd58125a6d727f03b6d1626 Mon Sep 17 00:00:00 2001 From: Alex Kolesnyk Date: Thu, 6 Jun 2019 13:11:19 -0500 Subject: [PATCH 10/29] MQE-659: [ALLURE] Include the test "stepKey" in the MFTF Allure Report - test fixes --- .../Codeception/Subscriber/Console.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Magento/FunctionalTestingFramework/Codeception/Subscriber/Console.php b/src/Magento/FunctionalTestingFramework/Codeception/Subscriber/Console.php index bc830e3cf..750c9fca4 100644 --- a/src/Magento/FunctionalTestingFramework/Codeception/Subscriber/Console.php +++ b/src/Magento/FunctionalTestingFramework/Codeception/Subscriber/Console.php @@ -109,7 +109,6 @@ private function printStepKeys(Step $step) $step->toString(150) ); - $msg->append(OutputFormatter::escape($stepString)); if ($isActionGroup) { $msg->style('comment'); From 29e24774da17412364e8acd48003f69c0820d065 Mon Sep 17 00:00:00 2001 From: John S Date: Thu, 6 Jun 2019 13:15:26 -0500 Subject: [PATCH 11/29] MQE-1580: Remove the "page" attribute from the Action Group annotations node. - Correcting the expected Text in the Static Test. --- dev/tests/unit/Resources/alteredDocumentation.txt | 1 - dev/tests/unit/Resources/basicDocumentation.txt | 1 - 2 files changed, 2 deletions(-) diff --git a/dev/tests/unit/Resources/alteredDocumentation.txt b/dev/tests/unit/Resources/alteredDocumentation.txt index bdb3daae3..5e4d70774 100644 --- a/dev/tests/unit/Resources/alteredDocumentation.txt +++ b/dev/tests/unit/Resources/alteredDocumentation.txt @@ -8,4 +8,3 @@ This documentation contains a list of all Action Groups. **Located In**: - filename *** - diff --git a/dev/tests/unit/Resources/basicDocumentation.txt b/dev/tests/unit/Resources/basicDocumentation.txt index fd5156087..43f1c9521 100644 --- a/dev/tests/unit/Resources/basicDocumentation.txt +++ b/dev/tests/unit/Resources/basicDocumentation.txt @@ -8,4 +8,3 @@ This documentation contains a list of all Action Groups. **Located In**: - filename *** - From 9c7bf5f07df3030038c31e305edce67bf10f8af3 Mon Sep 17 00:00:00 2001 From: Alex Kolesnyk Date: Fri, 7 Jun 2019 11:49:22 -0500 Subject: [PATCH 12/29] MQE-1234: Allow XML Parser to read XML comment into comment action --- .../functional/tests/MFTF/DevDocs/Page/MFTFDocPage.xml | 2 +- .../functional/tests/MFTF/DevDocs/Test/DevDocsTest.xml | 4 ++++ dev/tests/verification/Resources/AssertTest.txt | 8 ++++++++ .../Test/Config/Converter/Dom/Flat.php | 6 ++++++ .../Test/Objects/ActionObject.php | 5 +++-- .../Test/Util/ActionObjectExtractor.php | 4 +++- .../Test/Util/AnnotationExtractor.php | 4 ++++ .../FunctionalTestingFramework/Util/TestGenerator.php | 2 ++ 8 files changed, 31 insertions(+), 4 deletions(-) diff --git a/dev/tests/functional/tests/MFTF/DevDocs/Page/MFTFDocPage.xml b/dev/tests/functional/tests/MFTF/DevDocs/Page/MFTFDocPage.xml index 2b706ed67..88c577aef 100644 --- a/dev/tests/functional/tests/MFTF/DevDocs/Page/MFTFDocPage.xml +++ b/dev/tests/functional/tests/MFTF/DevDocs/Page/MFTFDocPage.xml @@ -8,7 +8,7 @@ - +
diff --git a/dev/tests/functional/tests/MFTF/DevDocs/Test/DevDocsTest.xml b/dev/tests/functional/tests/MFTF/DevDocs/Test/DevDocsTest.xml index eceeb3f58..ff9e0220d 100644 --- a/dev/tests/functional/tests/MFTF/DevDocs/Test/DevDocsTest.xml +++ b/dev/tests/functional/tests/MFTF/DevDocs/Test/DevDocsTest.xml @@ -10,6 +10,7 @@ xsi:noNamespaceSchemaLocation="../../../../../../../src/Magento/FunctionalTestingFramework/Test/etc/testSchema.xsd"> + @@ -18,7 +19,10 @@ <group value="mftf"/> </annotations> + <!-- Open MFTF DevDocs Page --> <amOnPage stepKey="openMFTFDevDocPage" url="{{MFTFDocPage.url}}" /> + <!--< > & $abc " abc ' <click stepKey="click" userInput="$$createDataHook.firstname$$" selector="#id">/--> + <actionGroup ref="AdminNavigateMenuActionGroup" stepKey="asdf" /> <see stepKey="verifyPageIntroText" selector="{{contentSection.pageIntro}}" userInput="Introduction to the Magento Functional Testing Framework" /> </test> </tests> diff --git a/dev/tests/verification/Resources/AssertTest.txt b/dev/tests/verification/Resources/AssertTest.txt index 15388667a..697bc3d21 100644 --- a/dev/tests/verification/Resources/AssertTest.txt +++ b/dev/tests/verification/Resources/AssertTest.txt @@ -54,8 +54,10 @@ class AssertTestCest ); $grabTextFrom1 = $I->grabTextFrom(".copyright>span"); // stepKey: grabTextFrom1 + $I->comment("custom asserts"); $I->assertArrayIsSorted(["1", "2", "3", "4", "5"], "asc"); // stepKey: assertSorted1 $I->comment("asserts without variable replacement"); + $I->comment("asserts without variable replacement"); $I->assertArrayHasKey("apple", ['orange' => 2, 'apple' => 1], "pass"); // stepKey: assertArrayHasKey $I->assertArrayNotHasKey("kiwi", ['orange' => 2, 'apple' => 1], "pass"); // stepKey: assertArrayNotHasKey $I->assertArraySubset([1, 2], [1, 2, 3, 5], "pass"); // stepKey: assertArraySubset @@ -91,6 +93,7 @@ class AssertTestCest $I->assertStringStartsWith("a", "apple", "pass"); // stepKey: assertStringStartsWith $I->assertTrue(true, "pass"); // stepKey: assertTrue $I->comment("asserts backward compatible"); + $I->comment("asserts backward compatible"); $I->assertArrayHasKey("apple", ['orange' => 2, 'apple' => 1], "pass"); // stepKey: assertArrayHasKeyBackwardCompatible $I->assertArrayNotHasKey("kiwi", ['orange' => 2, 'apple' => 1], "pass"); // stepKey: assertArrayNotHasKeyBackwardCompatible $I->assertArraySubset([1, 2], [1, 2, 3, 5], "pass"); // stepKey: assertArraySubsetBackwardCompatible @@ -133,14 +136,17 @@ class AssertTestCest $I->assertNull($text, "pass"); // stepKey: assertNullBackwardCompatible $I->expectException(new MyException('exception msg'), function() {$this->doSomethingBad();}); // stepKey: expectExceptionBackwardCompatible $I->comment("string type that use created data"); + $I->comment("string type that use created data"); $I->assertStringStartsWith("D", PersistedObjectHandler::getInstance()->retrieveEntityField('createData1', 'lastname', 'test') . ", " . PersistedObjectHandler::getInstance()->retrieveEntityField('createData1', 'firstname', 'test'), "fail"); // stepKey: assert1 $I->assertStringStartsNotWith("W", PersistedObjectHandler::getInstance()->retrieveEntityField('createData2', 'firstname', 'test') . ", " . PersistedObjectHandler::getInstance()->retrieveEntityField('createData2', 'lastname', 'test'), "pass"); // stepKey: assert2 $I->assertEquals(PersistedObjectHandler::getInstance()->retrieveEntityField('createData1', 'lastname', 'test'), PersistedObjectHandler::getInstance()->retrieveEntityField('createData1', 'lastname', 'test'), "pass"); // stepKey: assert5 $I->comment("array type that use created data"); + $I->comment("array type that use created data"); $I->assertArraySubset([PersistedObjectHandler::getInstance()->retrieveEntityField('createData1', 'lastname', 'test'), PersistedObjectHandler::getInstance()->retrieveEntityField('createData1', 'firstname', 'test')], [PersistedObjectHandler::getInstance()->retrieveEntityField('createData1', 'lastname', 'test'), PersistedObjectHandler::getInstance()->retrieveEntityField('createData1', 'firstname', 'test'), "1"], "pass"); // stepKey: assert9 $I->assertArraySubset([PersistedObjectHandler::getInstance()->retrieveEntityField('createData2', 'firstname', 'test'), PersistedObjectHandler::getInstance()->retrieveEntityField('createData2', 'lastname', 'test')], [PersistedObjectHandler::getInstance()->retrieveEntityField('createData2', 'firstname', 'test'), PersistedObjectHandler::getInstance()->retrieveEntityField('createData2', 'lastname', 'test'), "1"], "pass"); // stepKey: assert10 $I->assertArrayHasKey("lastname", ['lastname' => PersistedObjectHandler::getInstance()->retrieveEntityField('createData1', 'lastname', 'test'), 'firstname' => PersistedObjectHandler::getInstance()->retrieveEntityField('createData1', 'firstname', 'test')], "pass"); // stepKey: assert3 $I->assertArrayHasKey("lastname", ['lastname' => PersistedObjectHandler::getInstance()->retrieveEntityField('createData2', 'lastname', 'test'), 'firstname' => PersistedObjectHandler::getInstance()->retrieveEntityField('createData2', 'firstname', 'test')], "pass"); // stepKey: assert4 + $I->comment("this section can only be generated and cannot run"); $I->assertInstanceOf(User::class, $text, "pass"); // stepKey: assertInstanceOf $I->assertNotInstanceOf(User::class, 21, "pass"); // stepKey: assertNotInstanceOf $I->assertFileExists($text, "pass"); // stepKey: assertFileExists2 @@ -151,6 +157,7 @@ class AssertTestCest $I->fail("fail"); // stepKey: fail $I->fail(PersistedObjectHandler::getInstance()->retrieveEntityField('createData2', 'firstname', 'test') . " " . PersistedObjectHandler::getInstance()->retrieveEntityField('createData2', 'lastname', 'test')); // stepKey: assert7 $I->fail(PersistedObjectHandler::getInstance()->retrieveEntityField('createData1', 'firstname', 'test') . " " . PersistedObjectHandler::getInstance()->retrieveEntityField('createData1', 'lastname', 'test')); // stepKey: assert8 + $I->comment("assertElementContainsAttribute examples"); $I->assertElementContainsAttribute("#username", "class", "admin__control-text"); // stepKey: assertElementContainsAttribute1 $I->assertElementContainsAttribute("#username", "name", "login[username]"); // stepKey: assertElementContainsAttribute2 $I->assertElementContainsAttribute("#username", "autofocus", "true"); // stepKey: assertElementContainsAttribute3 @@ -159,6 +166,7 @@ class AssertTestCest $I->assertElementContainsAttribute(".admin__menu-overlay", "border", "0"); // stepKey: assertElementContainsAttribute6 $I->assertElementContainsAttribute("#username", "value", PersistedObjectHandler::getInstance()->retrieveEntityField('createData2', 'firstname', 'test')); // stepKey: assertElementContainsAttribute7 $I->assertElementContainsAttribute("#username", "value", PersistedObjectHandler::getInstance()->retrieveEntityField('createData1', 'firstname', 'test')); // stepKey: assertElementContainsAttribute8 + $I->comment("assert entity resolution"); $I->assertEquals("John", "Doe", "pass"); // stepKey: assertEqualsEntity } } diff --git a/src/Magento/FunctionalTestingFramework/Test/Config/Converter/Dom/Flat.php b/src/Magento/FunctionalTestingFramework/Test/Config/Converter/Dom/Flat.php index dd72264b9..a01841041 100644 --- a/src/Magento/FunctionalTestingFramework/Test/Config/Converter/Dom/Flat.php +++ b/src/Magento/FunctionalTestingFramework/Test/Config/Converter/Dom/Flat.php @@ -124,6 +124,12 @@ public function convertXml(\DOMNode $source, $basePath = '') ) { $value = $node->nodeValue; break; + } elseif ($node->nodeType == XML_COMMENT_NODE) { + $uniqid = uniqid(str_replace("#", "", $node->nodeName)); + $value[$uniqid] = [ + 'value' => trim($node->nodeValue), + 'nodeName' => $node->nodeName, + ]; } } $result = $this->getNodeAttributes($source); diff --git a/src/Magento/FunctionalTestingFramework/Test/Objects/ActionObject.php b/src/Magento/FunctionalTestingFramework/Test/Objects/ActionObject.php index 8a3bb27a6..19bd58721 100644 --- a/src/Magento/FunctionalTestingFramework/Test/Objects/ActionObject.php +++ b/src/Magento/FunctionalTestingFramework/Test/Objects/ActionObject.php @@ -23,6 +23,7 @@ */ class ActionObject { + const COMMENT_ACTION = '#comment'; const __ENV = "_ENV"; const __CREDS = "_CREDS"; const RUNTIME_REFERENCES = [ @@ -148,7 +149,7 @@ public function __construct( $actionOrigin = null ) { $this->stepKey = $stepKey; - $this->type = $type; + $this->type = $type === self::COMMENT_ACTION ? self::ACTION_TYPE_COMMENT : $type; $this->actionAttributes = $actionAttributes; $this->linkedAction = $linkedAction; $this->actionOrigin = $actionOrigin; @@ -554,7 +555,7 @@ private function findAndReplaceReferences($objectHandler, $inputString) } if ($replacement === null) { - if (get_class($objectHandler) != DataObjectHandler::class) { + if (!($objectHandler instanceof DataObjectHandler)) { return $this->findAndReplaceReferences(DataObjectHandler::getInstance(), $outputString); } else { throw new TestReferenceException( diff --git a/src/Magento/FunctionalTestingFramework/Test/Util/ActionObjectExtractor.php b/src/Magento/FunctionalTestingFramework/Test/Util/ActionObjectExtractor.php index 5cd7b7ac5..605a1fdc2 100644 --- a/src/Magento/FunctionalTestingFramework/Test/Util/ActionObjectExtractor.php +++ b/src/Magento/FunctionalTestingFramework/Test/Util/ActionObjectExtractor.php @@ -58,7 +58,9 @@ public function extractActions($testActions, $testName = null) $stepKeyRefs = []; foreach ($testActions as $actionName => $actionData) { - $stepKey = $actionData[self::TEST_STEP_MERGE_KEY]; + $stepKey = strpos($actionData[self::NODE_NAME], ActionObject::COMMENT_ACTION) === false + ? $actionData[self::TEST_STEP_MERGE_KEY] + : $actionName; $actionType = $actionData[self::NODE_NAME]; if (empty($stepKey)) { diff --git a/src/Magento/FunctionalTestingFramework/Test/Util/AnnotationExtractor.php b/src/Magento/FunctionalTestingFramework/Test/Util/AnnotationExtractor.php index 3b857e29f..d30ed351e 100644 --- a/src/Magento/FunctionalTestingFramework/Test/Util/AnnotationExtractor.php +++ b/src/Magento/FunctionalTestingFramework/Test/Util/AnnotationExtractor.php @@ -8,6 +8,7 @@ use Magento\FunctionalTestingFramework\Config\MftfApplicationConfig; use Magento\FunctionalTestingFramework\Exceptions\XmlException; +use Magento\FunctionalTestingFramework\Test\Objects\ActionObject; use Magento\FunctionalTestingFramework\Util\Logger\LoggingUtil; /** @@ -67,6 +68,9 @@ public function extractAnnotations($testAnnotations, $filename) // parse the Test annotations foreach ($annotations as $annotationKey => $annotationData) { + if (strpos($annotationKey, ActionObject::ACTION_TYPE_COMMENT) !== false) { + continue; + } $annotationValues = []; // Only transform severity annotation if ($annotationKey == "severity") { diff --git a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php index 628145e66..60f12a1d1 100644 --- a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php +++ b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php @@ -1303,6 +1303,8 @@ public function generateStepsPhp($actionObjects, $generationScope = TestGenerato case "skipReadinessCheck": $testSteps .= $this->wrapFunctionCall($actor, $actionObject, $customActionAttributes['state']); break; + case "comment": + $input = $input === null ? strtr($value, ['$' => '\$', '{' => '\{', '}' => '\}']) : $input; default: $testSteps .= $this->wrapFunctionCall( $actor, From 4074560491a288f26131b5e23f3c588383e07f7f Mon Sep 17 00:00:00 2001 From: Alex Kolesnyk <kolesnyk@adobe.com> Date: Fri, 7 Jun 2019 12:00:10 -0500 Subject: [PATCH 13/29] MQE-659: [ALLURE] Include the test "stepKey" in the MFTF Allure Report --- .../Allure/Adapter/MagentoAllureAdapter.php | 8 +++----- .../Codeception/Subscriber/Console.php | 6 ++++++ 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/Magento/FunctionalTestingFramework/Allure/Adapter/MagentoAllureAdapter.php b/src/Magento/FunctionalTestingFramework/Allure/Adapter/MagentoAllureAdapter.php index bce6ec339..f97c1fb7f 100644 --- a/src/Magento/FunctionalTestingFramework/Allure/Adapter/MagentoAllureAdapter.php +++ b/src/Magento/FunctionalTestingFramework/Allure/Adapter/MagentoAllureAdapter.php @@ -198,11 +198,9 @@ public function testEnd() $actionGroupStepKey = null; foreach ($rootStep->getSteps() as $step) { - if ($actionGroupStepKey !== null) { - $stepKey = str_replace($actionGroupStepKey, '', $step->getName()); - if ($stepKey !== '[]' && $stepKey !== null) { - $step->setName($stepKey); - } + $stepKey = str_replace($actionGroupStepKey, '', $step->getName()); + if ($stepKey !== '[]' && $stepKey !== null) { + $step->setName($stepKey); } // if actionGroup flag, start nesting if (strpos($step->getName(), ActionGroupObject::ACTION_GROUP_CONTEXT_START) !== false) { diff --git a/src/Magento/FunctionalTestingFramework/Codeception/Subscriber/Console.php b/src/Magento/FunctionalTestingFramework/Codeception/Subscriber/Console.php index 750c9fca4..7636f9a91 100644 --- a/src/Magento/FunctionalTestingFramework/Codeception/Subscriber/Console.php +++ b/src/Magento/FunctionalTestingFramework/Codeception/Subscriber/Console.php @@ -1,4 +1,9 @@ <?php +/** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ + namespace Magento\FunctionalTestingFramework\Codeception\Subscriber; use Codeception\Event\StepEvent; @@ -68,6 +73,7 @@ public function afterStep(StepEvent $e) * * @param Step $step * @return void + * @SuppressWarnings(PHPMD) */ private function printStepKeys(Step $step) { From 9e19969e26a07e60ea9ec70555834baa128d66eb Mon Sep 17 00:00:00 2001 From: Alex Kolesnyk <kolesnyk@adobe.com> Date: Fri, 7 Jun 2019 13:41:43 -0500 Subject: [PATCH 14/29] MQE-659: [ALLURE] Include the test "stepKey" in the MFTF Allure Report --- .../Allure/Adapter/MagentoAllureAdapter.php | 5 +++-- .../Codeception/Subscriber/Console.php | 5 +++-- .../FunctionalTestingFramework/Util/TestGenerator.php | 2 ++ 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/Magento/FunctionalTestingFramework/Allure/Adapter/MagentoAllureAdapter.php b/src/Magento/FunctionalTestingFramework/Allure/Adapter/MagentoAllureAdapter.php index f97c1fb7f..81a6fe3ba 100644 --- a/src/Magento/FunctionalTestingFramework/Allure/Adapter/MagentoAllureAdapter.php +++ b/src/Magento/FunctionalTestingFramework/Allure/Adapter/MagentoAllureAdapter.php @@ -115,6 +115,7 @@ private function sanitizeGroupName($group) * Override of parent method: * prevent replacing of . to • * strips control characters + * inserts stepKey into step name * * @param StepEvent $stepEvent * @return void @@ -207,7 +208,7 @@ public function testEnd() $step->setName(str_replace(ActionGroupObject::ACTION_GROUP_CONTEXT_START, '', $step->getName())); $actionGroupStepContainer = $step; - preg_match('/\[(?<actionGroupStepKey>.*)\]/', $step->getName(), $matches); + preg_match(TestGenerator::ACTION_GROUP_STEP_KEY_REGEX, $step->getName(), $matches); if (!empty($matches['actionGroupStepKey'])) { $actionGroupStepKey = ucfirst($matches['actionGroupStepKey']); } @@ -266,7 +267,7 @@ private function retrieveStepKey($stepLine) $this->testFiles[$filePath] = explode(PHP_EOL, file_get_contents($filePath)); } - preg_match("/\/\/ stepKey: (?<stepKey>.*)/", $this->testFiles[$filePath][$stepLine], $matches); + preg_match(TestGenerator::ACTION_STEP_KEY_REGEX, $this->testFiles[$filePath][$stepLine], $matches); if (!empty($matches['stepKey'])) { $stepKey = $matches['stepKey']; } diff --git a/src/Magento/FunctionalTestingFramework/Codeception/Subscriber/Console.php b/src/Magento/FunctionalTestingFramework/Codeception/Subscriber/Console.php index 7636f9a91..8c56e7733 100644 --- a/src/Magento/FunctionalTestingFramework/Codeception/Subscriber/Console.php +++ b/src/Magento/FunctionalTestingFramework/Codeception/Subscriber/Console.php @@ -12,6 +12,7 @@ use Codeception\Step\Comment; use Codeception\Test\Interfaces\ScenarioDriven; use Magento\FunctionalTestingFramework\Test\Objects\ActionGroupObject; +use Magento\FunctionalTestingFramework\Util\TestGenerator; use Symfony\Component\Console\Formatter\OutputFormatter; class Console extends \Codeception\Subscriber\Console @@ -85,7 +86,7 @@ private function printStepKeys(Step $step) $isActionGroup = (strpos($step->__toString(), ActionGroupObject::ACTION_GROUP_CONTEXT_START) !== false); if ($isActionGroup) { - preg_match('/\[(?<actionGroupStepKey>.*)\]/', $step->__toString(), $matches); + preg_match(TestGenerator::ACTION_GROUP_STEP_KEY_REGEX, $step->__toString(), $matches); if (!empty($matches['actionGroupStepKey'])) { $this->actionGroupStepKey = ucfirst($matches['actionGroupStepKey']); } @@ -152,7 +153,7 @@ private function retrieveStepKey($stepLine) $this->testFiles[$filePath] = explode(PHP_EOL, file_get_contents($filePath)); } - preg_match("/\/\/ stepKey: (?<stepKey>.*)/", $this->testFiles[$filePath][$stepLine], $matches); + preg_match(TestGenerator::ACTION_STEP_KEY_REGEX, $this->testFiles[$filePath][$stepLine], $matches); if (!empty($matches['stepKey'])) { $stepKey = $matches['stepKey']; } diff --git a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php index 628145e66..2b9b85416 100644 --- a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php +++ b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php @@ -31,6 +31,8 @@ */ class TestGenerator { + const ACTION_GROUP_STEP_KEY_REGEX = "/\[(?<actionGroupStepKey>.*)\]/"; + const ACTION_STEP_KEY_REGEX = "/\/\/ stepKey: (?<stepKey>.*)/"; const REQUIRED_ENTITY_REFERENCE = 'createDataKey'; const GENERATED_DIR = '_generated'; const DEFAULT_DIR = 'default'; From b8f76671a16a19aeb8da4e981abc2dc94f4586ad Mon Sep 17 00:00:00 2001 From: Alex Kolesnyk <kolesnyk@adobe.com> Date: Fri, 7 Jun 2019 15:20:14 -0500 Subject: [PATCH 15/29] MQE-1234: Allow XML Parser to read XML comment into comment action --- dev/tests/functional/tests/MFTF/DevDocs/Test/DevDocsTest.xml | 3 +-- .../ActionGroupWithDefaultArgumentAndStringSelectorParam.txt | 1 + .../ActionGroupWithPassedArgumentAndStringSelectorParam.txt | 1 + .../verification/TestModule/ActionGroup/BasicActionGroup.xml | 3 +++ dev/tests/verification/TestModule/Test/ActionGroupTest.xml | 3 +++ .../Test/Config/Converter/Dom/Flat.php | 2 +- .../Test/Util/ActionGroupObjectExtractor.php | 5 +++++ .../Test/Util/ActionObjectExtractor.php | 3 ++- .../FunctionalTestingFramework/Util/TestGenerator.php | 1 + 9 files changed, 18 insertions(+), 4 deletions(-) diff --git a/dev/tests/functional/tests/MFTF/DevDocs/Test/DevDocsTest.xml b/dev/tests/functional/tests/MFTF/DevDocs/Test/DevDocsTest.xml index ff9e0220d..373bedb30 100644 --- a/dev/tests/functional/tests/MFTF/DevDocs/Test/DevDocsTest.xml +++ b/dev/tests/functional/tests/MFTF/DevDocs/Test/DevDocsTest.xml @@ -10,7 +10,7 @@ xsi:noNamespaceSchemaLocation="../../../../../../../src/Magento/FunctionalTestingFramework/Test/etc/testSchema.xsd"> <test name="DevDocsTest"> <annotations> - <!-- Hwello --> + <!-- Comment in Annotations for DevDocs Test are not affecting test generation --> <features value="DevDocs available"/> <stories value="MFTF DevDocs available"/> <title value="Magento Functional Testing Framework Documentation is available."/> @@ -21,7 +21,6 @@ <!-- Open MFTF DevDocs Page --> <amOnPage stepKey="openMFTFDevDocPage" url="{{MFTFDocPage.url}}" /> - <!--< > & $abc " abc ' <click stepKey="click" userInput="$$createDataHook.firstname$$" selector="#id">/--> <actionGroup ref="AdminNavigateMenuActionGroup" stepKey="asdf" /> <see stepKey="verifyPageIntroText" selector="{{contentSection.pageIntro}}" userInput="Introduction to the Magento Functional Testing Framework" /> </test> diff --git a/dev/tests/verification/Resources/ActionGroupWithDefaultArgumentAndStringSelectorParam.txt b/dev/tests/verification/Resources/ActionGroupWithDefaultArgumentAndStringSelectorParam.txt index 68f95298d..d77d33d1f 100644 --- a/dev/tests/verification/Resources/ActionGroupWithDefaultArgumentAndStringSelectorParam.txt +++ b/dev/tests/verification/Resources/ActionGroupWithDefaultArgumentAndStringSelectorParam.txt @@ -30,6 +30,7 @@ class ActionGroupWithDefaultArgumentAndStringSelectorParamCest public function ActionGroupWithDefaultArgumentAndStringSelectorParam(AcceptanceTester $I) { $I->comment("Entering Action Group [actionGroup] actionGroupWithDefaultArgumentAndStringSelectorParam"); + $I->comment("< > & \$abc \" abc ' <click stepKey=\"click\" userInput=\"\$\$createDataHook.firstname\$\$\" selector=\"#id\">/"); $I->see("John", "#element .test1"); // stepKey: seeFirstNameActionGroup $I->comment("Exiting Action Group [actionGroup] actionGroupWithDefaultArgumentAndStringSelectorParam"); } diff --git a/dev/tests/verification/Resources/ActionGroupWithPassedArgumentAndStringSelectorParam.txt b/dev/tests/verification/Resources/ActionGroupWithPassedArgumentAndStringSelectorParam.txt index 6b85f8b47..c7be840c8 100644 --- a/dev/tests/verification/Resources/ActionGroupWithPassedArgumentAndStringSelectorParam.txt +++ b/dev/tests/verification/Resources/ActionGroupWithPassedArgumentAndStringSelectorParam.txt @@ -30,6 +30,7 @@ class ActionGroupWithPassedArgumentAndStringSelectorParamCest public function ActionGroupWithPassedArgumentAndStringSelectorParam(AcceptanceTester $I) { $I->comment("Entering Action Group [actionGroup] actionGroupWithDefaultArgumentAndStringSelectorParam"); + $I->comment("< > & \$abc \" abc ' <click stepKey=\"click\" userInput=\"\$\$createDataHook.firstname\$\$\" selector=\"#id\">/"); $I->see("John" . msq("UniquePerson"), "#element .test1"); // stepKey: seeFirstNameActionGroup $I->comment("Exiting Action Group [actionGroup] actionGroupWithDefaultArgumentAndStringSelectorParam"); } diff --git a/dev/tests/verification/TestModule/ActionGroup/BasicActionGroup.xml b/dev/tests/verification/TestModule/ActionGroup/BasicActionGroup.xml index 45ccdbd24..f90a44b0a 100644 --- a/dev/tests/verification/TestModule/ActionGroup/BasicActionGroup.xml +++ b/dev/tests/verification/TestModule/ActionGroup/BasicActionGroup.xml @@ -13,9 +13,12 @@ <actionGroup name="actionGroupWithDefaultArgumentAndStringSelectorParam"> <arguments> + <!-- Comments in arguments are not affecting test generation --> + <!-- <argument name="someArgument" defaultValue="ReplacementPerson" /> --> <argument name="someArgument" defaultValue="ReplacementPerson" /> </arguments> + <!--< > & $abc " abc ' <click stepKey="click" userInput="$$createDataHook.firstname$$" selector="#id">/--> <see selector="{{SampleSection.oneParamElement('test1')}}" userInput="{{someArgument.firstname}}" stepKey="seeFirstName" /> </actionGroup> diff --git a/dev/tests/verification/TestModule/Test/ActionGroupTest.xml b/dev/tests/verification/TestModule/Test/ActionGroupTest.xml index 56be24441..1b736611d 100644 --- a/dev/tests/verification/TestModule/Test/ActionGroupTest.xml +++ b/dev/tests/verification/TestModule/Test/ActionGroupTest.xml @@ -15,8 +15,11 @@ <actionGroup ref="actionGroupWithoutArguments" stepKey="actionGroup"/> </test> + <!--< > & $abc " abc ' <click stepKey="click" userInput="$$createDataHook.firstname$$" selector="#id">/--> <test name="ActionGroupWithDefaultArgumentAndStringSelectorParam"> <annotations> + <!-- Comments in Test annotations are not affecting test generation --> + <!-- <severity value="BLOCKER"/> --> <severity value="BLOCKER"/> <title value="Action Group With Default Argument Value and Hardcoded Value in Param"/> </annotations> diff --git a/src/Magento/FunctionalTestingFramework/Test/Config/Converter/Dom/Flat.php b/src/Magento/FunctionalTestingFramework/Test/Config/Converter/Dom/Flat.php index a01841041..6d08c367c 100644 --- a/src/Magento/FunctionalTestingFramework/Test/Config/Converter/Dom/Flat.php +++ b/src/Magento/FunctionalTestingFramework/Test/Config/Converter/Dom/Flat.php @@ -125,7 +125,7 @@ public function convertXml(\DOMNode $source, $basePath = '') $value = $node->nodeValue; break; } elseif ($node->nodeType == XML_COMMENT_NODE) { - $uniqid = uniqid(str_replace("#", "", $node->nodeName)); + $uniqid = uniqid($node->nodeName); $value[$uniqid] = [ 'value' => trim($node->nodeValue), 'nodeName' => $node->nodeName, diff --git a/src/Magento/FunctionalTestingFramework/Test/Util/ActionGroupObjectExtractor.php b/src/Magento/FunctionalTestingFramework/Test/Util/ActionGroupObjectExtractor.php index 74665cf75..34da71231 100644 --- a/src/Magento/FunctionalTestingFramework/Test/Util/ActionGroupObjectExtractor.php +++ b/src/Magento/FunctionalTestingFramework/Test/Util/ActionGroupObjectExtractor.php @@ -9,6 +9,7 @@ use Magento\FunctionalTestingFramework\Data\Argument\Interpreter\Argument; use Magento\FunctionalTestingFramework\Exceptions\XmlException; use Magento\FunctionalTestingFramework\Test\Objects\ActionGroupObject; +use Magento\FunctionalTestingFramework\Test\Objects\ActionObject; use Magento\FunctionalTestingFramework\Test\Objects\ArgumentObject; /** @@ -117,6 +118,10 @@ private function extractArguments($arguments) self::NODE_NAME ); + $argData = array_filter($argData, function ($key) { + return strpos($key, ActionObject::COMMENT_ACTION) === false; + }, ARRAY_FILTER_USE_KEY); + foreach ($argData as $argName => $argValue) { $parsedArguments[] = new ArgumentObject( $argValue[ArgumentObject::ARGUMENT_NAME], diff --git a/src/Magento/FunctionalTestingFramework/Test/Util/ActionObjectExtractor.php b/src/Magento/FunctionalTestingFramework/Test/Util/ActionObjectExtractor.php index 605a1fdc2..fc874fa24 100644 --- a/src/Magento/FunctionalTestingFramework/Test/Util/ActionObjectExtractor.php +++ b/src/Magento/FunctionalTestingFramework/Test/Util/ActionObjectExtractor.php @@ -58,9 +58,10 @@ public function extractActions($testActions, $testName = null) $stepKeyRefs = []; foreach ($testActions as $actionName => $actionData) { + // Removing # from nodeName to match stepKey requirements $stepKey = strpos($actionData[self::NODE_NAME], ActionObject::COMMENT_ACTION) === false ? $actionData[self::TEST_STEP_MERGE_KEY] - : $actionName; + : str_replace("#", "", $actionName); $actionType = $actionData[self::NODE_NAME]; if (empty($stepKey)) { diff --git a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php index c9a1e6c00..8c9420337 100644 --- a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php +++ b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php @@ -1306,6 +1306,7 @@ public function generateStepsPhp($actionObjects, $generationScope = TestGenerato $testSteps .= $this->wrapFunctionCall($actor, $actionObject, $customActionAttributes['state']); break; case "comment": + // Combining userInput from native XML comment and <comment /> action and fall-through 'default' case. $input = $input === null ? strtr($value, ['$' => '\$', '{' => '\{', '}' => '\}']) : $input; default: $testSteps .= $this->wrapFunctionCall( From 11ad7df4277a3ebd224315e32d7ea3382157cd42 Mon Sep 17 00:00:00 2001 From: John S <john00ivy@gmail.com> Date: Mon, 10 Jun 2019 09:18:29 -0500 Subject: [PATCH 16/29] MQE-1580: Remove the "page" attribute from the Action Group annotations node. - Correcting the expected Text in the Static Test. --- dev/tests/unit/Resources/alteredDocumentation.txt | 1 + dev/tests/unit/Resources/basicDocumentation.txt | 1 + 2 files changed, 2 insertions(+) diff --git a/dev/tests/unit/Resources/alteredDocumentation.txt b/dev/tests/unit/Resources/alteredDocumentation.txt index 5e4d70774..0684134f5 100644 --- a/dev/tests/unit/Resources/alteredDocumentation.txt +++ b/dev/tests/unit/Resources/alteredDocumentation.txt @@ -6,5 +6,6 @@ This documentation contains a list of all Action Groups. - alteredDescription **Located In**: + - filename *** diff --git a/dev/tests/unit/Resources/basicDocumentation.txt b/dev/tests/unit/Resources/basicDocumentation.txt index 43f1c9521..3bc16cbac 100644 --- a/dev/tests/unit/Resources/basicDocumentation.txt +++ b/dev/tests/unit/Resources/basicDocumentation.txt @@ -6,5 +6,6 @@ This documentation contains a list of all Action Groups. - someDescription **Located In**: + - filename *** From 96210c9fbb5d7191d67344624186c9a36df1a519 Mon Sep 17 00:00:00 2001 From: John S <john00ivy@gmail.com> Date: Mon, 10 Jun 2019 09:28:45 -0500 Subject: [PATCH 17/29] MQE-1580: Remove the "page" attribute from the Action Group annotations node. - Correcting the expected Text in the Static Test. --- src/Magento/FunctionalTestingFramework/Util/DocGenerator.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Magento/FunctionalTestingFramework/Util/DocGenerator.php b/src/Magento/FunctionalTestingFramework/Util/DocGenerator.php index 0eacf46e2..2642a715f 100644 --- a/src/Magento/FunctionalTestingFramework/Util/DocGenerator.php +++ b/src/Magento/FunctionalTestingFramework/Util/DocGenerator.php @@ -128,7 +128,7 @@ private function transformToMarkdown($annotationList) $markdown .= "**Located In**:" . PHP_EOL; foreach ($annotations[self::FILENAMES] as $filename) { $relativeFilename = str_replace(MAGENTO_BP . DIRECTORY_SEPARATOR, "", $filename); - $markdown .= "- $relativeFilename"; + $markdown .= PHP_EOL . "- $relativeFilename"; } $markdown .= PHP_EOL . "***" . PHP_EOL; } From aa456207769ef63ec08fe6d74cdcc11de39d3787 Mon Sep 17 00:00:00 2001 From: John S <john00ivy@gmail.com> Date: Mon, 10 Jun 2019 09:58:19 -0500 Subject: [PATCH 18/29] MQE-1580: Remove the "page" attribute from the Action Group annotations node. - Correcting the expected Text in the Static Test. --- src/Magento/FunctionalTestingFramework/Util/DocGenerator.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Magento/FunctionalTestingFramework/Util/DocGenerator.php b/src/Magento/FunctionalTestingFramework/Util/DocGenerator.php index 2642a715f..ea5f4df7f 100644 --- a/src/Magento/FunctionalTestingFramework/Util/DocGenerator.php +++ b/src/Magento/FunctionalTestingFramework/Util/DocGenerator.php @@ -111,6 +111,7 @@ private function transformToMarkdown($annotationList) $markdown .= "---" . PHP_EOL; foreach ($annotationList as $group => $objects) { foreach ($objects as $name => $annotations) { + $markdown .= PHP_EOL; $markdown .= "###$name" . PHP_EOL; $markdown .= "**Description**:" . PHP_EOL; $markdown .= "- " . $annotations[actionGroupObject::ACTION_GROUP_DESCRIPTION] . PHP_EOL . PHP_EOL; From 4dadaf78d198b6b136bbfb4310b4a4e82f584359 Mon Sep 17 00:00:00 2001 From: John S <john00ivy@gmail.com> Date: Mon, 10 Jun 2019 10:07:07 -0500 Subject: [PATCH 19/29] MQE-1580: Remove the "page" attribute from the Action Group annotations node. - Correcting the expected Text in the Static Test. --- src/Magento/FunctionalTestingFramework/Util/DocGenerator.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Magento/FunctionalTestingFramework/Util/DocGenerator.php b/src/Magento/FunctionalTestingFramework/Util/DocGenerator.php index ea5f4df7f..2642a715f 100644 --- a/src/Magento/FunctionalTestingFramework/Util/DocGenerator.php +++ b/src/Magento/FunctionalTestingFramework/Util/DocGenerator.php @@ -111,7 +111,6 @@ private function transformToMarkdown($annotationList) $markdown .= "---" . PHP_EOL; foreach ($annotationList as $group => $objects) { foreach ($objects as $name => $annotations) { - $markdown .= PHP_EOL; $markdown .= "###$name" . PHP_EOL; $markdown .= "**Description**:" . PHP_EOL; $markdown .= "- " . $annotations[actionGroupObject::ACTION_GROUP_DESCRIPTION] . PHP_EOL . PHP_EOL; From 9e44d05bba823e433753550a891e3689451393a4 Mon Sep 17 00:00:00 2001 From: Alex Kolesnyk <kolesnyk@adobe.com> Date: Mon, 10 Jun 2019 10:48:36 -0500 Subject: [PATCH 20/29] MQE-1234: Allow XML Parser to read XML comment into comment action --- .../tests/MFTF/DevDocs/Test/DevDocsTest.xml | 1 - ...hDefaultArgumentAndStringSelectorParam.txt | 1 - ...thPassedArgumentAndStringSelectorParam.txt | 1 - .../Resources/XmlCommentedActionGroupTest.txt | 37 ++++++++++ .../Resources/XmlCommentedTest.txt | 74 +++++++++++++++++++ .../ActionGroup/BasicActionGroup.xml | 3 - .../ActionGroup/XmlCommentedActionGroup.xml | 20 +++++ .../TestModule/Test/ActionGroupTest.xml | 3 - .../Test/XmlCommentedActionGroupTest.xml | 17 +++++ .../TestModule/Test/XmlCommentedTest.xml | 42 +++++++++++ .../Tests/ActionGroupGenerationTest.php | 11 +++ .../Tests/BasicCestGenerationTest.php | 15 ++++ .../Test/Util/ActionGroupObjectExtractor.php | 1 + .../Util/TestGenerator.php | 2 +- 14 files changed, 218 insertions(+), 10 deletions(-) create mode 100644 dev/tests/verification/Resources/XmlCommentedActionGroupTest.txt create mode 100644 dev/tests/verification/Resources/XmlCommentedTest.txt create mode 100644 dev/tests/verification/TestModule/ActionGroup/XmlCommentedActionGroup.xml create mode 100644 dev/tests/verification/TestModule/Test/XmlCommentedActionGroupTest.xml create mode 100644 dev/tests/verification/TestModule/Test/XmlCommentedTest.xml diff --git a/dev/tests/functional/tests/MFTF/DevDocs/Test/DevDocsTest.xml b/dev/tests/functional/tests/MFTF/DevDocs/Test/DevDocsTest.xml index 373bedb30..3bdeeb9e8 100644 --- a/dev/tests/functional/tests/MFTF/DevDocs/Test/DevDocsTest.xml +++ b/dev/tests/functional/tests/MFTF/DevDocs/Test/DevDocsTest.xml @@ -21,7 +21,6 @@ <!-- Open MFTF DevDocs Page --> <amOnPage stepKey="openMFTFDevDocPage" url="{{MFTFDocPage.url}}" /> - <actionGroup ref="AdminNavigateMenuActionGroup" stepKey="asdf" /> <see stepKey="verifyPageIntroText" selector="{{contentSection.pageIntro}}" userInput="Introduction to the Magento Functional Testing Framework" /> </test> </tests> diff --git a/dev/tests/verification/Resources/ActionGroupWithDefaultArgumentAndStringSelectorParam.txt b/dev/tests/verification/Resources/ActionGroupWithDefaultArgumentAndStringSelectorParam.txt index d77d33d1f..68f95298d 100644 --- a/dev/tests/verification/Resources/ActionGroupWithDefaultArgumentAndStringSelectorParam.txt +++ b/dev/tests/verification/Resources/ActionGroupWithDefaultArgumentAndStringSelectorParam.txt @@ -30,7 +30,6 @@ class ActionGroupWithDefaultArgumentAndStringSelectorParamCest public function ActionGroupWithDefaultArgumentAndStringSelectorParam(AcceptanceTester $I) { $I->comment("Entering Action Group [actionGroup] actionGroupWithDefaultArgumentAndStringSelectorParam"); - $I->comment("< > & \$abc \" abc ' <click stepKey=\"click\" userInput=\"\$\$createDataHook.firstname\$\$\" selector=\"#id\">/"); $I->see("John", "#element .test1"); // stepKey: seeFirstNameActionGroup $I->comment("Exiting Action Group [actionGroup] actionGroupWithDefaultArgumentAndStringSelectorParam"); } diff --git a/dev/tests/verification/Resources/ActionGroupWithPassedArgumentAndStringSelectorParam.txt b/dev/tests/verification/Resources/ActionGroupWithPassedArgumentAndStringSelectorParam.txt index c7be840c8..6b85f8b47 100644 --- a/dev/tests/verification/Resources/ActionGroupWithPassedArgumentAndStringSelectorParam.txt +++ b/dev/tests/verification/Resources/ActionGroupWithPassedArgumentAndStringSelectorParam.txt @@ -30,7 +30,6 @@ class ActionGroupWithPassedArgumentAndStringSelectorParamCest public function ActionGroupWithPassedArgumentAndStringSelectorParam(AcceptanceTester $I) { $I->comment("Entering Action Group [actionGroup] actionGroupWithDefaultArgumentAndStringSelectorParam"); - $I->comment("< > & \$abc \" abc ' <click stepKey=\"click\" userInput=\"\$\$createDataHook.firstname\$\$\" selector=\"#id\">/"); $I->see("John" . msq("UniquePerson"), "#element .test1"); // stepKey: seeFirstNameActionGroup $I->comment("Exiting Action Group [actionGroup] actionGroupWithDefaultArgumentAndStringSelectorParam"); } diff --git a/dev/tests/verification/Resources/XmlCommentedActionGroupTest.txt b/dev/tests/verification/Resources/XmlCommentedActionGroupTest.txt new file mode 100644 index 000000000..4605cc350 --- /dev/null +++ b/dev/tests/verification/Resources/XmlCommentedActionGroupTest.txt @@ -0,0 +1,37 @@ +<?php +namespace Magento\AcceptanceTest\_default\Backend; + +use Magento\FunctionalTestingFramework\AcceptanceTester; +use Magento\FunctionalTestingFramework\DataGenerator\Handlers\CredentialStore; +use Magento\FunctionalTestingFramework\DataGenerator\Handlers\PersistedObjectHandler; +use \Codeception\Util\Locator; +use Yandex\Allure\Adapter\Annotation\Features; +use Yandex\Allure\Adapter\Annotation\Stories; +use Yandex\Allure\Adapter\Annotation\Title; +use Yandex\Allure\Adapter\Annotation\Description; +use Yandex\Allure\Adapter\Annotation\Parameter; +use Yandex\Allure\Adapter\Annotation\Severity; +use Yandex\Allure\Adapter\Model\SeverityLevel; +use Yandex\Allure\Adapter\Annotation\TestCaseId; + +/** + * @Title("[NO TESTCASEID]: Action Group With comment block in arguments and action group body") + */ +class XmlCommentedActionGroupTestCest +{ + /** + * @Severity(level = SeverityLevel::CRITICAL) + * @Features({"TestModule"}) + * @Parameter(name = "AcceptanceTester", value="$I") + * @param AcceptanceTester $I + * @return void + * @throws \Exception + */ + public function XmlCommentedActionGroupTest(AcceptanceTester $I) + { + $I->comment("Entering Action Group [actionGroup] XmlCommentedActionGroup"); + $I->comment("< > & \$abc \" abc ' <click stepKey=\"click\" userInput=\"\$\$createDataHook.firstname\$\$\" selector=\"#id\">/"); + $I->see("John", "#element .test1"); // stepKey: seeFirstNameActionGroup + $I->comment("Exiting Action Group [actionGroup] XmlCommentedActionGroup"); + } +} diff --git a/dev/tests/verification/Resources/XmlCommentedTest.txt b/dev/tests/verification/Resources/XmlCommentedTest.txt new file mode 100644 index 000000000..1d8bca5aa --- /dev/null +++ b/dev/tests/verification/Resources/XmlCommentedTest.txt @@ -0,0 +1,74 @@ +<?php +namespace Magento\AcceptanceTest\_default\Backend; + +use Magento\FunctionalTestingFramework\AcceptanceTester; +use Magento\FunctionalTestingFramework\DataGenerator\Handlers\CredentialStore; +use Magento\FunctionalTestingFramework\DataGenerator\Handlers\PersistedObjectHandler; +use \Codeception\Util\Locator; +use Yandex\Allure\Adapter\Annotation\Features; +use Yandex\Allure\Adapter\Annotation\Stories; +use Yandex\Allure\Adapter\Annotation\Title; +use Yandex\Allure\Adapter\Annotation\Description; +use Yandex\Allure\Adapter\Annotation\Parameter; +use Yandex\Allure\Adapter\Annotation\Severity; +use Yandex\Allure\Adapter\Model\SeverityLevel; +use Yandex\Allure\Adapter\Annotation\TestCaseId; + +/** + * @Title("[NO TESTCASEID]: Test With comment blocks in root element 'tests', in annotations and in test body.") + */ +class XmlCommentedTestCest +{ + /** + * @param AcceptanceTester $I + * @throws \Exception + */ + public function _before(AcceptanceTester $I) + { + $I->comment("< > & \$abc \" abc ' <click stepKey=\"click\" userInput=\"\$\$createDataHook.firstname\$\$\" selector=\"#id_1\">/"); + $I->amOnPage("/beforeUrl"); // stepKey: beforeAmOnPageKey + $I->comment("< > & \$abc \" abc ' <click stepKey=\"click\" userInput=\"\$\$createDataHook.firstname\$\$\" selector=\"#id_2\">/"); + } + + /** + * @param AcceptanceTester $I + * @throws \Exception + */ + public function _after(AcceptanceTester $I) + { + $I->comment("< > & \$abc \" abc ' <click stepKey=\"click\" userInput=\"\$\$createDataHook.firstname\$\$\" selector=\"#id_1\">/"); + $I->amOnPage("/afterUrl"); // stepKey: afterAmOnPageKey + $I->comment("< > & \$abc \" abc ' <click stepKey=\"click\" userInput=\"\$\$createDataHook.firstname\$\$\" selector=\"#id_2\">/"); + } + + /** + * @param AcceptanceTester $I + * @throws \Exception + */ + public function _failed(AcceptanceTester $I) + { + $I->saveScreenshot(); // stepKey: saveScreenshot + } + + /** + * @Severity(level = SeverityLevel::CRITICAL) + * @Features({"TestModule"}) + * @Parameter(name = "AcceptanceTester", value="$I") + * @param AcceptanceTester $I + * @return void + * @throws \Exception + */ + public function XmlCommentedTest(AcceptanceTester $I) + { + $I->comment("< > & \$abc \" abc ' <click stepKey=\"click\" userInput=\"\$\$createDataHook.firstname\$\$\" selector=\"#id_1\">/"); + $someVarDefinition = $I->grabValueFrom(); // stepKey: someVarDefinition + $I->acceptPopup(); // stepKey: acceptPopupKey1 + $I->comment("< > & \$abc \" abc ' <click stepKey=\"click\" userInput=\"\$\$createDataHook.firstname\$\$\" selector=\"#id_2\">/"); + $I->amOnPage("/test/url"); // stepKey: amOnPageKey1 + $I->appendField(".functionalTestSelector"); // stepKey: appendFieldKey1 + $I->comment("< > & \$abc \" abc ' <click stepKey=\"click\" userInput=\"\$\$createDataHook.firstname\$\$\" selector=\"#id_3\">/"); + $I->attachFile(".functionalTestSelector", "testFileAttachment"); // stepKey: attachFileKey1 + $I->comment("<cancelPopup stepKey=\"cancelPopupKey1\"/>"); + $I->checkOption(".functionalTestSelector"); // stepKey: checkOptionKey1 + } +} diff --git a/dev/tests/verification/TestModule/ActionGroup/BasicActionGroup.xml b/dev/tests/verification/TestModule/ActionGroup/BasicActionGroup.xml index f90a44b0a..45ccdbd24 100644 --- a/dev/tests/verification/TestModule/ActionGroup/BasicActionGroup.xml +++ b/dev/tests/verification/TestModule/ActionGroup/BasicActionGroup.xml @@ -13,12 +13,9 @@ <actionGroup name="actionGroupWithDefaultArgumentAndStringSelectorParam"> <arguments> - <!-- Comments in arguments are not affecting test generation --> - <!-- <argument name="someArgument" defaultValue="ReplacementPerson" /> --> <argument name="someArgument" defaultValue="ReplacementPerson" /> </arguments> - <!--< > & $abc " abc ' <click stepKey="click" userInput="$$createDataHook.firstname$$" selector="#id">/--> <see selector="{{SampleSection.oneParamElement('test1')}}" userInput="{{someArgument.firstname}}" stepKey="seeFirstName" /> </actionGroup> diff --git a/dev/tests/verification/TestModule/ActionGroup/XmlCommentedActionGroup.xml b/dev/tests/verification/TestModule/ActionGroup/XmlCommentedActionGroup.xml new file mode 100644 index 000000000..a46dab939 --- /dev/null +++ b/dev/tests/verification/TestModule/ActionGroup/XmlCommentedActionGroup.xml @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="../../../../../src/Magento/FunctionalTestingFramework/Test/etc/actionGroupSchema.xsd"> + <actionGroup name="XmlCommentedActionGroup"> + <arguments> + <!-- Comments in arguments are not affecting test generation --> + <!-- <argument name="someArgument" defaultValue="ReplacementPerson" /> --> + <argument name="someArgument" defaultValue="ReplacementPerson" /> + </arguments> + + <!--< > & $abc " abc ' <click stepKey="click" userInput="$$createDataHook.firstname$$" selector="#id">/--> + <see selector="{{SampleSection.oneParamElement('test1')}}" userInput="{{someArgument.firstname}}" stepKey="seeFirstName" /> + </actionGroup> +</actionGroups> diff --git a/dev/tests/verification/TestModule/Test/ActionGroupTest.xml b/dev/tests/verification/TestModule/Test/ActionGroupTest.xml index 1b736611d..56be24441 100644 --- a/dev/tests/verification/TestModule/Test/ActionGroupTest.xml +++ b/dev/tests/verification/TestModule/Test/ActionGroupTest.xml @@ -15,11 +15,8 @@ <actionGroup ref="actionGroupWithoutArguments" stepKey="actionGroup"/> </test> - <!--< > & $abc " abc ' <click stepKey="click" userInput="$$createDataHook.firstname$$" selector="#id">/--> <test name="ActionGroupWithDefaultArgumentAndStringSelectorParam"> <annotations> - <!-- Comments in Test annotations are not affecting test generation --> - <!-- <severity value="BLOCKER"/> --> <severity value="BLOCKER"/> <title value="Action Group With Default Argument Value and Hardcoded Value in Param"/> </annotations> diff --git a/dev/tests/verification/TestModule/Test/XmlCommentedActionGroupTest.xml b/dev/tests/verification/TestModule/Test/XmlCommentedActionGroupTest.xml new file mode 100644 index 000000000..f7fbd8dd6 --- /dev/null +++ b/dev/tests/verification/TestModule/Test/XmlCommentedActionGroupTest.xml @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="../../../../../src/Magento/FunctionalTestingFramework/Test/etc/testSchema.xsd"> + <test name="XmlCommentedActionGroupTest"> + <annotations> + <severity value="CRITICAL"/> + <title value="Action Group With comment block in arguments and action group body"/> + </annotations> + <actionGroup ref="XmlCommentedActionGroup" stepKey="actionGroup"/> + </test> +</tests> diff --git a/dev/tests/verification/TestModule/Test/XmlCommentedTest.xml b/dev/tests/verification/TestModule/Test/XmlCommentedTest.xml new file mode 100644 index 000000000..133588872 --- /dev/null +++ b/dev/tests/verification/TestModule/Test/XmlCommentedTest.xml @@ -0,0 +1,42 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + /** + * Copyright © Magento, Inc. All rights reserved. + * See COPYING.txt for license details. + */ +--> +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="../../../../../src/Magento/FunctionalTestingFramework/Test/etc/testSchema.xsd"> + <!--< > & $abc " abc ' <click stepKey="click" userInput="$$createDataHook.firstname$$" selector="#id">/--> + <test name="XmlCommentedTest"> + <annotations> + <!-- Comments in Test annotations are not affecting test generation --> + <!-- <severity value="BLOCKER"/> --> + <severity value="CRITICAL"/> + <title value="Test With comment blocks in root element 'tests', in annotations and in test body."/> + </annotations> + <before> + <!--< > & $abc " abc ' <click stepKey="click" userInput="$$createDataHook.firstname$$" selector="#id_1">/--> + <amOnPage url="/beforeUrl" stepKey="beforeAmOnPageKey"/> + <!--< > & $abc " abc ' <click stepKey="click" userInput="$$createDataHook.firstname$$" selector="#id_2">/--> + </before> + <after> + <!--< > & $abc " abc ' <click stepKey="click" userInput="$$createDataHook.firstname$$" selector="#id_1">/--> + <amOnPage url="/afterUrl" stepKey="afterAmOnPageKey"/> + <!--< > & $abc " abc ' <click stepKey="click" userInput="$$createDataHook.firstname$$" selector="#id_2">/--> + </after> + + <!--< > & $abc " abc ' <click stepKey="click" userInput="$$createDataHook.firstname$$" selector="#id_1">/--> + <grabValueFrom stepKey="someVarDefinition"/> + <acceptPopup stepKey="acceptPopupKey1"/> + + <!--< > & $abc " abc ' <click stepKey="click" userInput="$$createDataHook.firstname$$" selector="#id_2">/--> + <amOnPage stepKey="amOnPageKey1" url="/test/url"/> + <appendField selector=".functionalTestSelector" stepKey="appendFieldKey1" /> + + <!--< > & $abc " abc ' <click stepKey="click" userInput="$$createDataHook.firstname$$" selector="#id_3">/--> + <attachFile userInput="testFileAttachment" selector=".functionalTestSelector" stepKey="attachFileKey1" /> +<!-- <cancelPopup stepKey="cancelPopupKey1"/>--> + <checkOption selector=".functionalTestSelector" stepKey="checkOptionKey1"/> + </test> +</tests> diff --git a/dev/tests/verification/Tests/ActionGroupGenerationTest.php b/dev/tests/verification/Tests/ActionGroupGenerationTest.php index 613d6cb72..604f546b2 100644 --- a/dev/tests/verification/Tests/ActionGroupGenerationTest.php +++ b/dev/tests/verification/Tests/ActionGroupGenerationTest.php @@ -206,4 +206,15 @@ public function testActionGroupWithHyphen() { $this->generateAndCompareTest('ActionGroupWithParameterizedElementWithHyphen'); } + + /** + * Test generation of a test referencing an action group with xml comment in arguments and action group body. + * + * @throws \Exception + * @throws \Magento\FunctionalTestingFramework\Exceptions\TestReferenceException + */ + public function testActionGroupWithXmlComments() + { + $this->generateAndCompareTest('XmlCommentedActionGroupTest'); + } } diff --git a/dev/tests/verification/Tests/BasicCestGenerationTest.php b/dev/tests/verification/Tests/BasicCestGenerationTest.php index b03cbc487..793b2a502 100644 --- a/dev/tests/verification/Tests/BasicCestGenerationTest.php +++ b/dev/tests/verification/Tests/BasicCestGenerationTest.php @@ -19,4 +19,19 @@ public function testBasicGeneration() { $this->generateAndCompareTest('BasicFunctionalTest'); } + + /** + * Tests flat generation of a hardcoded test file with no external references and with XML comments in: + * - root `tests` element + * - test body + * - test before and after blocks + * - annotations block + * + * @throws \Exception + * @throws \Magento\FunctionalTestingFramework\Exceptions\TestReferenceException + */ + public function testWithXmlComments() + { + $this->generateAndCompareTest('XmlCommentedTest'); + } } diff --git a/src/Magento/FunctionalTestingFramework/Test/Util/ActionGroupObjectExtractor.php b/src/Magento/FunctionalTestingFramework/Test/Util/ActionGroupObjectExtractor.php index 34da71231..e41329cb3 100644 --- a/src/Magento/FunctionalTestingFramework/Test/Util/ActionGroupObjectExtractor.php +++ b/src/Magento/FunctionalTestingFramework/Test/Util/ActionGroupObjectExtractor.php @@ -118,6 +118,7 @@ private function extractArguments($arguments) self::NODE_NAME ); + // Filtering XML comments from action group arguments. $argData = array_filter($argData, function ($key) { return strpos($key, ActionObject::COMMENT_ACTION) === false; }, ARRAY_FILTER_USE_KEY); diff --git a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php index 8c9420337..bd4e2d3be 100644 --- a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php +++ b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php @@ -1306,8 +1306,8 @@ public function generateStepsPhp($actionObjects, $generationScope = TestGenerato $testSteps .= $this->wrapFunctionCall($actor, $actionObject, $customActionAttributes['state']); break; case "comment": - // Combining userInput from native XML comment and <comment /> action and fall-through 'default' case. $input = $input === null ? strtr($value, ['$' => '\$', '{' => '\{', '}' => '\}']) : $input; + // Combining userInput from native XML comment and <comment/> action to fall-through 'default' case default: $testSteps .= $this->wrapFunctionCall( $actor, From f6eb3ab6ba63a4a00b565063b58ab9de4524c91d Mon Sep 17 00:00:00 2001 From: Kevin Kozan <kkozan@magento.com> Date: Tue, 11 Jun 2019 11:28:51 -0500 Subject: [PATCH 21/29] MQE-1234: Allow XML Parser to read XML comment into comment action - bugfix + new verification tests --- .../Resources/PersistenceCustomFieldsTest.txt | 20 +-- .../Resources/functionalSuiteHooks.txt | 10 +- .../Resources/functionalSuiteWithComments.txt | 134 ++++++++++++++++++ .../Tests/SuiteGenerationTest.php | 59 ++++++++ .../verification/_suite/functionalSuite.xml | 24 ++++ .../Suite/Generators/GroupClassGenerator.php | 8 +- .../Util/TestGenerator.php | 3 +- 7 files changed, 239 insertions(+), 19 deletions(-) create mode 100644 dev/tests/verification/Resources/functionalSuiteWithComments.txt diff --git a/dev/tests/verification/Resources/PersistenceCustomFieldsTest.txt b/dev/tests/verification/Resources/PersistenceCustomFieldsTest.txt index 92b128808..68ded6711 100644 --- a/dev/tests/verification/Resources/PersistenceCustomFieldsTest.txt +++ b/dev/tests/verification/Resources/PersistenceCustomFieldsTest.txt @@ -25,9 +25,9 @@ class PersistenceCustomFieldsTestCest public function _before(AcceptanceTester $I) { $createData1Fields['firstname'] = "Mac"; - // stepKey: createData1Firstname + $createData1Fields['lastname'] = "Doe"; - // stepKey: createData1Lastname + $I->comment("[createData1] create 'DefaultPerson' entity"); PersistedObjectHandler::getInstance()->createEntity( "createData1", @@ -38,7 +38,7 @@ class PersistenceCustomFieldsTestCest ); $createData2Fields['firstname'] = PersistedObjectHandler::getInstance()->retrieveEntityField('createData1', 'firstname', 'hook'); - // stepKey: createData2Firstname + $I->comment("[createData2] create 'uniqueData' entity"); PersistedObjectHandler::getInstance()->createEntity( "createData2", @@ -60,9 +60,9 @@ class PersistenceCustomFieldsTestCest public function PersistenceCustomFieldsTest(AcceptanceTester $I) { $createdDataFields['favoriteIndex'] = "1"; - // stepKey: createdDataFavoriteIndex + $createdDataFields['middlename'] = "Kovacs"; - // stepKey: createdDataMiddlename + $I->comment("[createdData] create 'simpleData' entity"); PersistedObjectHandler::getInstance()->createEntity( "createdData", @@ -73,9 +73,9 @@ class PersistenceCustomFieldsTestCest ); $createdData3Fields['firstname'] = "Takeshi"; - // stepKey: createdData3Firstname + $createdData3Fields['lastname'] = "Kovacs"; - // stepKey: createdData3Lastname + $I->comment("[createdData3] create 'UniquePerson' entity"); PersistedObjectHandler::getInstance()->createEntity( "createdData3", @@ -87,7 +87,7 @@ class PersistenceCustomFieldsTestCest $I->comment("Entering Action Group [createdAG] PersistenceActionGroup"); $createDataAG1CreatedAGFields['firstname'] = "string1"; - // stepKey: createDataAG1FirstnameCreatedAG + $I->comment("[createDataAG1CreatedAG] create 'simpleData' entity"); PersistedObjectHandler::getInstance()->createEntity( "createDataAG1CreatedAG", @@ -98,7 +98,7 @@ class PersistenceCustomFieldsTestCest ); $createDataAG2CreatedAGFields['firstname'] = "Jane"; - // stepKey: createDataAG2FirstnameCreatedAG + $I->comment("[createDataAG2CreatedAG] create 'simpleData' entity"); PersistedObjectHandler::getInstance()->createEntity( "createDataAG2CreatedAG", @@ -109,7 +109,7 @@ class PersistenceCustomFieldsTestCest ); $createDataAG3CreatedAGFields['firstname'] = PersistedObjectHandler::getInstance()->retrieveEntityField('createdData3', 'firstname', 'test'); - // stepKey: createDataAG3FirstnameCreatedAG + $I->comment("[createDataAG3CreatedAG] create 'simpleData' entity"); PersistedObjectHandler::getInstance()->createEntity( "createDataAG3CreatedAG", diff --git a/dev/tests/verification/Resources/functionalSuiteHooks.txt b/dev/tests/verification/Resources/functionalSuiteHooks.txt index ee0770ce8..4df805329 100644 --- a/dev/tests/verification/Resources/functionalSuiteHooks.txt +++ b/dev/tests/verification/Resources/functionalSuiteHooks.txt @@ -51,7 +51,7 @@ class functionalSuiteHooks extends \Codeception\GroupObject // initialize the webdriver session $webDriver->_initializeSession(); - $webDriver->amOnPage("some.url"); + $webDriver->amOnPage("some.url"); // stepKey: before $createFields['someKey'] = "dataHere"; PersistedObjectHandler::getInstance()->createEntity( "create", @@ -59,9 +59,9 @@ class functionalSuiteHooks extends \Codeception\GroupObject "createThis", $createFields ); - $webDriver->click(PersistedObjectHandler::getInstance()->retrieveEntityField('create', 'data', 'suite')); + $webDriver->click(PersistedObjectHandler::getInstance()->retrieveEntityField('create', 'data', 'suite')); // stepKey: clickWithData print("Entering Action Group [AC] actionGroupWithTwoArguments"); - $webDriver->see("John", msq("uniqueData") . "John"); + $webDriver->see("John", msq("uniqueData") . "John"); // stepKey: seeFirstNameAC print("Exiting Action Group [AC] actionGroupWithTwoArguments"); // reset configuration and close session @@ -120,10 +120,10 @@ class functionalSuiteHooks extends \Codeception\GroupObject // initialize the webdriver session $webDriver->_initializeSession(); - $webDriver->amOnPage("some.url"); + $webDriver->amOnPage("some.url"); // stepKey: after $webDriver->deleteEntityByUrl("deleteThis"); print("Entering Action Group [AC] actionGroupWithTwoArguments"); - $webDriver->see("John", msq("uniqueData") . "John"); + $webDriver->see("John", msq("uniqueData") . "John"); // stepKey: seeFirstNameAC print("Exiting Action Group [AC] actionGroupWithTwoArguments"); } catch (\Exception $exception) { print $exception->getMessage(); diff --git a/dev/tests/verification/Resources/functionalSuiteWithComments.txt b/dev/tests/verification/Resources/functionalSuiteWithComments.txt new file mode 100644 index 000000000..d0e059aab --- /dev/null +++ b/dev/tests/verification/Resources/functionalSuiteWithComments.txt @@ -0,0 +1,134 @@ +<?php + +namespace Group; + +use Magento\FunctionalTestingFramework\DataGenerator\Handlers\PersistedObjectHandler; + +/** + * Group class is Codeception Extension which is allowed to handle to all internal events. + * This class itself can be used to listen events for test execution of one particular group. + * It may be especially useful to create fixtures data, prepare server, etc. + * + * INSTALLATION: + * + * To use this group extension, include it to "extensions" option of global Codeception config. + */ +class functionalSuiteWithComments extends \Codeception\GroupObject +{ + public static $group = 'functionalSuiteWithComments'; + private $testCount = 1; + private $preconditionFailure = null; + private $currentTestRun = 0; + private static $HOOK_EXECUTION_INIT = "\n/******** Beginning execution of functionalSuiteWithComments suite %s block ********/\n"; + private static $HOOK_EXECUTION_END = "\n/******** Execution of functionalSuiteWithComments suite %s block complete ********/\n"; + + public function _before(\Codeception\Event\TestEvent $e) + { + // increment test count per execution + $this->currentTestRun++; + $this->executePreConditions(); + + if ($this->preconditionFailure != null) { + //if our preconditions fail, we need to mark all the tests as incomplete. + $e->getTest()->getMetadata()->setIncomplete("SUITE PRECONDITION FAILED:" . PHP_EOL . $this->preconditionFailure); + } + } + + + private function executePreConditions() + { + if ($this->currentTestRun == 1) { + print sprintf(self::$HOOK_EXECUTION_INIT, "before"); + + try { + $webDriver = $this->getModule('\Magento\FunctionalTestingFramework\Module\MagentoWebDriver'); + + // close any open sessions + if ($webDriver->webDriver != null) { + $webDriver->webDriver->close(); + $webDriver->webDriver = null; + } + + // initialize the webdriver session + $webDriver->_initializeSession(); + print("Comment in Before"); + $webDriver->amOnPage("some.url"); // stepKey: before + $createFields['someKey'] = "dataHere"; + PersistedObjectHandler::getInstance()->createEntity( + "create", + "suite", + "createThis", + $createFields + ); + print("<click stepKey=\"comment with element\" userInput=\"helloworld\"/>"); + $webDriver->click(PersistedObjectHandler::getInstance()->retrieveEntityField('create', 'data', 'suite')); // stepKey: clickWithData + print("Entering Action Group [AC] actionGroupWithTwoArguments"); + $webDriver->see("John", msq("uniqueData") . "John"); // stepKey: seeFirstNameAC + print("Exiting Action Group [AC] actionGroupWithTwoArguments"); + + // reset configuration and close session + $this->getModule('\Magento\FunctionalTestingFramework\Module\MagentoWebDriver')->_resetConfig(); + $webDriver->webDriver->close(); + $webDriver->webDriver = null; + + } catch (\Exception $exception) { + $this->preconditionFailure = $exception->getMessage(); + } + + print sprintf(self::$HOOK_EXECUTION_END, "before"); + } + } + + public function _after(\Codeception\Event\TestEvent $e) + { + $this->executePostConditions($e); + } + + + private function executePostConditions(\Codeception\Event\TestEvent $e) + { + if ($this->currentTestRun == $this->testCount) { + print sprintf(self::$HOOK_EXECUTION_INIT, "after"); + + try { + // Find out if Test in Suite failed, will cause potential failures in suite after + $cest = $e->getTest(); + + //Access private TestResultObject to find stack and if there are any errors (as opposed to failures) + $testResultObject = call_user_func(\Closure::bind( + function () use ($cest) { + return $cest->getTestResultObject(); + }, + $cest + )); + $errors = $testResultObject->errors(); + + if (!empty($errors)) { + foreach ($errors as $error) { + if ($error->failedTest()->getTestMethod() == $cest->getName()) { + // Do not attempt to run _after if failure was in the _after block + // Try to run _after but catch exceptions to prevent them from overwriting original failure. + print("LAST TEST IN SUITE FAILED, TEST AFTER MAY NOT BE SUCCESSFUL\n"); + } + } + } + $webDriver = $this->getModule('\Magento\FunctionalTestingFramework\Module\MagentoWebDriver'); + + // close any open sessions + if ($webDriver->webDriver != null) { + $webDriver->webDriver->close(); + $webDriver->webDriver = null; + } + + // initialize the webdriver session + $webDriver->_initializeSession(); + print("afterBlock"); + } catch (\Exception $exception) { + print $exception->getMessage(); + } + + PersistedObjectHandler::getInstance()->clearSuiteObjects(); + print sprintf(self::$HOOK_EXECUTION_END, "after"); + } + } +} diff --git a/dev/tests/verification/Tests/SuiteGenerationTest.php b/dev/tests/verification/Tests/SuiteGenerationTest.php index f305e565f..d2242fb52 100644 --- a/dev/tests/verification/Tests/SuiteGenerationTest.php +++ b/dev/tests/verification/Tests/SuiteGenerationTest.php @@ -327,6 +327,65 @@ public function testSuiteGenerationWithExtends() } } + /** + * Test comments generated during suite generation + */ + public function testSuiteCommentsGeneration() + { + $groupName = 'functionalSuiteWithComments'; + + $expectedContents = [ + 'IncludeTestCest.php' + ]; + + // Generate the Suite + SuiteGenerator::getInstance()->generateSuite($groupName); + + // Validate log message and add group name for later deletion + TestLoggingUtil::getInstance()->validateMockLogStatement( + 'info', + "suite generated", + ['suite' => $groupName, 'relative_path' => "_generated" . DIRECTORY_SEPARATOR . $groupName] + ); + self::$TEST_GROUPS[] = $groupName; + + // Validate Yaml file updated + $yml = Yaml::parse(file_get_contents(self::CONFIG_YML_FILE)); + $this->assertArrayHasKey($groupName, $yml['groups']); + + $suiteResultBaseDir = self::GENERATE_RESULT_DIR . + DIRECTORY_SEPARATOR . + $groupName . + DIRECTORY_SEPARATOR; + + // Validate tests have been generated + $dirContents = array_diff(scandir($suiteResultBaseDir), ['..', '.']); + + foreach ($expectedContents as $expectedFile) { + $this->assertTrue(in_array($expectedFile, $dirContents)); + } + + //assert group file created and contains correct contents + $groupFile = PROJECT_ROOT . + DIRECTORY_SEPARATOR . + "src" . + DIRECTORY_SEPARATOR . + "Magento" . + DIRECTORY_SEPARATOR . + "FunctionalTestingFramework" . + DIRECTORY_SEPARATOR . + "Group" . + DIRECTORY_SEPARATOR . + $groupName . + ".php"; + + $this->assertTrue(file_exists($groupFile)); + $this->assertFileEquals( + self::RESOURCES_PATH . DIRECTORY_SEPARATOR . $groupName . ".txt", + $groupFile + ); + } + /** * revert any changes made to config.yml * remove _generated directory diff --git a/dev/tests/verification/_suite/functionalSuite.xml b/dev/tests/verification/_suite/functionalSuite.xml index 439445c24..cfdaa3557 100644 --- a/dev/tests/verification/_suite/functionalSuite.xml +++ b/dev/tests/verification/_suite/functionalSuite.xml @@ -29,4 +29,28 @@ <test name="ExcludeTest2"/> </exclude> </suite> + <suite name="functionalSuiteWithComments"> + <include> + <!-- Comment Block--> + <test name="IncludeTest"/> + </include> + <before> + <!-- Comment in Before--> + <amOnPage url="some.url" stepKey="before"/> + <createData entity="createThis" stepKey="create"> + <!--Comment in Nested Element--> + <field key="someKey">dataHere</field> + </createData> + <!-- <click stepKey="comment with element" userInput="helloworld"/> --> + <click stepKey="clickWithData" userInput="$create.data$"/> + <actionGroup ref="actionGroupWithTwoArguments" stepKey="AC"> + <!--Comment in AG Args--> + <argument name="somePerson" value="simpleData"/> + <argument name="anotherPerson" value="uniqueData"/> + </actionGroup> + </before> + <after> + <comment userInput="afterBlock" stepKey="afterBlock"/> + </after> + </suite> </suites> diff --git a/src/Magento/FunctionalTestingFramework/Suite/Generators/GroupClassGenerator.php b/src/Magento/FunctionalTestingFramework/Suite/Generators/GroupClassGenerator.php index a84f6b1b3..415d884b6 100644 --- a/src/Magento/FunctionalTestingFramework/Suite/Generators/GroupClassGenerator.php +++ b/src/Magento/FunctionalTestingFramework/Suite/Generators/GroupClassGenerator.php @@ -172,10 +172,11 @@ private function buildHookMustacheArray($hookObj) private function buildWebDriverActionsMustacheArray($action, $actionEntries) { $step = TestGenerator::getInstance()->generateStepsPhp([$action], TestGenerator::SUITE_SCOPE, 'webDriver'); - $rawPhp = str_replace(["\t", "\n"], "", $step); - $multipleCommands = explode(";", $rawPhp, -1); + $rawPhp = str_replace(["\t"], "", $step); + $multipleCommands = explode(PHP_EOL, $rawPhp, -1); + $multipleCommands = array_filter($multipleCommands); foreach ($multipleCommands as $command) { - $actionEntries = $this->replaceReservedTesterFunctions($command . ";", $actionEntries, 'webDriver'); + $actionEntries = $this->replaceReservedTesterFunctions($command . PHP_EOL, $actionEntries, 'webDriver'); } return $actionEntries; @@ -192,6 +193,7 @@ private function buildWebDriverActionsMustacheArray($action, $actionEntries) */ private function replaceReservedTesterFunctions($formattedStep, $actionEntries, $actor) { + $formattedStep = rtrim($formattedStep); foreach (self::REPLACEMENT_ACTIONS as $testAction => $replacement) { $testActionCall = "\${$actor}->{$testAction}"; if (substr($formattedStep, 0, strlen($testActionCall)) == $testActionCall) { diff --git a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php index bd4e2d3be..9e878277e 100644 --- a/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php +++ b/src/Magento/FunctionalTestingFramework/Util/TestGenerator.php @@ -48,7 +48,8 @@ class TestGenerator 'updateData', 'getData', 'magentoCLI', - 'generateDate' + 'generateDate', + 'field' ]; const STEP_KEY_ANNOTATION = " // stepKey: %s"; From b7d28307c529f2c2d673b37be87805319551366a Mon Sep 17 00:00:00 2001 From: Donald Booth <dobooth@donalds-mbp.corp.adobe.com> Date: Tue, 11 Jun 2019 13:21:29 -0500 Subject: [PATCH 22/29] Updated Selenium version number. --- docs/getting-started.md | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/docs/getting-started.md b/docs/getting-started.md index 727dc3b18..2d3a6b8d9 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -13,7 +13,7 @@ Make sure that you have the following software installed and configured on your - [PHP version supported by the Magento instance under test][php] - [Composer 1.3 or later][composer] - [Java 1.8 or later][java] -- [Selenium Server Standalone 3.6 or later][selenium server] and [ChromeDriver 2.33 or later][chrome driver] or other webdriver in the same directory +- [Selenium Server Standalone 3.1 or later][selenium server] and [ChromeDriver 2.33 or later][chrome driver] or other webdriver in the same directory <div class="bs-callout bs-callout-tip" markdown="1"> [PhpStorm] supports [Codeception test execution][], which is helpful when debugging. @@ -63,7 +63,7 @@ A Selenium web driver cannot enter data to fields with WYSIWYG. To disable the WYSIWYG and enable the web driver to process these fields as simple text areas: 1. Log in to the Magento Admin as an administrator. -2. Navigate to **Stores \> Configuration \> General \> Content Management**. +2. Navigate to **Stores** > Settings > **Configuration** > **General** > **Content Management**. 3. In the WYSIWYG Options section set the **Enable WYSIWYG Editor** option to **Disabled Completely**. 4. Click **Save Config**. @@ -75,16 +75,16 @@ When you want to test the WYSIWYG functionality, re-enable WYSIWYG in your test To enable the **Admin Account Sharing** setting, to avoid unpredictable logout during a testing session, and disable the **Add Secret Key in URLs** setting, to open pages using direct URLs: -1. Navigate to **Stores \> Configuration \> Advanced \> Admin \> Security**. +1. Navigate to **Stores** > Settings > **Configuration** > **Advanced** > **Admin** > **Security**. 2. Set **Admin Account Sharing** to **Yes**. 3. Set **Add Secret Key to URLs** to **No**. 4. Click **Save Config**. ### Nginx settings {#nginx-settings} -If Nginx Web server is used on your development environment then **Use Web Server Rewrites** setting in **Stores \> Configuration \> Web \> Search Engine Optimization** must be set to **Yes**. +If Nginx Web server is used on your development environment then **Use Web Server Rewrites** setting in **Stores** > Settings > **Configuration** > **Web** > **Search Engine Optimization** must be set to **Yes**. -To be able to run Magento command line commands in tests add the following location block to Nginx configuration file: +To be able to run Magento command line commands in tests add the following location block to Nginx configuration file: ```conf location ~* ^/dev/tests/acceptance/utils($|/) { @@ -97,6 +97,7 @@ location ~* ^/dev/tests/acceptance/utils($|/) { } } ``` + ## Set up an embedded MFTF {#setup-framework} This is a default setup that you would need to start using the MFTF to cover your Magento project with functional testing. @@ -129,7 +130,7 @@ If the file does not exist, add the `--force` option to create it: vendor/bin/mftf generate:urn-catalog --force .idea/ ``` -See [`generate:urn-catalog`][] for more details.' +See [`generate:urn-catalog`][] for more details. <div class="bs-callout bs-callout-tip" markdown="1"> You can simplify command entry by adding the absolute path to the `vendor/bin` directory path to your PATH environment variable. @@ -176,7 +177,7 @@ cp dev/tests/acceptance/.htaccess.sample dev/tests/acceptance/.htaccess To run tests, you need a running Selenium server and [`mftf`][] commands. -#### Run the Selenium server {#selenium-server} +#### Run the Selenium server {#selenium-server} Run the Selenium server in terminal. For example, the following commands run the Selenium server for Google Chrome: @@ -215,7 +216,7 @@ vendor/bin/mftf run:test AdminLoginTest --remove See more commands in [`mftf`][]. -### Step 5. Generate reports {#reports} +### Step 5. Generate reports {#reports} During testing, the MFTF generates test reports in CLI. You can generate visual representations of the report data using [Allure Framework][]. From 4c0c7df95228cf0e92f524fe2200eef5f1871665 Mon Sep 17 00:00:00 2001 From: Donald Booth <dobooth@adobe.com> Date: Tue, 11 Jun 2019 14:55:40 -0500 Subject: [PATCH 23/29] Fixed spelling error. --- .../FunctionalTestingFramework/Console/BuildProjectCommand.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Magento/FunctionalTestingFramework/Console/BuildProjectCommand.php b/src/Magento/FunctionalTestingFramework/Console/BuildProjectCommand.php index 9fa28dcc5..6b421a332 100644 --- a/src/Magento/FunctionalTestingFramework/Console/BuildProjectCommand.php +++ b/src/Magento/FunctionalTestingFramework/Console/BuildProjectCommand.php @@ -49,7 +49,7 @@ protected function configure() "upgrade", 'u', InputOption::VALUE_NONE, - 'upgrade existing MFTF tests according to last major release requiements' + 'upgrade existing MFTF tests according to last major release requirements' ); $this->envProcessor = new EnvProcessor(TESTS_BP . DIRECTORY_SEPARATOR . '.env'); $env = $this->envProcessor->getEnv(); From e397e0f1473b8543d49a43de2d505154e997f5df Mon Sep 17 00:00:00 2001 From: John S <john00ivy@gmail.com> Date: Wed, 12 Jun 2019 08:51:06 -0500 Subject: [PATCH 24/29] MQE-1427: Support _CREDS in <magentoCLI> action and in Data - Removing "updateData", does NOT contain a <field>. --- dev/tests/unit/Resources/alteredDocumentation.txt | 1 + dev/tests/unit/Resources/basicDocumentation.txt | 1 + 2 files changed, 2 insertions(+) diff --git a/dev/tests/unit/Resources/alteredDocumentation.txt b/dev/tests/unit/Resources/alteredDocumentation.txt index 0684134f5..d69a38775 100644 --- a/dev/tests/unit/Resources/alteredDocumentation.txt +++ b/dev/tests/unit/Resources/alteredDocumentation.txt @@ -1,6 +1,7 @@ #Action Group Information This documentation contains a list of all Action Groups. + ###testActionGroupObject **Description**: - alteredDescription diff --git a/dev/tests/unit/Resources/basicDocumentation.txt b/dev/tests/unit/Resources/basicDocumentation.txt index 3bc16cbac..22e4b2a89 100644 --- a/dev/tests/unit/Resources/basicDocumentation.txt +++ b/dev/tests/unit/Resources/basicDocumentation.txt @@ -1,6 +1,7 @@ #Action Group Information This documentation contains a list of all Action Groups. + ###testActionGroupObject **Description**: - someDescription From b90e9e2627220470a7d4d0b220c427d52d146f75 Mon Sep 17 00:00:00 2001 From: John S <john00ivy@gmail.com> Date: Wed, 12 Jun 2019 08:51:06 -0500 Subject: [PATCH 25/29] MQE-1580: Remove the "page" attribute from the Action Group annotations node. - Correct unit test text. --- dev/tests/unit/Resources/alteredDocumentation.txt | 1 + dev/tests/unit/Resources/basicDocumentation.txt | 1 + 2 files changed, 2 insertions(+) diff --git a/dev/tests/unit/Resources/alteredDocumentation.txt b/dev/tests/unit/Resources/alteredDocumentation.txt index 0684134f5..d69a38775 100644 --- a/dev/tests/unit/Resources/alteredDocumentation.txt +++ b/dev/tests/unit/Resources/alteredDocumentation.txt @@ -1,6 +1,7 @@ #Action Group Information This documentation contains a list of all Action Groups. + ###testActionGroupObject **Description**: - alteredDescription diff --git a/dev/tests/unit/Resources/basicDocumentation.txt b/dev/tests/unit/Resources/basicDocumentation.txt index 3bc16cbac..22e4b2a89 100644 --- a/dev/tests/unit/Resources/basicDocumentation.txt +++ b/dev/tests/unit/Resources/basicDocumentation.txt @@ -1,6 +1,7 @@ #Action Group Information This documentation contains a list of all Action Groups. + ###testActionGroupObject **Description**: - someDescription From fcecdd4f60595567d9c38ad58b45b47c57759412 Mon Sep 17 00:00:00 2001 From: John S <john00ivy@gmail.com> Date: Wed, 12 Jun 2019 09:21:45 -0500 Subject: [PATCH 26/29] MQE-1580: Remove the "page" attribute from the Action Group annotations node. - Fixed the Unit Test finally. --- dev/tests/unit/Resources/alteredDocumentation.txt | 2 +- dev/tests/unit/Resources/basicDocumentation.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dev/tests/unit/Resources/alteredDocumentation.txt b/dev/tests/unit/Resources/alteredDocumentation.txt index d69a38775..228683db4 100644 --- a/dev/tests/unit/Resources/alteredDocumentation.txt +++ b/dev/tests/unit/Resources/alteredDocumentation.txt @@ -1,7 +1,7 @@ #Action Group Information This documentation contains a list of all Action Groups. - +--- ###testActionGroupObject **Description**: - alteredDescription diff --git a/dev/tests/unit/Resources/basicDocumentation.txt b/dev/tests/unit/Resources/basicDocumentation.txt index 22e4b2a89..cdc67a491 100644 --- a/dev/tests/unit/Resources/basicDocumentation.txt +++ b/dev/tests/unit/Resources/basicDocumentation.txt @@ -1,7 +1,7 @@ #Action Group Information This documentation contains a list of all Action Groups. - +--- ###testActionGroupObject **Description**: - someDescription From daf51e091a496c299706fee6404592504b7c4051 Mon Sep 17 00:00:00 2001 From: Alex Kolesnyk <kolesnyk@adobe.com> Date: Wed, 12 Jun 2019 16:46:49 -0500 Subject: [PATCH 27/29] MQE-1234: Allow XML Parser to read XML comment into comment action - do not humanize comment actions --- .../Allure/Adapter/MagentoAllureAdapter.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Magento/FunctionalTestingFramework/Allure/Adapter/MagentoAllureAdapter.php b/src/Magento/FunctionalTestingFramework/Allure/Adapter/MagentoAllureAdapter.php index 81a6fe3ba..68dbe09ae 100644 --- a/src/Magento/FunctionalTestingFramework/Allure/Adapter/MagentoAllureAdapter.php +++ b/src/Magento/FunctionalTestingFramework/Allure/Adapter/MagentoAllureAdapter.php @@ -132,7 +132,9 @@ public function stepBefore(StepEvent $stepEvent) } // 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) { + if (strpos($stepEvent->getStep()->getAction(), ActionGroupObject::ACTION_GROUP_CONTEXT_START) !== false + || $stepEvent->getStep() instanceof Comment + ) { $stepAction = $stepEvent->getStep()->getAction(); } else { $stepAction = $stepEvent->getStep()->getHumanizedActionWithoutArguments(); From 94d0c15deb6c4922a82fbe202a54186e66c27a9f Mon Sep 17 00:00:00 2001 From: Soumya Unnikrishnan <sunnikri@adobe.com> Date: Mon, 24 Jun 2019 13:09:18 -0500 Subject: [PATCH 28/29] MQE-1597: MFTF 2.4.0 and above has incompatible dependencies with msp/twofactorauth updated composer.json and .lock to fix packaging issues --- composer.json | 4 +- composer.lock | 175 ++++++++++---------------------------------------- 2 files changed, 37 insertions(+), 142 deletions(-) diff --git a/composer.json b/composer.json index d226371ea..126fa3101 100755 --- a/composer.json +++ b/composer.json @@ -14,7 +14,6 @@ "ext-curl": "*", "codeception/codeception": "~2.3.4 || ~2.4.0 ", "consolidation/robo": "^1.0.0", - "epfremme/swagger-php": "^2.0", "flow/jsonpath": ">0.2", "fzaninotto/faker": "^1.6", "monolog/monolog": "^1.0", @@ -36,6 +35,9 @@ "php-coveralls/php-coveralls": "^1.0", "symfony/stopwatch": "~3.4.6" }, + "suggest": { + "epfremme/swagger-php": "^2.0" + }, "autoload": { "files": ["src/Magento/FunctionalTestingFramework/_bootstrap.php"], "psr-4": { diff --git a/composer.lock b/composer.lock index c858ceff4..7cb40776e 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": "6b2b6a074f053fe28df2633e8bce095f", + "content-hash": "1937995160ceef8d4506d847291206f3", "packages": [ { "name": "allure-framework/allure-codeception", @@ -795,73 +795,6 @@ ], "time": "2017-02-24T16:22:25+00:00" }, - { - "name": "doctrine/collections", - "version": "v1.4.0", - "source": { - "type": "git", - "url": "https://github.com/doctrine/collections.git", - "reference": "1a4fb7e902202c33cce8c55989b945612943c2ba" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/collections/zipball/1a4fb7e902202c33cce8c55989b945612943c2ba", - "reference": "1a4fb7e902202c33cce8c55989b945612943c2ba", - "shasum": "" - }, - "require": { - "php": "^5.6 || ^7.0" - }, - "require-dev": { - "doctrine/coding-standard": "~0.1@dev", - "phpunit/phpunit": "^5.7" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.3.x-dev" - } - }, - "autoload": { - "psr-0": { - "Doctrine\\Common\\Collections\\": "lib/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" - }, - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com" - }, - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" - } - ], - "description": "Collections Abstraction library", - "homepage": "http://www.doctrine-project.org", - "keywords": [ - "array", - "collections", - "iterator" - ], - "time": "2017-01-03T10:49:41+00:00" - }, { "name": "doctrine/instantiator", "version": "1.0.5", @@ -918,21 +851,24 @@ }, { "name": "doctrine/lexer", - "version": "v1.0.1", + "version": "1.0.2", "source": { "type": "git", "url": "https://github.com/doctrine/lexer.git", - "reference": "83893c552fd2045dd78aef794c31e694c37c0b8c" + "reference": "1febd6c3ef84253d7c815bed85fc622ad207a9f8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/lexer/zipball/83893c552fd2045dd78aef794c31e694c37c0b8c", - "reference": "83893c552fd2045dd78aef794c31e694c37c0b8c", + "url": "https://api.github.com/repos/doctrine/lexer/zipball/1febd6c3ef84253d7c815bed85fc622ad207a9f8", + "reference": "1febd6c3ef84253d7c815bed85fc622ad207a9f8", "shasum": "" }, "require": { "php": ">=5.3.2" }, + "require-dev": { + "phpunit/phpunit": "^4.5" + }, "type": "library", "extra": { "branch-alias": { @@ -940,8 +876,8 @@ } }, "autoload": { - "psr-0": { - "Doctrine\\Common\\Lexer\\": "lib/" + "psr-4": { + "Doctrine\\Common\\Lexer\\": "lib/Doctrine/Common/Lexer" } }, "notification-url": "https://packagist.org/downloads/", @@ -962,59 +898,16 @@ "email": "schmittjoh@gmail.com" } ], - "description": "Base library for a lexer that can be used in Top-Down, Recursive Descent Parsers.", - "homepage": "http://www.doctrine-project.org", + "description": "PHP Doctrine Lexer parser library that can be used in Top-Down, Recursive Descent Parsers.", + "homepage": "https://www.doctrine-project.org/projects/lexer.html", "keywords": [ + "annotations", + "docblock", "lexer", - "parser" - ], - "time": "2014-09-09T13:34:57+00:00" - }, - { - "name": "epfremme/swagger-php", - "version": "v2.0.0", - "source": { - "type": "git", - "url": "https://github.com/epfremmer/swagger-php.git", - "reference": "eee28a442b7e6220391ec953d3c9b936354f23bc" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/epfremmer/swagger-php/zipball/eee28a442b7e6220391ec953d3c9b936354f23bc", - "reference": "eee28a442b7e6220391ec953d3c9b936354f23bc", - "shasum": "" - }, - "require": { - "doctrine/annotations": "^1.2", - "doctrine/collections": "^1.3", - "jms/serializer": "^1.1", - "php": ">=5.5", - "phpoption/phpoption": "^1.1", - "symfony/yaml": "^2.7|^3.1" - }, - "require-dev": { - "mockery/mockery": "^0.9.4", - "phpunit/phpunit": "~4.8|~5.0", - "satooshi/php-coveralls": "^1.0" - }, - "type": "package", - "autoload": { - "psr-4": { - "Epfremme\\Swagger\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Edward Pfremmer", - "email": "epfremme@nerdery.com" - } + "parser", + "php" ], - "description": "Library for parsing swagger documentation into PHP entities for use in testing and code generation", - "time": "2016-09-26T17:24:17+00:00" + "time": "2019-06-08T11:03:04+00:00" }, { "name": "facebook/webdriver", @@ -1568,16 +1461,16 @@ }, { "name": "jms/serializer", - "version": "1.13.0", + "version": "1.14.0", "source": { "type": "git", "url": "https://github.com/schmittjoh/serializer.git", - "reference": "00863e1d55b411cc33ad3e1de09a4c8d3aae793c" + "reference": "ee96d57024af9a7716d56fcbe3aa94b3d030f3ca" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/schmittjoh/serializer/zipball/00863e1d55b411cc33ad3e1de09a4c8d3aae793c", - "reference": "00863e1d55b411cc33ad3e1de09a4c8d3aae793c", + "url": "https://api.github.com/repos/schmittjoh/serializer/zipball/ee96d57024af9a7716d56fcbe3aa94b3d030f3ca", + "reference": "ee96d57024af9a7716d56fcbe3aa94b3d030f3ca", "shasum": "" }, "require": { @@ -1617,7 +1510,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-1.x": "1.13-dev" + "dev-1.x": "1.14-dev" } }, "autoload": { @@ -1648,7 +1541,7 @@ "serialization", "xml" ], - "time": "2018-07-25T13:58:54+00:00" + "time": "2019-04-17T08:12:16+00:00" }, { "name": "league/container", @@ -4083,16 +3976,16 @@ }, { "name": "symfony/polyfill-ctype", - "version": "v1.10.0", + "version": "v1.11.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "e3d826245268269cd66f8326bd8bc066687b4a19" + "reference": "82ebae02209c21113908c229e9883c419720738a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/e3d826245268269cd66f8326bd8bc066687b4a19", - "reference": "e3d826245268269cd66f8326bd8bc066687b4a19", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/82ebae02209c21113908c229e9883c419720738a", + "reference": "82ebae02209c21113908c229e9883c419720738a", "shasum": "" }, "require": { @@ -4104,7 +3997,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.9-dev" + "dev-master": "1.11-dev" } }, "autoload": { @@ -4137,7 +4030,7 @@ "polyfill", "portable" ], - "time": "2018-08-06T14:22:27+00:00" + "time": "2019-02-06T07:57:58+00:00" }, { "name": "symfony/polyfill-mbstring", @@ -4308,16 +4201,16 @@ }, { "name": "symfony/yaml", - "version": "v3.4.18", + "version": "v3.4.28", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "640b6c27fed4066d64b64d5903a86043f4a4de7f" + "reference": "212a27b731e5bfb735679d1ffaac82bd6a1dc996" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/640b6c27fed4066d64b64d5903a86043f4a4de7f", - "reference": "640b6c27fed4066d64b64d5903a86043f4a4de7f", + "url": "https://api.github.com/repos/symfony/yaml/zipball/212a27b731e5bfb735679d1ffaac82bd6a1dc996", + "reference": "212a27b731e5bfb735679d1ffaac82bd6a1dc996", "shasum": "" }, "require": { @@ -4363,7 +4256,7 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2018-10-02T16:33:53+00:00" + "time": "2019-03-25T07:48:46+00:00" }, { "name": "theseer/tokenizer", From 7818b9cc7ea4f4111714bfdadc4dbeaa9497486b Mon Sep 17 00:00:00 2001 From: Kevin Kozan <kkozan@magento.com> Date: Thu, 27 Jun 2019 13:35:43 -0500 Subject: [PATCH 29/29] MQE-1613: Add release to CHANGELOG.MD - Changelog updated - composer version bumped --- CHANGELOG.md | 9 +++++++++ bin/mftf | 2 +- composer.json | 2 +- composer.lock | 2 +- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ee0d665e5..72b6f857d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,15 @@ Magento Functional Testing Framework Changelog ================================================ +2.4.2 +----- +* Traceability + * Test action `stepKey`s are now included in both console output and Allure report. + * XML Comments are now automatically converted into a `<comment>` action. + +### Fixes +* Moved `epfremme/swagger-php` dependency to `suggests` block due to a conflict with Magento extensions. + 2.4.1 ----- * Traceability diff --git a/bin/mftf b/bin/mftf index 207dab6ff..b026f33c1 100755 --- a/bin/mftf +++ b/bin/mftf @@ -29,7 +29,7 @@ try { try { $application = new Symfony\Component\Console\Application(); $application->setName('Magento Functional Testing Framework CLI'); - $application->setVersion('2.4.1'); + $application->setVersion('2.4.2'); /** @var \Magento\FunctionalTestingFramework\Console\CommandListInterface $commandList */ $commandList = new \Magento\FunctionalTestingFramework\Console\CommandList; foreach ($commandList->getCommands() as $command) { diff --git a/composer.json b/composer.json index 126fa3101..8af401526 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": "2.4.1", + "version": "2.4.2", "license": "AGPL-3.0", "keywords": ["magento", "automation", "functional", "testing"], "config": { diff --git a/composer.lock b/composer.lock index 7cb40776e..ca4e287fc 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": "1937995160ceef8d4506d847291206f3", + "content-hash": "d5879be29cb6bbe70ce7e4a42828303a", "packages": [ { "name": "allure-framework/allure-codeception",