Skip to content

Commit ef534db

Browse files
authored
Merge pull request #346 from magento/develop
MFTF 2.4.0 - Merge develop to master
2 parents b4002b3 + 9359af2 commit ef534db

File tree

135 files changed

+15441
-170
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

135 files changed

+15441
-170
lines changed

.github/CODEOWNERS

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# CODEOWNERS file for /docs/ folder.
2+
# Forces a review from other writers for anything within /docs/.
3+
/docs/ @magento/devdocs-admins

.github/CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ Label| Description
160160
[create issue]: https://help.github.com/articles/creating-an-issue/
161161
[create pr]: https://help.github.com/articles/creating-a-pull-request/
162162
[Definition of Done]: https://devdocs.magento.com/guides/v2.2/contributor-guide/contributing_dod.html
163-
[devdocs]: https://github.com/magento/devdocs/blob/master/.github/CONTRIBUTING.md
163+
[devdocs]: https://github.com/magento/devdocs/blob/master/.github/CONTRIBUTING.html
164164
[existing issues]: https://github.com/magento/magento2-functional-testing-framework/issues?q=is%3Aopen+is%3Aissue
165165
[existing PRs]: https://github.com/magento/magento2-functional-testing-framework/pulls?q=is%3Aopen+is%3Apr
166166
[GitHub documentation]: https://help.github.com/articles/syncing-a-fork

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,5 @@ codeception.yml
1515
dev/tests/functional/MFTF.suite.yml
1616
dev/tests/functional/_output
1717
dev/mftf.log
18-
dev/tests/mftf.log
18+
dev/tests/mftf.log
19+
dev/tests/docs/*

.travis.yml

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ php:
33
- 7.0
44
- 7.1
55
- 7.2
6+
- 7.3
67
install: composer install --no-interaction --prefer-source
78
env:
89
matrix:

CHANGELOG.md

+26
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,32 @@
11
Magento Functional Testing Framework Changelog
22
================================================
33

4+
2.4.0
5+
-----
6+
### Enhancements
7+
* Maintainability
8+
* Added new `mftf static-checks` command to run new static checks against the attached test codebase
9+
* See DevDocs for details
10+
* Added new `mftf generate:docs` command that generates documentation about attached test codebase
11+
* See DevDocs for details
12+
* Traceability
13+
* Allure reports for tests now contain collapsible sections for `actionGroup`s used in execution.
14+
15+
### Fixes
16+
* Fixed an issue where `magentoCli` would treat `argument="0"` as a null value.
17+
* Fixed an issue where `amOnPage` and `waitForPwaElementVisible` would not utilize the `timeout` attribute correctly when MagentoPwaWebDriver is enabled.
18+
* Fixed an issue where invalid XML characters would cause Allure to throw an exception without a resulting report.
19+
* Fixed `codeception.dist.yml` configuration for keeping previous test run results.
20+
* PHP Notices are no longer thrown when XML is missing non-necessary attributes.
21+
* Removed unusable `fillSecretField` action from schema.
22+
23+
### GitHub Issues/Pull requests:
24+
* [#338](https://github.com/magento/magento2-functional-testing-framework/pull/338) -- Return exit codes of process started by 'run:test', 'run:group' or 'run:failed' command
25+
* [#333](https://github.com/magento/magento2-functional-testing-framework/pull/333) -- Added Nginx specific settings to getting started doc
26+
* [#332](https://github.com/magento/magento2-functional-testing-framework/pull/332) -- executeInSelenium action does not generate proper code
27+
* [#318](https://github.com/magento/magento2-functional-testing-framework/pull/318) -- Reduce cyclomatic complexity in Problem Methods
28+
* [#287](https://github.com/magento/magento2-functional-testing-framework/pull/287) -- Update requirements to include php7.3 support
29+
430
2.3.14
531
-----
632
### Enhancements

README.md

+19-8
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@
66

77
## Installation
88

9-
For the installation guidelines and system requirements, refer to [Getting Started](https://devdocs.magento.com/mftf/2.3/getting-started.html).
9+
For the installation guidelines and system requirements, refer to [Getting Started][].
1010

1111
## Contributing
1212

1313
We would appreciate your contributions to new components or new features, changes to the existing features, tests, documentation, specifications, bug fixes, optimizations, or just good suggestions.
1414
Report about an issue or request features opening a GitHub issue.
15-
Learn more about contributing in our [Contribution Guidelines](.github/CONTRIBUTING.md).
15+
Learn more about contributing in our [Contribution Guidelines][].
1616

17-
If you want to participate in the documentation work, see [DevDocs Contributing](https://github.com/magento/devdocs/blob/master/.github/CONTRIBUTING.md).
17+
If you want to participate in the documentation work, see [DevDocs Contributing][].
1818

1919
### Labels applied by the MFTF team
2020

@@ -55,15 +55,26 @@ These labels are applied by the MFTF development team to community contributed i
5555

5656
## Reporting security issues
5757

58-
To report security vulnerabilities and other security issues in the Magento software or web sites, send an email with the report at [[email protected]](mailto:[email protected]).
58+
To report security vulnerabilities and other security issues in the Magento software or web sites, send an email with the report at [[email protected]][].
5959
Do not report security issues using GitHub.
60-
Be sure to encrypt your e-mail with our [encryption key](https://info2.magento.com/rs/magentoenterprise/images/security_at_magento.asc) if it includes sensitive information.
61-
Learn more about reporting security issues [here](https://magento.com/security/reporting-magento-security-issue).
60+
Be sure to encrypt your e-mail with our [encryption key][] if it includes sensitive information.
61+
Learn more about reporting security issues [here][].
6262

63-
Stay up-to-date on the latest security news and patches for Magento by signing up for [Security Alert Notifications](https://magento.com/security/sign-up).
63+
Stay up-to-date on the latest security news and patches for Magento by signing up for [Security Alert Notifications][].
6464

6565
## License
6666

6767
Each Magento source file included in this distribution is licensed under AGPL 3.0.
6868

69-
See the license [here](LICENSE_AGPL3.txt) or contact [[email protected]](mailto:[email protected]) for a copy.
69+
See the license [here][] or contact [[email protected]][] for a copy.
70+
71+
<!-- Link Definitions -->
72+
[Getting Started]: docs/getting-started.md
73+
[Contribution Guidelines]: .github/CONTRIBUTING.html
74+
[DevDocs Contributing]: https://github.com/magento/devdocs/blob/master/.github/CONTRIBUTING.md
75+
76+
[encryption key]: https://info2.magento.com/rs/magentoenterprise/images/security_at_magento.asc
77+
[here]: https://magento.com/security/reporting-magento-security-issue
78+
[Security Alert Notifications]: https://magento.com/security/sign-up
79+
[here]: LICENSE_AGPL3.txt
80+

bin/mftf

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ try {
2929
try {
3030
$application = new Symfony\Component\Console\Application();
3131
$application->setName('Magento Functional Testing Framework CLI');
32-
$application->setVersion('2.3.14');
32+
$application->setVersion('2.4.0');
3333
/** @var \Magento\FunctionalTestingFramework\Console\CommandListInterface $commandList */
3434
$commandList = new \Magento\FunctionalTestingFramework\Console\CommandList;
3535
foreach ($commandList->getCommands() as $command) {

composer.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
"name": "magento/magento2-functional-testing-framework",
33
"description": "Magento2 Functional Testing Framework",
44
"type": "library",
5-
"version": "2.3.14",
5+
"version": "2.4.0",
66
"license": "AGPL-3.0",
77
"keywords": ["magento", "automation", "functional", "testing"],
88
"config": {
99
"sort-packages": true
1010
},
1111
"require": {
12-
"php": "7.0.2|7.0.4|~7.0.6|~7.1.0|~7.2.0",
12+
"php": "7.0.2||7.0.4||~7.0.6||~7.1.0||~7.2.0||~7.3.0",
1313
"allure-framework/allure-codeception": "~1.3.0",
1414
"ext-curl": "*",
1515
"codeception/codeception": "~2.3.4 || ~2.4.0 ",
@@ -25,7 +25,7 @@
2525
"require-dev": {
2626
"squizlabs/php_codesniffer": "~3.2",
2727
"sebastian/phpcpd": "~3.0 || ~4.0",
28-
"brainmaestro/composer-git-hooks": "^2.3",
28+
"brainmaestro/composer-git-hooks": "^2.3.1",
2929
"doctrine/cache": "<1.7.0",
3030
"codeception/aspect-mock": "^3.0",
3131
"goaop/framework": "2.2.0",

composer.lock

+10-9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dev/tests/_bootstrap.php

+22
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,28 @@
6060
defined('TESTS_BP') || define('TESTS_BP', __DIR__);
6161
defined('TESTS_MODULE_PATH') || define('TESTS_MODULE_PATH', TESTS_BP . $RELATIVE_TESTS_MODULE_PATH);
6262
defined('MAGENTO_BP') || define('MAGENTO_BP', __DIR__);
63+
define('DOCS_OUTPUT_DIR',
64+
FW_BP .
65+
DIRECTORY_SEPARATOR .
66+
"dev" .
67+
DIRECTORY_SEPARATOR .
68+
"tests" .
69+
DIRECTORY_SEPARATOR .
70+
"unit" .
71+
DIRECTORY_SEPARATOR .
72+
"_output"
73+
);
74+
define('RESOURCE_DIR',
75+
FW_BP .
76+
DIRECTORY_SEPARATOR .
77+
"dev" .
78+
DIRECTORY_SEPARATOR .
79+
"tests" .
80+
DIRECTORY_SEPARATOR .
81+
"unit" .
82+
DIRECTORY_SEPARATOR .
83+
"Resources"
84+
);
6385

6486
$utilDir = DIRECTORY_SEPARATOR . 'Util'. DIRECTORY_SEPARATOR . '*.php';
6587

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
namespace tests\unit\Magento\FunctionalTestFramework\Test\Util;
7+
8+
use AspectMock\Test as AspectMock;
9+
use Magento\FunctionalTestingFramework\Test\Util\ActionGroupAnnotationExtractor;
10+
use PHPUnit\Framework\TestCase;
11+
use tests\unit\Util\TestLoggingUtil;
12+
13+
class ActionGroupAnnotationExtractorTest extends TestCase
14+
{
15+
/**
16+
* Before test functionality
17+
* @return void
18+
*/
19+
public function setUp()
20+
{
21+
TestLoggingUtil::getInstance()->setMockLoggingUtil();
22+
}
23+
24+
/**
25+
* Annotation extractor takes in raw array and condenses it to expected format
26+
*
27+
* @throws \Exception
28+
*/
29+
public function testActionGroupExtractAnnotations()
30+
{
31+
// Test Data
32+
$actionGroupAnnotations = [
33+
"nodeName" => "annotations",
34+
"description" => [
35+
"nodeName" => "description",
36+
"value" => "someDescription"
37+
],
38+
"page" => [
39+
"nodeName" => "page",
40+
"value" => "somePage"
41+
]
42+
];
43+
// Perform Test
44+
$extractor = new ActionGroupAnnotationExtractor();
45+
$returnedAnnotations = $extractor->extractAnnotations($actionGroupAnnotations, "fileName");
46+
47+
// Asserts
48+
49+
$this->assertEquals("somePage", $returnedAnnotations['page']);
50+
$this->assertEquals("someDescription", $returnedAnnotations['description']);
51+
}
52+
53+
/**
54+
* Annotation extractor should throw warning when required annotations are missing
55+
*
56+
* @throws \Exception
57+
*/
58+
public function testActionGroupMissingAnnotations()
59+
{
60+
// Action Group Data, missing page and description
61+
$testAnnotations = [];
62+
// Perform Test
63+
$extractor = new ActionGroupAnnotationExtractor();
64+
AspectMock::double($extractor, ['isCommandDefined' => true]);
65+
$extractor->extractAnnotations($testAnnotations, "fileName");
66+
67+
// Asserts
68+
TestLoggingUtil::getInstance()->validateMockLogStatement(
69+
'warning',
70+
'DEPRECATION: Action Group File fileName is missing required annotations.',
71+
[
72+
'actionGroup' => 'fileName',
73+
'missingAnnotations' => "description, page"
74+
]
75+
);
76+
}
77+
78+
/**
79+
* Annotation extractor should not throw warning when required
80+
* annotations are missing if command is not generate:docs
81+
*
82+
* @throws \Exception
83+
*/
84+
public function testActionGroupMissingAnnotationsNoWarning()
85+
{
86+
// Action Group Data, missing page and description
87+
$testAnnotations = [];
88+
// Perform Test
89+
$extractor = new ActionGroupAnnotationExtractor();
90+
$extractor->extractAnnotations($testAnnotations, "fileName");
91+
92+
// Asserts
93+
TestLoggingUtil::getInstance()->validateMockLogEmpty();
94+
}
95+
96+
/**
97+
* After class functionality
98+
* @return void
99+
*/
100+
public static function tearDownAfterClass()
101+
{
102+
TestLoggingUtil::getInstance()->clearMockLoggingUtil();
103+
}
104+
}

0 commit comments

Comments
 (0)