Skip to content

MQE-1580 - [DOCUMENTATION] Remove the "page" attribute from the Action Group annotations node. #360

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 16 commits into from
Jun 13, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
6363af9
MQE-1580: Remove the "page" attribute from the Action Group annotatio…
ivy00johns May 31, 2019
6a528c5
MQE-1580: Remove the "page" attribute from the Action Group annotatio…
ivy00johns Jun 3, 2019
9bdfa62
MQE-1580: Remove the "page" attribute from the Action Group annotatio…
ivy00johns Jun 4, 2019
d3556ac
MQE-1580: Remove the "page" attribute from the Action Group annotatio…
ivy00johns Jun 5, 2019
0d0f789
MQE-1580: Remove the "page" attribute from the Action Group annotatio…
ivy00johns Jun 5, 2019
ff12364
MQE-1580: Remove the "page" attribute from the Action Group annotatio…
ivy00johns Jun 6, 2019
29e2477
MQE-1580: Remove the "page" attribute from the Action Group annotatio…
ivy00johns Jun 6, 2019
ccb68aa
Merge branch 'develop' into MQE-1580
ivy00johns Jun 10, 2019
11ad7df
MQE-1580: Remove the "page" attribute from the Action Group annotatio…
ivy00johns Jun 10, 2019
96210c9
MQE-1580: Remove the "page" attribute from the Action Group annotatio…
ivy00johns Jun 10, 2019
aa45620
MQE-1580: Remove the "page" attribute from the Action Group annotatio…
ivy00johns Jun 10, 2019
4dadaf7
MQE-1580: Remove the "page" attribute from the Action Group annotatio…
ivy00johns Jun 10, 2019
e397e0f
MQE-1427: Support _CREDS in <magentoCLI> action and in Data
ivy00johns Jun 12, 2019
b90e9e2
MQE-1580: Remove the "page" attribute from the Action Group annotatio…
ivy00johns Jun 12, 2019
f5f2e68
Merge remote-tracking branch 'origin/MQE-1580' into MQE-1580
ivy00johns Jun 12, 2019
fcecdd4
MQE-1580: Remove the "page" attribute from the Action Group annotatio…
ivy00johns Jun 12, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,13 @@ public function testActionGroupExtractAnnotations()
"description" => [
"nodeName" => "description",
"value" => "someDescription"
],
"page" => [
"nodeName" => "page",
"value" => "somePage"
]
];
// Perform Test
$extractor = new ActionGroupAnnotationExtractor();
$returnedAnnotations = $extractor->extractAnnotations($actionGroupAnnotations, "fileName");

// Asserts

$this->assertEquals("somePage", $returnedAnnotations['page']);
$this->assertEquals("someDescription", $returnedAnnotations['description']);
}

Expand All @@ -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();
Expand All @@ -70,7 +64,7 @@ public function testActionGroupMissingAnnotations()
'DEPRECATION: Action Group File fileName is missing required annotations.',
[
'actionGroup' => 'fileName',
'missingAnnotations' => "description, page"
'missingAnnotations' => "description"
]
);
}
Expand All @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ class DocGeneratorTest extends MagentoTestCase
public function testBasicCreateDocumentation()
{
$annotations = [
"page" => "somePage",
"description" => "someDescription"
];
$actionGroupUnderTest = (new ActionGroupObjectBuilder())
Expand Down Expand Up @@ -55,7 +54,6 @@ public function testBasicCreateDocumentation()
public function testCreateDocumentationWithOverwrite()
{
$annotations = [
"page" => "somePage",
"description" => "someDescription"
];
$actionGroupUnderTest = (new ActionGroupObjectBuilder())
Expand All @@ -70,7 +68,6 @@ public function testCreateDocumentationWithOverwrite()
);

$annotations = [
"page" => "alteredPage",
"description" => "alteredDescription"
];
$actionGroupUnderTest = (new ActionGroupObjectBuilder())
Expand Down Expand Up @@ -102,7 +99,6 @@ public function testCreateDocumentationWithOverwrite()
public function testCreateDocumentationNotCleanException()
{
$annotations = [
"page" => "somePage",
"description" => "someDescription"
];
$actionGroupUnderTest = (new ActionGroupObjectBuilder())
Expand Down
12 changes: 4 additions & 8 deletions dev/tests/unit/Resources/alteredDocumentation.txt
Original file line number Diff line number Diff line change
@@ -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)
---
<a name="alteredPage"></a>
##alteredPage

###testActionGroupObject
alteredDescription
**Description**:
- alteredDescription

Located in:
**Located In**:

- filename
***
12 changes: 4 additions & 8 deletions dev/tests/unit/Resources/basicDocumentation.txt
Original file line number Diff line number Diff line change
@@ -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)
---
<a name="somePage"></a>
##somePage

###testActionGroupObject
someDescription
**Description**:
- someDescription

Located in:
**Located In**:

- filename
***
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
class ActionGroupAnnotationExtractor extends AnnotationExtractor
{
const ACTION_GROUP_REQUIRED_ANNOTATIONS = [
"description",
"page",
"description"
];
const GENERATE_DOCS_COMMAND = 'generate:docs';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
<xs:complexType>
<xs:sequence>
<xs:element name="description"/>
<xs:element name="page"/>
</xs:sequence>
</xs:complexType>
</xs:element>
Expand Down
21 changes: 8 additions & 13 deletions src/Magento/FunctionalTestingFramework/Util/DocGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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]]
Expand All @@ -103,34 +104,28 @@ 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 .= "<a name=\"$group\"></a>" . 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();
$markdown .= "| $argumentName | $argumentType |" . PHP_EOL;
}
$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";
Expand Down