Skip to content

[Pangolin] Deliver changes from Sprint 14 #17

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 48 commits into from
Dec 8, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
fe5e815
MQE-494: Create MFTF demo repository
tomreece Nov 21, 2017
7f3545b
MQE-494: Create MFTF demo repository
tomreece Nov 21, 2017
36755e5
MQE-507: [Action Groups] Strange behavior with argument replacement i…
KevinBKozan Nov 27, 2017
93e5768
MQE-565: User are not able to use <actionGroup> after updating the la…
imeron2433 Nov 21, 2017
5cc6508
Merge remote-tracking branch 'origin/sprint-develop' into MQE-494
tomreece Nov 28, 2017
a948df6
MQE-494: Create MFTF demo repository
tomreece Nov 28, 2017
06ccb74
MQE-469: use 'number' for operation data type according to swagger 2.…
jilu1 Nov 29, 2017
39bfa9f
MQE-382: Adding a "assertElementContainsAttribute" method.
ivy00johns Nov 29, 2017
e1b663c
MQE-586: Ignore _generated folder for mftf code sniffer
tomreece Nov 30, 2017
c229c07
Merge branch 'MQE-469' into sprint-develop
jilu1 Dec 1, 2017
bab10a8
MQE-569: added SampleTests in module blacklist and not allowed to gen…
jilu1 Dec 1, 2017
3649824
MQE-541: changed to use stepKey for test step sequencing.
jilu1 Dec 1, 2017
3eff218
Merge branch 'MQE-494' into sprint-develop
tomreece Dec 4, 2017
62780b4
Merge remote-tracking branch 'origin/MQE-569' into sprint-develop
jilu1 Dec 4, 2017
9123be8
MQE-525: Include PHP Mess Detector to required checks for MFTF
KevinBKozan Dec 4, 2017
546f165
MQE-541: changed to use stepKey for test step sequencing.
jilu1 Dec 5, 2017
110c3a5
MQE-541: changed to use stepKey for test step sequencing.
jilu1 Dec 5, 2017
faeee49
Merge branch 'MQE-541' into MQE-574
jilu1 Dec 5, 2017
1b87a6f
MQE-591: Bin scripts do not return the correct error code
tomreece Dec 5, 2017
5fcbc02
MQE-591: Bin scripts do not return the correct error code
tomreece Dec 5, 2017
bdb8340
MQE-579: waitForLoadingMaskToDisappear fails sometimes when two loadi…
KevinBKozan Dec 5, 2017
da10983
MQE-570: Sanitize MAGENTO_BASE_URL (.env file) and Selenium params
KevinBKozan Dec 5, 2017
0369375
MQE-549: [Unit Test] ActionMergeUtil.php
tomreece Dec 6, 2017
b38bb3e
MQE-574: set proper required attributes in test schema and added attr…
jilu1 Dec 6, 2017
febae80
MQE-541: deprecated 'mergeKey' for test schema.
jilu1 Dec 6, 2017
1e14905
MQE-600: Prune README.md in EE repo
tomreece Dec 6, 2017
7b95c71
Merge branch 'develop' of github.com:magento-pangolin/magento2-functi…
okolesnyk Dec 7, 2017
eba01db
MQE-347: Use a remove tag instead of a remove attribute
imeron2433 Dec 5, 2017
a7121eb
MQE-347: Use a remove tag instead of a remove attribute
imeron2433 Dec 6, 2017
81c8690
MQE-347: Use a remove tag instead of a remove attribute
imeron2433 Dec 7, 2017
1632842
MQE-574: set proper required attributes in test schema and added attr…
jilu1 Dec 7, 2017
d1dc19e
MQE-574: set proper required attributes in test schema and added attr…
jilu1 Dec 7, 2017
46a9e9b
MQE-583: set licensing in composer.json.
jilu1 Dec 7, 2017
8aac939
MQE-606: adding changelog.md file
magterskine Dec 7, 2017
8983616
Merge branch 'changelog' into sprint-develop
magterskine Dec 7, 2017
2c70363
Merge branch 'MQE-541' into sprint-develop
jilu1 Dec 7, 2017
7c4954b
Merge branch 'sprint-develop' of https://github.com/magento-pangolin/…
jilu1 Dec 7, 2017
a50014a
MQE-607: Replace license file
tomreece Dec 7, 2017
d76e7ae
MQE-386: MFTF Compatibility with Windows Machine
imeron2433 Dec 5, 2017
3b84770
MQE-386: MFTF Compatability with Windows Machine
imeron2433 Dec 7, 2017
724af1d
Merge branch 'MQE-574' into sprint-develop
jilu1 Dec 7, 2017
2410096
Merge branch 'sprint-develop' of https://github.com/magento-pangolin/…
jilu1 Dec 7, 2017
dddf351
MQE-592: Test Case Audit
ivy00johns Dec 7, 2017
8c36bce
MQE-592: Test Case Audit
ivy00johns Dec 7, 2017
c57f9e0
MQE-592: Audit Test Cases on Firefox/Chrome on Windows/OSX
imeron2433 Dec 7, 2017
cd3d25c
Merge branch 'MQE-607' into sprint-develop
tomreece Dec 8, 2017
5d5e1db
MQE-599: Move composer.json, README, etc from EE to CE
okolesnyk Dec 8, 2017
7563d0a
Merge branch 'MQE-599' of github.com:magento-pangolin/magento2-functi…
okolesnyk Dec 8, 2017
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
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Declare files that will always have LF line endings on checkout.
dev/tests/verification/Resources/TestSuiteGeneration1.txt text=auto !eol
dev/tests/verification/Resources/*.txt text eol=lf
File renamed without changes.
81 changes: 67 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,70 @@
# Magento2 Functional Testing Framework
# Magento Functional Testing Framework

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.
----

## System Requirements
[Magento Functional Testing Framework system requirements](http://devdocs.magento.com/guides/v2.3/magento-functional-testing-framework/getting-started.html#prepare-environment)

## Installation
Add the package into your acceptance test project composer.json:
```
{
"require": {
"magento/acceptance-test-framework": "dev-develop"
}
}
```
Then run:
```
composer update
```
To install the Magento Functional Testing Framework, see [Getting Started](http://devdocs.magento.com/guides/v2.3/magento-functional-testing-framework/getting-started.html)

## Contributing
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.

To learn about how to make a contribution, click [here][1].

To open an issue, click [here][2].

To suggest documentation improvements, click [here][3].

[1]: <http://devdocs.magento.com/guides/v2.3/magento-functional-testing-framework/contribution-guidelines.html>
[2]: <https://github.com/magento/magento2-functional-testing-framework/issues>
[3]: <http://devdocs.magento.com>

### Labels applied by the MFTF team

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.

### Pull Request Status

Label| Description
---|---
**accept**| The pull request has been accepted and will be merged into mainline code.
**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.
**needsUpdate**| The Magento Team needs additional information from the reporter to properly prioritize and process the pull request.

### Issue Resolution Status

Label| Description
---|---
**acknowledged**| The Magento Team has validated the issue and an internal ticket has been created.
**needsUpdate**| The Magento Team needs additional information from the reporter to properly prioritize and process the issue or pull request.
**cannot reproduce**| The Magento Team has not confirmed that this issue contains the minimum required information to reproduce.
**non-issue**| The Magento Team has not recognised any issue according to provided information.

### Domains Impacted

Label| Description
---|---
**PROD**| Affects the Product team (mostly feature requests or business logic change).
**DOC**| Affects Documentation domain.
**TECH**| Affects Architect Group (mostly to make decisions around technology changes).

### Type

Label| Description
---|---
**bugfix**| The issue or pull request relates to bug fixing.
**enhancement**| The issue or pull request that raises the MFTF to a higher degree (for example new features, optimization, refactoring, etc).

## Reporting security issues

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>.

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>.

## License

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

Please see LICENSE_AGPL3.txt for the full text of the AGPL 3.0 license or contact license@magentocommerce.com for a copy.
3 changes: 2 additions & 1 deletion bin/blacklist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@
bin/blacklist.txt
dev/tests/static/Magento/Sniffs/Annotations/Helper.php
dev/tests/static/Magento/Sniffs/Annotations/RequireAnnotatedAttributesSniff.php
dev/tests/static/Magento/Sniffs/Annotations/RequireAnnotatedMethodsSniff.php
dev/tests/static/Magento/Sniffs/Annotations/RequireAnnotatedMethodsSniff.php
dev/tests/verification/_generated
14 changes: 10 additions & 4 deletions bin/phpunit-checks
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
# Copyright © Magento, Inc. All rights reserved.
# See COPYING.txt for license details.

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

echo "===============================VERIFICATION TESTS==============================="
vendor/bin/phpunit --configuration dev/tests/phpunit.xml --testsuite verification --coverage-xml build/coverage-xml
echo "==============================="
echo " UNIT TESTS"
echo "==============================="
vendor/bin/phpunit --configuration dev/tests/phpunit.xml --testsuite unit

echo "==============================="
echo " VERIFICATION TESTS"
echo "==============================="
vendor/bin/phpunit --configuration dev/tests/phpunit.xml --testsuite verification
10 changes: 10 additions & 0 deletions bin/phpunit-checks.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
:: Copyright © Magento, Inc. All rights reserved.
:: See COPYING.txt for license details.

@echo ===============================UNIT TESTS===============================
@echo off
call vendor\bin\phpunit --configuration dev\tests\phpunit.xml --testsuite unit --coverage-xml build\coverage-xml

@echo off
@echo ===============================VERIFICATION TESTS===============================
call vendor\bin\phpunit --configuration dev\tests\phpunit.xml --testsuite verification --coverage-xml build\coverage-xml
26 changes: 22 additions & 4 deletions bin/static-checks
Original file line number Diff line number Diff line change
@@ -1,13 +1,31 @@
# Copyright © Magento, Inc. All rights reserved.
# See COPYING.txt for license details.

echo "===============================PHP CODE SNIFFER REPORT==============================="
set -e

echo "==============================="
echo " CODE SNIFFER"
echo "==============================="
vendor/bin/phpcs ./src --standard=./dev/tests/static/Magento
vendor/bin/phpcs ./dev/tests/unit --standard=./dev/tests/static/Magento
vendor/bin/phpcs ./dev/tests/verification --standard=./dev/tests/static/Magento
vendor/bin/phpcs ./dev/tests/verification --standard=./dev/tests/static/Magento --ignore=dev/tests/verification/_generated
echo ""

echo "===============================COPY PASTE DETECTOR REPORT==============================="
echo "==============================="
echo " COPY PASTE DETECTOR"
echo "==============================="
vendor/bin/phpcpd ./src
echo ""

# Uncomment lines as part of MQE-590
# echo "==============================="
# echo " MESS DETECTOR"
# echo "==============================="
# vendor/bin/phpmd ./src text /dev/tests/static/Magento/CodeMessDetector/ruleset.xml --exclude _generated
# echo ""

echo "===============================MAGENTO COPYRIGHT REPORT==============================="
echo "==============================="
echo " MAGENTO COPYRIGHT CHECK"
echo "==============================="
bin/copyright-check
echo ""
20 changes: 20 additions & 0 deletions bin/static-checks.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
:: Copyright © Magento, Inc. All rights reserved.
:: See COPYING.txt for license details.

@echo off
@echo ===============================PHP CODE SNIFFER REPORT===============================
call vendor\bin\phpcs .\src --standard=.\dev\tests\static\Magento
call vendor\bin\phpcs .\dev\tests\unit --standard=.\dev\tests\static\Magento
call vendor\bin\phpcs .\dev\tests\verification --standard=.\dev\tests\static\Magento --ignore=dev\tests\verification\_generated

@echo ===============================COPY PASTE DETECTOR REPORT===============================
call vendor\bin\phpcpd .\src

:: Uncomment lines as part of MQE-590
:: @echo "===============================PHP MESS DETECTOR REPORT===============================
:: vendor\bin\phpmd .\src text \dev\tests\static\Magento\CodeMessDetector\ruleset.xml --exclude _generated

@echo ===============================MAGENTO COPYRIGHT REPORT===============================
echo msgbox "INFO:Copyright check currently not run as part of .bat implementation" > "%temp%\popup.vbs"
wscript.exe "%temp%\popup.vbs"
::bin\copyright-check
20 changes: 20 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
MFTF Version 1.0 - Changelog

Core Features:

Supported Systems:
OS
Windows 10
OSX (Sierra)

Browser
Chrome (Latest) with ChromeDriver Latest


Known Issues:
*Support for Firefox is curently incomplete. This will be resolved to support Firefox 57 (Quantum) and latest Gecko driver in next minor release.





18 changes: 12 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,31 +1,37 @@
{
"name": "magento/magento2-functional-testing-framework",
"type": "library",
"description": "Magento2 Functional Testing Framework",
"type": "library",
"version": "1.0.0",
"license": "AGPL-3.0",
"keywords": ["magento", "automation", "functional", "testing"],
"config": {
"sort-packages": true
},
"require": {
"php": "7.0.2|7.0.4|~7.0.6|~7.1.0",
"codeception/codeception": "~2.3.4",
"epfremme/swagger-php": "^2.0",
"flow/jsonpath": ">0.2",
"fzaninotto/faker": "^1.6",
"mustache/mustache": "~2.5",
"epfremme/swagger-php": "^2.0"
"mustache/mustache": "~2.5"
},
"require-dev": {
"squizlabs/php_codesniffer": "1.5.3",
"sebastian/phpcpd": "~3.0",
"brainmaestro/composer-git-hooks": "^2.3",
"codeception/aspect-mock": "^2.0",
"codacy/coverage": "^1.4"
"codacy/coverage": "^1.4",
"phpmd/phpmd": "^2.6.0"
},
"autoload": {
"psr-4": {
"Magento\\FunctionalTestingFramework\\": ["src/Magento/FunctionalTestingFramework"]
"Magento\\FunctionalTestingFramework\\": "src/Magento/FunctionalTestingFramework"
}
},
"autoload-dev": {
"psr-4": {
"tests\\unit\\Magento\\FunctionalTestingFramework\\": ["dev/tests/unit/Magento/FunctionalTestingFramework"]
"tests\\unit\\Magento\\FunctionalTestingFramework\\": "dev/tests/unit/Magento/FunctionalTestingFramework"
}
},
"extra": {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/

namespace Magento\CodeMessDetector\Rule\Design;

use PHPMD\AbstractNode;
use PHPMD\AbstractRule;
use PHPMD\Rule\ClassAware;
use PHPMD\Rule\MethodAware;

/**
* Magento is a highly extensible and customizable platform.
* Usage of final classes and methods is prohibited.
*/
class FinalImplementation extends AbstractRule implements ClassAware, MethodAware
{
/**
* @inheritdoc
*/
public function apply(AbstractNode $node)
{
if ($node->isFinal()) {
$this->addViolation($node, [$node->getType(), $node->getFullQualifiedName()]);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?xml version="1.0"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<ruleset name="Magento Specific Design Rules"
xmlns="http://pmd.sf.net/ruleset/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd"
xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd">
<rule name="FinalImplementation"
class="Magento\CodeMessDetector\Rule\Design\FinalImplementation"
message= "The {0} {1} declared as final.">
<description>
<![CDATA[
Final keyword is prohibited in Magento as this decreases extensibility and customizability.
Final classes and method are not compatible with plugins and proxies.
]]>
</description>
<priority>1</priority>
<properties />
<example>
<![CDATA[
final class Foo
{
public function bar() {}
}
class Baz {
final public function bad() {}
}
]]>
</example>
</rule>
</ruleset>
50 changes: 50 additions & 0 deletions dev/tests/static/Magento/CodeMessDetector/ruleset.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<?xml version='1.0' encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<ruleset name="Magento PHPMD rule set" xmlns="http://pmd.sf.net/ruleset/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd"
xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd">
<description>Magento Code Check Rules</description>
<php-includepath>../../../static</php-includepath>

<!-- Code Size Rules -->
<rule ref="rulesets/codesize.xml/CyclomaticComplexity" />
<rule ref="rulesets/codesize.xml/NPathComplexity" />
<rule ref="rulesets/codesize.xml/ExcessiveMethodLength" />
<rule ref="rulesets/codesize.xml/ExcessiveParameterList" />
<rule ref="rulesets/codesize.xml/ExcessivePublicCount" />
<rule ref="rulesets/codesize.xml/TooManyFields" />
<rule ref="rulesets/codesize.xml/ExcessiveClassComplexity">
<properties>
<property name="maximum" value="100" />
</properties>
</rule>

<!-- Unused code rules -->
<rule ref="rulesets/unusedcode.xml" />

<!-- Code design rules -->
<rule ref="rulesets/design.xml/ExitExpression" />
<rule ref="rulesets/design.xml/EvalExpression" />
<rule ref="rulesets/design.xml/GotoStatement" />
<rule ref="rulesets/design.xml/NumberOfChildren" />
<rule ref="rulesets/design.xml/DepthOfInheritance">
<properties>
<property name="minimum" value="8" />
</properties>
</rule>
<rule ref="rulesets/design.xml/CouplingBetweenObjects" />

<!-- Naming Rules -->
<rule ref="rulesets/naming.xml/ShortMethodName" />
<rule ref="rulesets/naming.xml/ConstantNamingConventions" />
<rule ref="rulesets/naming.xml/BooleanGetMethodName" />

<!-- Magento Specific Rules -->
<rule ref="Magento/CodeMessDetector/resources/rulesets/design.xml/FinalImplementation" />
</ruleset>
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ class OperationDataArrayResolverTest extends TestCase
"name" => "Hopper",
"address" => ["city" => "Hawkins", "state" => "Indiana", "zip" => 78758],
"isPrimary" => true,
"gpa" => 3.5,
"gpa" => 3.5678,
"phone" => 5555555
]];

const NESTED_METADATA_ARRAY_RESULT = ["parentType" => [
"name" => "Hopper",
"isPrimary" => true,
"gpa" => 3.5,
"gpa" => 3.5678,
"phone" => 5555555,
"address" => [
["city" => "Hawkins", "state" => "Indiana", "zip" => 78758],
Expand Down Expand Up @@ -65,7 +65,7 @@ public function testBasicPrimitiveMetadataResolve()
// assert on result
$expectedResult = ["testType" => [
"name" => "Hopper",
"gpa" => 3.5,
"gpa" => 3.5678,
"phone" => 5555555,
"isPrimary" => true
]];
Expand Down
Loading