Skip to content

Commit c5c9ab8

Browse files
authored
Merge branch 'develop' into MQE-1510
2 parents b325d3a + 46d0de1 commit c5c9ab8

File tree

9 files changed

+23
-48
lines changed

9 files changed

+23
-48
lines changed

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ Magento Functional Testing Framework Changelog
44
2.4.1
55
-----
66
* Traceability
7-
* XSD Schema validation is now enabled by default in `generate:tests`
8-
* `generate:tests --debug` option has been updated to include different debug levels
7+
* XSD Schema validation is now enabled by default in `generate:tests`, `run:test`, `run:failed`, `run:group`
8+
* `--debug` option for the above commands has been updated to include different debug levels
99
* See DevDocs for details
1010

1111
### Fixes

dev/tests/unit/Magento/FunctionalTestFramework/Test/Util/ActionGroupAnnotationExtractorTest.php

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,19 +34,13 @@ public function testActionGroupExtractAnnotations()
3434
"description" => [
3535
"nodeName" => "description",
3636
"value" => "someDescription"
37-
],
38-
"page" => [
39-
"nodeName" => "page",
40-
"value" => "somePage"
4137
]
4238
];
4339
// Perform Test
4440
$extractor = new ActionGroupAnnotationExtractor();
4541
$returnedAnnotations = $extractor->extractAnnotations($actionGroupAnnotations, "fileName");
4642

4743
// Asserts
48-
49-
$this->assertEquals("somePage", $returnedAnnotations['page']);
5044
$this->assertEquals("someDescription", $returnedAnnotations['description']);
5145
}
5246

@@ -57,7 +51,7 @@ public function testActionGroupExtractAnnotations()
5751
*/
5852
public function testActionGroupMissingAnnotations()
5953
{
60-
// Action Group Data, missing page and description
54+
// Action Group Data, missing description
6155
$testAnnotations = [];
6256
// Perform Test
6357
$extractor = new ActionGroupAnnotationExtractor();
@@ -70,7 +64,7 @@ public function testActionGroupMissingAnnotations()
7064
'DEPRECATION: Action Group File fileName is missing required annotations.',
7165
[
7266
'actionGroup' => 'fileName',
73-
'missingAnnotations' => "description, page"
67+
'missingAnnotations' => "description"
7468
]
7569
);
7670
}
@@ -83,7 +77,7 @@ public function testActionGroupMissingAnnotations()
8377
*/
8478
public function testActionGroupMissingAnnotationsNoWarning()
8579
{
86-
// Action Group Data, missing page and description
80+
// Action Group Data, missing description
8781
$testAnnotations = [];
8882
// Perform Test
8983
$extractor = new ActionGroupAnnotationExtractor();

dev/tests/unit/Magento/FunctionalTestFramework/Util/DocGeneratorTest.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ class DocGeneratorTest extends MagentoTestCase
2323
public function testBasicCreateDocumentation()
2424
{
2525
$annotations = [
26-
"page" => "somePage",
2726
"description" => "someDescription"
2827
];
2928
$actionGroupUnderTest = (new ActionGroupObjectBuilder())
@@ -55,7 +54,6 @@ public function testBasicCreateDocumentation()
5554
public function testCreateDocumentationWithOverwrite()
5655
{
5756
$annotations = [
58-
"page" => "somePage",
5957
"description" => "someDescription"
6058
];
6159
$actionGroupUnderTest = (new ActionGroupObjectBuilder())
@@ -70,7 +68,6 @@ public function testCreateDocumentationWithOverwrite()
7068
);
7169

7270
$annotations = [
73-
"page" => "alteredPage",
7471
"description" => "alteredDescription"
7572
];
7673
$actionGroupUnderTest = (new ActionGroupObjectBuilder())
@@ -102,7 +99,6 @@ public function testCreateDocumentationWithOverwrite()
10299
public function testCreateDocumentationNotCleanException()
103100
{
104101
$annotations = [
105-
"page" => "somePage",
106102
"description" => "someDescription"
107103
];
108104
$actionGroupUnderTest = (new ActionGroupObjectBuilder())
Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,12 @@
11
#Action Group Information
2-
This documentation contains a list of all action groups on the pages on which they start
2+
This documentation contains a list of all Action Groups.
33

4-
##List of Pages
5-
- [ alteredPage ](#alteredPage)
64
---
7-
<a name="alteredPage"></a>
8-
##alteredPage
9-
105
###testActionGroupObject
11-
alteredDescription
6+
**Description**:
7+
- alteredDescription
128

13-
Located in:
9+
**Located In**:
1410

1511
- filename
1612
***
Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,12 @@
11
#Action Group Information
2-
This documentation contains a list of all action groups on the pages on which they start
2+
This documentation contains a list of all Action Groups.
33

4-
##List of Pages
5-
- [ somePage ](#somePage)
64
---
7-
<a name="somePage"></a>
8-
##somePage
9-
105
###testActionGroupObject
11-
someDescription
6+
**Description**:
7+
- someDescription
128

13-
Located in:
9+
**Located In**:
1410

1511
- filename
1612
***

docs/commands/mftf.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ vendor/bin/mftf generate:tests [option] [<test name>] [<test name>] [--remove]
122122
| `--force` | Forces test generation, regardless of the module merge order defined in the Magento instance. Example: `generate:tests --force`. |
123123
| `-i,--time` | Set time in minutes to determine the group size when `--config=parallel` is used. The __default value__ is `10`. Example: `generate:tests --config=parallel --time=15`|
124124
| `--tests` | Defines the test configuration as a JSON string.|
125-
| `--debug or --debug=[<none>]`| Performs schema validations on XML files. </br> <br/> DEFAULT: `generate:tests` implicitly performs schema validation on merged files. It does not indicate the file name where the error is encountered. <br/> DEVELOPER: `--debug` performs per-file validation and returns additional debug information (such as the filename where an error occurred) when test generation fails because of an invalid XML schema. This option takes extra processing time. Use it after test generation has failed once.</br> <br/> NONE: `--debug=none` skips debugging during test generation. Added for backward compatibility, it will be removed in the next MAJOR release.</br>|
125+
| `--debug or --debug=[<none>]`| Performs schema validations on XML files. <br/> DEFAULT: `generate:tests` implicitly performs schema validation on merged files. It does not indicate the file name where the error is encountered. <br/> DEVELOPER: `--debug` performs per-file validation and returns additional debug information (such as the filename where an error occurred) when test generation fails because of an invalid XML schema. This option takes extra processing time. Use it after test generation has failed once.</br><br/> NONE: `--debug=none` skips debugging during test generation. Added for backward compatibility, it will be removed in the next MAJOR release.</br>|
126126
| `-r,--remove`| Removes the existing generated suites and tests cleaning up the `_generated` directory before the actual run. For example, `generate:tests SampleTest --remove` cleans up the entire `_generated` directory and generates `SampleTest` only.|
127127

128128
#### Examples of the JSON configuration

src/Magento/FunctionalTestingFramework/Test/Util/ActionGroupAnnotationExtractor.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@
1414
class ActionGroupAnnotationExtractor extends AnnotationExtractor
1515
{
1616
const ACTION_GROUP_REQUIRED_ANNOTATIONS = [
17-
"description",
18-
"page",
17+
"description"
1918
];
2019
const GENERATE_DOCS_COMMAND = 'generate:docs';
2120

src/Magento/FunctionalTestingFramework/Test/etc/actionGroupSchema.xsd

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
<xs:complexType>
3535
<xs:sequence>
3636
<xs:element name="description"/>
37-
<xs:element name="page"/>
3837
</xs:sequence>
3938
</xs:complexType>
4039
</xs:element>

src/Magento/FunctionalTestingFramework/Util/DocGenerator.php

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ public function createDocumentation($annotatedObjects, $outputDir, $clean)
7676
?? 'NO_DESCRIPTION_SPECIFIED',
7777
self::FILENAMES => $filenames,
7878
ActionGroupObjectExtractor::ACTION_GROUP_ARGUMENTS => $arguments
79-
];
79+
];
80+
8081
$pageGroups = array_merge_recursive(
8182
$pageGroups,
8283
[$annotations[ActionGroupObject::ACTION_GROUP_PAGE] ?? 'NO_PAGE_SPECIFIED' => [$name => $info]]
@@ -103,34 +104,28 @@ public function createDocumentation($annotatedObjects, $outputDir, $clean)
103104
private function transformToMarkdown($annotationList)
104105
{
105106
$markdown = "#Action Group Information" . PHP_EOL;
106-
$markdown .= "This documentation contains a list of all" .
107-
" action groups on the pages on which they start" .
107+
$markdown .= "This documentation contains a list of all Action Groups." .
108108
PHP_EOL .
109109
PHP_EOL;
110110

111-
$markdown .= "##List of Pages" . PHP_EOL;
112-
foreach ($annotationList as $group => $objects) {
113-
$markdown .= "- [ $group ](#$group)" . PHP_EOL;
114-
}
115111
$markdown .= "---" . PHP_EOL;
116112
foreach ($annotationList as $group => $objects) {
117-
$markdown .= "<a name=\"$group\"></a>" . PHP_EOL;
118-
$markdown .= "##$group" . PHP_EOL . PHP_EOL;
119113
foreach ($objects as $name => $annotations) {
120114
$markdown .= "###$name" . PHP_EOL;
121-
$markdown .= $annotations[actionGroupObject::ACTION_GROUP_DESCRIPTION] . PHP_EOL . PHP_EOL;
115+
$markdown .= "**Description**:" . PHP_EOL;
116+
$markdown .= "- " . $annotations[actionGroupObject::ACTION_GROUP_DESCRIPTION] . PHP_EOL . PHP_EOL;
122117
if (!empty($annotations[ActionGroupObjectExtractor::ACTION_GROUP_ARGUMENTS])) {
123-
$markdown .= "Action Group Arguments:" . PHP_EOL . PHP_EOL;
118+
$markdown .= "**Action Group Arguments**:" . PHP_EOL . PHP_EOL;
124119
$markdown .= "| Name | Type |" . PHP_EOL;
125-
$markdown .= "| --- | --- |" . PHP_EOL;
120+
$markdown .= "| ---- | ---- |" . PHP_EOL;
126121
foreach ($annotations[ActionGroupObjectExtractor::ACTION_GROUP_ARGUMENTS] as $argument) {
127122
$argumentName = $argument->getName();
128123
$argumentType = $argument->getDataType();
129124
$markdown .= "| $argumentName | $argumentType |" . PHP_EOL;
130125
}
131126
$markdown .= PHP_EOL;
132127
}
133-
$markdown .= "Located in:" . PHP_EOL;
128+
$markdown .= "**Located In**:" . PHP_EOL;
134129
foreach ($annotations[self::FILENAMES] as $filename) {
135130
$relativeFilename = str_replace(MAGENTO_BP . DIRECTORY_SEPARATOR, "", $filename);
136131
$markdown .= PHP_EOL . "- $relativeFilename";

0 commit comments

Comments
 (0)