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..228683db4 100644 --- a/dev/tests/unit/Resources/alteredDocumentation.txt +++ b/dev/tests/unit/Resources/alteredDocumentation.txt @@ -1,16 +1,12 @@ #Action Group Information -This documentation contains a list of all action groups on the pages on which they start +This documentation contains a list of all Action Groups. -##List of Pages -- [ alteredPage ](#alteredPage) --- - -##alteredPage - ###testActionGroupObject -alteredDescription +**Description**: +- alteredDescription -Located in: +**Located In**: - filename *** diff --git a/dev/tests/unit/Resources/basicDocumentation.txt b/dev/tests/unit/Resources/basicDocumentation.txt index 26a7fe719..cdc67a491 100644 --- a/dev/tests/unit/Resources/basicDocumentation.txt +++ b/dev/tests/unit/Resources/basicDocumentation.txt @@ -1,16 +1,12 @@ #Action Group Information -This documentation contains a list of all action groups on the pages on which they start +This documentation contains a list of all Action Groups. -##List of Pages -- [ somePage ](#somePage) --- - -##somePage - ###testActionGroupObject -someDescription +**Description**: +- someDescription -Located in: +**Located In**: - filename *** 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'; 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 @@ - 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";