Skip to content

Commit 70c220f

Browse files
authored
Merge pull request #17 from magento-pangolin/sprint-develop
[Pangolin] Deliver changes from Sprint 14
2 parents d261332 + 7563d0a commit 70c220f

File tree

72 files changed

+1483
-1207
lines changed

Some content is hidden

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

72 files changed

+1483
-1207
lines changed

.gitattributes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Declare files that will always have LF line endings on checkout.
2+
dev/tests/verification/Resources/TestSuiteGeneration1.txt text=auto !eol
3+
dev/tests/verification/Resources/*.txt text eol=lf
File renamed without changes.

README.md

Lines changed: 67 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,70 @@
1-
# Magento2 Functional Testing Framework
1+
# Magento Functional Testing Framework
22

3-
Customized codeception modules, helpers, page objects and step objects for Magento 2.2.x. This library package can be used as dependency for Magento Acceptance Test projects for Magento 2 Community Edition ([magento/acceptance-test-ce](https://github.com/magento-pangolin/acceptance-test-ce/)) or Magento 2 Enterprise Edition in ([magento/acceptance-test-ee](https://github.com/magento-pangolin/acceptance-test-ee/)) or acceptance test projects for Magento 2 extensions.
3+
----
4+
5+
## System Requirements
6+
[Magento Functional Testing Framework system requirements](http://devdocs.magento.com/guides/v2.3/magento-functional-testing-framework/getting-started.html#prepare-environment)
47

58
## Installation
6-
Add the package into your acceptance test project composer.json:
7-
```
8-
{
9-
"require": {
10-
"magento/acceptance-test-framework": "dev-develop"
11-
}
12-
}
13-
```
14-
Then run:
15-
```
16-
composer update
17-
```
9+
To install the Magento Functional Testing Framework, see [Getting Started](http://devdocs.magento.com/guides/v2.3/magento-functional-testing-framework/getting-started.html)
10+
11+
## Contributing
12+
Contributions can take the form of new components or features, changes to existing features, tests, documentation (such as developer guides, user guides, examples, or specifications), bug fixes, optimizations, or just good suggestions.
13+
14+
To learn about how to make a contribution, click [here][1].
15+
16+
To open an issue, click [here][2].
17+
18+
To suggest documentation improvements, click [here][3].
19+
20+
[1]: <http://devdocs.magento.com/guides/v2.3/magento-functional-testing-framework/contribution-guidelines.html>
21+
[2]: <https://github.com/magento/magento2-functional-testing-framework/issues>
22+
[3]: <http://devdocs.magento.com>
23+
24+
### Labels applied by the MFTF team
25+
26+
Refer to the tables with descriptions of each label below. These labels are applied by the MFTF development team to community contributed issues and pull requests, to communicate status, impact, or which team is working on it.
27+
28+
### Pull Request Status
29+
30+
Label| Description
31+
---|---
32+
**accept**| The pull request has been accepted and will be merged into mainline code.
33+
**reject**| The pull request has been rejected and will not be merged into mainline code. Possible reasons can include but are not limited to: issue has already been fixed in another code contribution, or there is an issue with the code contribution.
34+
**needsUpdate**| The Magento Team needs additional information from the reporter to properly prioritize and process the pull request.
35+
36+
### Issue Resolution Status
37+
38+
Label| Description
39+
---|---
40+
**acknowledged**| The Magento Team has validated the issue and an internal ticket has been created.
41+
**needsUpdate**| The Magento Team needs additional information from the reporter to properly prioritize and process the issue or pull request.
42+
**cannot reproduce**| The Magento Team has not confirmed that this issue contains the minimum required information to reproduce.
43+
**non-issue**| The Magento Team has not recognised any issue according to provided information.
44+
45+
### Domains Impacted
46+
47+
Label| Description
48+
---|---
49+
**PROD**| Affects the Product team (mostly feature requests or business logic change).
50+
**DOC**| Affects Documentation domain.
51+
**TECH**| Affects Architect Group (mostly to make decisions around technology changes).
52+
53+
### Type
54+
55+
Label| Description
56+
---|---
57+
**bugfix**| The issue or pull request relates to bug fixing.
58+
**enhancement**| The issue or pull request that raises the MFTF to a higher degree (for example new features, optimization, refactoring, etc).
59+
60+
## Reporting security issues
61+
62+
To report security vulnerabilities in Magento software or web sites, please e-mail <a href="mailto:security@magento.com">security@magento.com</a>. Please do not report security issues using GitHub. Be sure to encrypt your e-mail with our <a href="https://info2.magento.com/rs/magentoenterprise/images/security_at_magento.asc">encryption key</a> if it includes sensitive information. Learn more about reporting security issues <a href="https://magento.com/security/reporting-magento-security-issue">here</a>.
63+
64+
Stay up-to-date on the latest security news and patches for Magento by signing up for <a href="https://magento.com/security/sign-up">Security Alert Notifications</a>.
65+
66+
## License
67+
68+
Each Magento source file included in this distribution is licensed under AGPL 3.0
69+
70+
Please see LICENSE_AGPL3.txt for the full text of the AGPL 3.0 license or contact license@magentocommerce.com for a copy.

bin/blacklist.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@
66
bin/blacklist.txt
77
dev/tests/static/Magento/Sniffs/Annotations/Helper.php
88
dev/tests/static/Magento/Sniffs/Annotations/RequireAnnotatedAttributesSniff.php
9-
dev/tests/static/Magento/Sniffs/Annotations/RequireAnnotatedMethodsSniff.php
9+
dev/tests/static/Magento/Sniffs/Annotations/RequireAnnotatedMethodsSniff.php
10+
dev/tests/verification/_generated

bin/phpunit-checks

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
# Copyright © Magento, Inc. All rights reserved.
22
# See COPYING.txt for license details.
33

4-
echo "===============================UNIT TESTS==============================="
5-
vendor/bin/phpunit --configuration dev/tests/phpunit.xml --testsuite unit --coverage-xml build/coverage-xml
4+
set -e
65

7-
echo "===============================VERIFICATION TESTS==============================="
8-
vendor/bin/phpunit --configuration dev/tests/phpunit.xml --testsuite verification --coverage-xml build/coverage-xml
6+
echo "==============================="
7+
echo " UNIT TESTS"
8+
echo "==============================="
9+
vendor/bin/phpunit --configuration dev/tests/phpunit.xml --testsuite unit
10+
11+
echo "==============================="
12+
echo " VERIFICATION TESTS"
13+
echo "==============================="
14+
vendor/bin/phpunit --configuration dev/tests/phpunit.xml --testsuite verification

bin/phpunit-checks.bat

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
:: Copyright © Magento, Inc. All rights reserved.
2+
:: See COPYING.txt for license details.
3+
4+
@echo ===============================UNIT TESTS===============================
5+
@echo off
6+
call vendor\bin\phpunit --configuration dev\tests\phpunit.xml --testsuite unit --coverage-xml build\coverage-xml
7+
8+
@echo off
9+
@echo ===============================VERIFICATION TESTS===============================
10+
call vendor\bin\phpunit --configuration dev\tests\phpunit.xml --testsuite verification --coverage-xml build\coverage-xml

bin/static-checks

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,31 @@
11
# Copyright © Magento, Inc. All rights reserved.
22
# See COPYING.txt for license details.
33

4-
echo "===============================PHP CODE SNIFFER REPORT==============================="
4+
set -e
5+
6+
echo "==============================="
7+
echo " CODE SNIFFER"
8+
echo "==============================="
59
vendor/bin/phpcs ./src --standard=./dev/tests/static/Magento
610
vendor/bin/phpcs ./dev/tests/unit --standard=./dev/tests/static/Magento
7-
vendor/bin/phpcs ./dev/tests/verification --standard=./dev/tests/static/Magento
11+
vendor/bin/phpcs ./dev/tests/verification --standard=./dev/tests/static/Magento --ignore=dev/tests/verification/_generated
12+
echo ""
813

9-
echo "===============================COPY PASTE DETECTOR REPORT==============================="
14+
echo "==============================="
15+
echo " COPY PASTE DETECTOR"
16+
echo "==============================="
1017
vendor/bin/phpcpd ./src
18+
echo ""
19+
20+
# Uncomment lines as part of MQE-590
21+
# echo "==============================="
22+
# echo " MESS DETECTOR"
23+
# echo "==============================="
24+
# vendor/bin/phpmd ./src text /dev/tests/static/Magento/CodeMessDetector/ruleset.xml --exclude _generated
25+
# echo ""
1126

12-
echo "===============================MAGENTO COPYRIGHT REPORT==============================="
27+
echo "==============================="
28+
echo " MAGENTO COPYRIGHT CHECK"
29+
echo "==============================="
1330
bin/copyright-check
31+
echo ""

bin/static-checks.bat

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
:: Copyright © Magento, Inc. All rights reserved.
2+
:: See COPYING.txt for license details.
3+
4+
@echo off
5+
@echo ===============================PHP CODE SNIFFER REPORT===============================
6+
call vendor\bin\phpcs .\src --standard=.\dev\tests\static\Magento
7+
call vendor\bin\phpcs .\dev\tests\unit --standard=.\dev\tests\static\Magento
8+
call vendor\bin\phpcs .\dev\tests\verification --standard=.\dev\tests\static\Magento --ignore=dev\tests\verification\_generated
9+
10+
@echo ===============================COPY PASTE DETECTOR REPORT===============================
11+
call vendor\bin\phpcpd .\src
12+
13+
:: Uncomment lines as part of MQE-590
14+
:: @echo "===============================PHP MESS DETECTOR REPORT===============================
15+
:: vendor\bin\phpmd .\src text \dev\tests\static\Magento\CodeMessDetector\ruleset.xml --exclude _generated
16+
17+
@echo ===============================MAGENTO COPYRIGHT REPORT===============================
18+
echo msgbox "INFO:Copyright check currently not run as part of .bat implementation" > "%temp%\popup.vbs"
19+
wscript.exe "%temp%\popup.vbs"
20+
::bin\copyright-check

changelog.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
MFTF Version 1.0 - Changelog
2+
3+
Core Features:
4+
5+
Supported Systems:
6+
OS
7+
Windows 10
8+
OSX (Sierra)
9+
10+
Browser
11+
Chrome (Latest) with ChromeDriver Latest
12+
13+
14+
Known Issues:
15+
*Support for Firefox is curently incomplete. This will be resolved to support Firefox 57 (Quantum) and latest Gecko driver in next minor release.
16+
17+
18+
19+
20+

composer.json

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,37 @@
11
{
22
"name": "magento/magento2-functional-testing-framework",
3-
"type": "library",
43
"description": "Magento2 Functional Testing Framework",
4+
"type": "library",
5+
"version": "1.0.0",
6+
"license": "AGPL-3.0",
57
"keywords": ["magento", "automation", "functional", "testing"],
8+
"config": {
9+
"sort-packages": true
10+
},
611
"require": {
712
"php": "7.0.2|7.0.4|~7.0.6|~7.1.0",
813
"codeception/codeception": "~2.3.4",
14+
"epfremme/swagger-php": "^2.0",
915
"flow/jsonpath": ">0.2",
1016
"fzaninotto/faker": "^1.6",
11-
"mustache/mustache": "~2.5",
12-
"epfremme/swagger-php": "^2.0"
17+
"mustache/mustache": "~2.5"
1318
},
1419
"require-dev": {
1520
"squizlabs/php_codesniffer": "1.5.3",
1621
"sebastian/phpcpd": "~3.0",
1722
"brainmaestro/composer-git-hooks": "^2.3",
1823
"codeception/aspect-mock": "^2.0",
19-
"codacy/coverage": "^1.4"
24+
"codacy/coverage": "^1.4",
25+
"phpmd/phpmd": "^2.6.0"
2026
},
2127
"autoload": {
2228
"psr-4": {
23-
"Magento\\FunctionalTestingFramework\\": ["src/Magento/FunctionalTestingFramework"]
29+
"Magento\\FunctionalTestingFramework\\": "src/Magento/FunctionalTestingFramework"
2430
}
2531
},
2632
"autoload-dev": {
2733
"psr-4": {
28-
"tests\\unit\\Magento\\FunctionalTestingFramework\\": ["dev/tests/unit/Magento/FunctionalTestingFramework"]
34+
"tests\\unit\\Magento\\FunctionalTestingFramework\\": "dev/tests/unit/Magento/FunctionalTestingFramework"
2935
}
3036
},
3137
"extra": {
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
namespace Magento\CodeMessDetector\Rule\Design;
8+
9+
use PHPMD\AbstractNode;
10+
use PHPMD\AbstractRule;
11+
use PHPMD\Rule\ClassAware;
12+
use PHPMD\Rule\MethodAware;
13+
14+
/**
15+
* Magento is a highly extensible and customizable platform.
16+
* Usage of final classes and methods is prohibited.
17+
*/
18+
class FinalImplementation extends AbstractRule implements ClassAware, MethodAware
19+
{
20+
/**
21+
* @inheritdoc
22+
*/
23+
public function apply(AbstractNode $node)
24+
{
25+
if ($node->isFinal()) {
26+
$this->addViolation($node, [$node->getType(), $node->getFullQualifiedName()]);
27+
}
28+
}
29+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?xml version="1.0"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
<ruleset name="Magento Specific Design Rules"
9+
xmlns="http://pmd.sf.net/ruleset/1.0.0"
10+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
11+
xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd"
12+
xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd">
13+
<rule name="FinalImplementation"
14+
class="Magento\CodeMessDetector\Rule\Design\FinalImplementation"
15+
message= "The {0} {1} declared as final.">
16+
<description>
17+
<![CDATA[
18+
Final keyword is prohibited in Magento as this decreases extensibility and customizability.
19+
Final classes and method are not compatible with plugins and proxies.
20+
]]>
21+
</description>
22+
<priority>1</priority>
23+
<properties />
24+
<example>
25+
<![CDATA[
26+
final class Foo
27+
{
28+
public function bar() {}
29+
}
30+
class Baz {
31+
final public function bad() {}
32+
}
33+
]]>
34+
</example>
35+
</rule>
36+
</ruleset>
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
<?xml version='1.0' encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
<ruleset name="Magento PHPMD rule set" xmlns="http://pmd.sf.net/ruleset/1.0.0"
9+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd"
11+
xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd">
12+
<description>Magento Code Check Rules</description>
13+
<php-includepath>../../../static</php-includepath>
14+
15+
<!-- Code Size Rules -->
16+
<rule ref="rulesets/codesize.xml/CyclomaticComplexity" />
17+
<rule ref="rulesets/codesize.xml/NPathComplexity" />
18+
<rule ref="rulesets/codesize.xml/ExcessiveMethodLength" />
19+
<rule ref="rulesets/codesize.xml/ExcessiveParameterList" />
20+
<rule ref="rulesets/codesize.xml/ExcessivePublicCount" />
21+
<rule ref="rulesets/codesize.xml/TooManyFields" />
22+
<rule ref="rulesets/codesize.xml/ExcessiveClassComplexity">
23+
<properties>
24+
<property name="maximum" value="100" />
25+
</properties>
26+
</rule>
27+
28+
<!-- Unused code rules -->
29+
<rule ref="rulesets/unusedcode.xml" />
30+
31+
<!-- Code design rules -->
32+
<rule ref="rulesets/design.xml/ExitExpression" />
33+
<rule ref="rulesets/design.xml/EvalExpression" />
34+
<rule ref="rulesets/design.xml/GotoStatement" />
35+
<rule ref="rulesets/design.xml/NumberOfChildren" />
36+
<rule ref="rulesets/design.xml/DepthOfInheritance">
37+
<properties>
38+
<property name="minimum" value="8" />
39+
</properties>
40+
</rule>
41+
<rule ref="rulesets/design.xml/CouplingBetweenObjects" />
42+
43+
<!-- Naming Rules -->
44+
<rule ref="rulesets/naming.xml/ShortMethodName" />
45+
<rule ref="rulesets/naming.xml/ConstantNamingConventions" />
46+
<rule ref="rulesets/naming.xml/BooleanGetMethodName" />
47+
48+
<!-- Magento Specific Rules -->
49+
<rule ref="Magento/CodeMessDetector/resources/rulesets/design.xml/FinalImplementation" />
50+
</ruleset>

dev/tests/unit/Magento/FunctionalTestFramework/DataGenerator/Persist/OperationDataArrayResolverTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@ class OperationDataArrayResolverTest extends TestCase
2020
"name" => "Hopper",
2121
"address" => ["city" => "Hawkins", "state" => "Indiana", "zip" => 78758],
2222
"isPrimary" => true,
23-
"gpa" => 3.5,
23+
"gpa" => 3.5678,
2424
"phone" => 5555555
2525
]];
2626

2727
const NESTED_METADATA_ARRAY_RESULT = ["parentType" => [
2828
"name" => "Hopper",
2929
"isPrimary" => true,
30-
"gpa" => 3.5,
30+
"gpa" => 3.5678,
3131
"phone" => 5555555,
3232
"address" => [
3333
["city" => "Hawkins", "state" => "Indiana", "zip" => 78758],
@@ -65,7 +65,7 @@ public function testBasicPrimitiveMetadataResolve()
6565
// assert on result
6666
$expectedResult = ["testType" => [
6767
"name" => "Hopper",
68-
"gpa" => 3.5,
68+
"gpa" => 3.5678,
6969
"phone" => 5555555,
7070
"isPrimary" => true
7171
]];

0 commit comments

Comments
 (0)