Skip to content

Commit d865ef1

Browse files
authored
Merge pull request #1814 from magento-pangolin/sprint-2.2-develop
[Pangolin] Deliver changes from Sprint 14 - 2.2-develop - MQE-528: Robo commands should override certain files. - MQE-382: Adding custom "assertElementContainsAttribute" method. - MQE-572: Expose selenium configuration from within our .env file - MQE-513: added attachment (screenshots/logs) support in Allure report - MQE-439: .env.example parameter example comment block - MQE-541: changed to use stepKey for test step sequencing. - MQE-569: added SampleTests in module blacklist and not allowed to generate - MQE-570: Sanitize MAGENTO_BASE_URL (.env file) and Selenium params - MQE-574: selector or selectorArray attribute is required for 'click' - MQE-583: set release version to 1.0.0 and updated composer dependencies. - MQE-347: Use a remove tag instead of a remove attribute - MQE-386: MFTF Compatibility with Windows Machine - MQE-592: Audit Test Cases on Firefox/Chrome on Windows/OSX - MQE-599: Move composer.json, README, etc from EE to CE
2 parents 4467ff4 + a8e06f4 commit d865ef1

File tree

273 files changed

+4289
-4949
lines changed

Some content is hidden

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

273 files changed

+4289
-4949
lines changed

dev/tests/acceptance/.env.example

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

4+
#*** Start of example .env ***#
5+
#
6+
# MAGENTO_BASE_URL=http://127.0.0.1:32772/
7+
#
8+
# MAGENTO_BACKEND_NAME=admin
9+
# MAGENTO_ADMIN_USERNAME=admin
10+
# MAGENTO_ADMIN_PASSWORD=123123q
11+
#
12+
# SELENIUM_HOST=127.0.0.1
13+
# SELENIUM_PORT=4444
14+
# SELENIUM_PROTOCOL=http
15+
# SELENIUM_PATH=/wd/hub
16+
#
17+
# MAGENTO_RESTAPI_SERVER_HOST=127.0.0.1
18+
# MAGENTO_RESTAPI_SERVER_PORT=32769
19+
#
20+
# TESTS_BP=/Users/First_Last/GitHub/magento2ce/dev/tests/acceptance/tests/functional
21+
# FW_BP=/Users/First_Last/GitHub/magento2-functional-testing-framework
22+
# TESTS_MODULE_PATH=/Users/First_Last/GitHub/magento2ce/dev/tests/acceptance/tests/functional/Magento/FunctionalTest
23+
# MODULE_WHITELIST=Magento_NewModule
24+
#
25+
#*** End of example .env ***#
26+
27+
28+
#*** Start of .env ***#
29+
30+
#*** Set the base URL for your Magento instance ***#
431
MAGENTO_BASE_URL=
532

33+
#*** Set the Admin Username and Password for your Magento instance ***#
634
MAGENTO_BACKEND_NAME=
735
MAGENTO_ADMIN_USERNAME=
836
MAGENTO_ADMIN_PASSWORD=
937

10-
#*** Uncomment and set host & port if your dev environment needs different value other than MAGENTO_BASE_URL for Rest Api Requests ***#
38+
#*** Selenium Server Protocol, Host, Port, and Path, with local defaults. Uncomment and change if not running Selenium locally.
39+
#SELENIUM_HOST=127.0.0.1
40+
#SELENIUM_PORT=4444
41+
#SELENIUM_PROTOCOL=http
42+
#SELENIUM_PATH=/wd/hub
43+
44+
#*** Uncomment and set host & port if your dev environment needs different value other than MAGENTO_BASE_URL for Rest API Requests ***#
1145
#MAGENTO_RESTAPI_SERVER_HOST=
1246
#MAGENTO_RESTAPI_SERVER_PORT=
1347

14-
DB_DSN=
15-
DB_USERNAME=
16-
DB_PASSWORD=
17-
18-
#*** uncomment these properties to set up a dev environment with symlinked projects***#
48+
#*** Uncomment these properties to set up a dev environment with symlinked projects ***#
1949
#TESTS_BP=
2050
#FW_BP=
2151
#TESTS_MODULE_PATH=
22-
#MODULE_WHITELIST=
52+
#MODULE_WHITELIST=
53+
#MFTF_DEBUG=true
54+
55+
#*** End of .env ***#

dev/tests/acceptance/README.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# Magento Functional Testing Framework
2+
3+
----
4+
5+
## System Requirements
6+
[Magento Functional Testing Framework system requirements](http://devdocs.magento.com/guides/v2.2/magento-functional-testing-framework/getting-started.html#prepare-environment)
7+
8+
## Installation
9+
To install the Magento Functional Testing Framework, see [Getting Started](http://devdocs.magento.com/guides/v2.2/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.2/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+
## License
61+
62+
Each Magento source file included in this distribution is licensed under APL 3.0
63+
64+
Please see LICENSE_APL3.txt for the full text of the APL 3.0 license or contact [email protected] for a copy.

dev/tests/acceptance/RoboFile.php

Lines changed: 16 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ class RoboFile extends \Robo\Tasks
2121
function cloneFiles()
2222
{
2323
$this->_exec('cp -vn .env.example .env');
24-
$this->_exec('cp -vn codeception.dist.yml codeception.yml');
25-
$this->_exec('cp -vn tests/functional.suite.dist.yml tests/functional.suite.yml');
24+
$this->_exec('cp -vf codeception.dist.yml codeception.yml');
25+
$this->_exec('cp -vf tests'. DIRECTORY_SEPARATOR .'functional.suite.dist.yml tests'. DIRECTORY_SEPARATOR .'functional.suite.yml');
2626
}
2727

2828
/**
@@ -34,7 +34,7 @@ function cloneFiles()
3434
function buildProject()
3535
{
3636
$this->cloneFiles();
37-
$this->_exec('./vendor/bin/codecept build');
37+
$this->_exec('vendor'. DIRECTORY_SEPARATOR .'bin'. DIRECTORY_SEPARATOR .'codecept build');
3838
}
3939

4040
/**
@@ -72,75 +72,45 @@ function generateSuite(array $args)
7272
}
7373

7474
/**
75-
* Run all Functional tests using the Chrome environment.
75+
* Run all Functional tests.
7676
*
7777
* @return void
7878
*/
79-
function chrome()
79+
function functional()
8080
{
81-
$this->_exec('./vendor/bin/codecept run functional --env chrome --skip-group skip');
81+
$this->_exec('.' . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . 'bin' . DIRECTORY_SEPARATOR . 'codecept run functional --skip-group skip');
8282
}
8383

8484
/**
85-
* Run all Functional tests using the FireFox environment.
86-
*
87-
* @return void
88-
*/
89-
function firefox()
90-
{
91-
$this->_exec('./vendor/bin/codecept run functional --env firefox --skip-group skip');
92-
}
93-
94-
/**
95-
* Run all Functional tests using the PhantomJS environment.
96-
*
97-
* @return void
98-
*/
99-
function phantomjs()
100-
{
101-
$this->_exec('./vendor/bin/codecept run functional --env phantomjs --skip-group skip');
102-
}
103-
104-
/**
105-
* Run all Functional tests using the Chrome Headless environment.
106-
*
107-
* @return void
108-
*/
109-
function headless()
110-
{
111-
$this->_exec('./vendor/bin/codecept run functional --env headless --skip-group skip');
112-
}
113-
114-
/**
115-
* Run all Tests with the specified @group tag, excluding @group 'skip', using the Chrome environment.
85+
* Run all Tests with the specified @group tag, excluding @group 'skip'.
11686
*
11787
* @param string $args
11888
* @return void
11989
*/
12090
function group($args = '')
12191
{
122-
$this->taskExec('./vendor/bin/codecept run functional --verbose --steps --env chrome --skip-group skip --group')->args($args)->run();
92+
$this->taskExec('.' . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . 'bin' . DIRECTORY_SEPARATOR . 'codecept run functional --verbose --steps --skip-group skip --group')->args($args)->run();
12393
}
12494

12595
/**
126-
* Run all Functional tests located under the Directory Path provided using the Chrome environment.
96+
* Run all Functional tests located under the Directory Path provided.
12797
*
12898
* @param string $args
12999
* @return void
130100
*/
131101
function folder($args = '')
132102
{
133-
$this->taskExec('./vendor/bin/codecept run functional --env chrome')->args($args)->run();
103+
$this->taskExec('.' . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . 'bin' . DIRECTORY_SEPARATOR . 'codecept run functional')->args($args)->run();
134104
}
135105

136106
/**
137-
* Run all Tests marked with the @group tag 'example', using the Chrome environment.
107+
* Run all Tests marked with the @group tag 'example'.
138108
*
139109
* @return void
140110
*/
141111
function example()
142112
{
143-
$this->_exec('./vendor/bin/codecept run --env chrome --group example --skip-group skip');
113+
$this->_exec('.' . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . 'bin' . DIRECTORY_SEPARATOR . 'codecept run --group example --skip-group skip');
144114
}
145115

146116
/**
@@ -150,7 +120,7 @@ function example()
150120
*/
151121
function allure1Generate()
152122
{
153-
return $this->_exec('allure generate tests/_output/allure-results/ -o tests/_output/allure-report/');
123+
return $this->_exec('allure generate tests'. DIRECTORY_SEPARATOR .'_output'. DIRECTORY_SEPARATOR .'allure-results'. DIRECTORY_SEPARATOR .' -o tests'. DIRECTORY_SEPARATOR .'_output'. DIRECTORY_SEPARATOR .'allure-report'. DIRECTORY_SEPARATOR .'');
154124
}
155125

156126
/**
@@ -160,7 +130,7 @@ function allure1Generate()
160130
*/
161131
function allure2Generate()
162132
{
163-
return $this->_exec('allure generate tests/_output/allure-results/ --output tests/_output/allure-report/ --clean');
133+
return $this->_exec('allure generate tests'. DIRECTORY_SEPARATOR .'_output'. DIRECTORY_SEPARATOR .'allure-results'. DIRECTORY_SEPARATOR .' --output tests'. DIRECTORY_SEPARATOR .'_output'. DIRECTORY_SEPARATOR .'allure-report'. DIRECTORY_SEPARATOR .' --clean');
164134
}
165135

166136
/**
@@ -170,7 +140,7 @@ function allure2Generate()
170140
*/
171141
function allure1Open()
172142
{
173-
$this->_exec('allure report open --report-dir tests/_output/allure-report/');
143+
$this->_exec('allure report open --report-dir tests'. DIRECTORY_SEPARATOR .'_output'. DIRECTORY_SEPARATOR .'allure-report'. DIRECTORY_SEPARATOR .'');
174144
}
175145

176146
/**
@@ -180,7 +150,7 @@ function allure1Open()
180150
*/
181151
function allure2Open()
182152
{
183-
$this->_exec('allure open --port 0 tests/_output/allure-report/');
153+
$this->_exec('allure open --port 0 tests'. DIRECTORY_SEPARATOR .'_output'. DIRECTORY_SEPARATOR .'allure-report'. DIRECTORY_SEPARATOR .'');
184154
}
185155

186156
/**

dev/tests/acceptance/composer.json

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"name": "magento/magento2ce-functional-tests",
3+
"description": "Magento 2 (Open Source) Functional Tests",
4+
"type": "project",
5+
"version": "1.0.0-dev",
6+
"license": [
7+
"OSL-3.0",
8+
"AFL-3.0"
9+
],
10+
"config": {
11+
"sort-packages": true
12+
},
13+
"repositories": [
14+
{
15+
"type": "git",
16+
"url": "[email protected]:magento/magento2-functional-testing-framework.git"
17+
}
18+
],
19+
"require": {
20+
"allure-framework/allure-codeception": "dev-master#af40af5ae2b717618a42fe3e137d75878508c75d",
21+
"codeception/codeception": "~2.3.4",
22+
"consolidation/robo": "^1.0.0",
23+
"symfony/process": ">=2.7 <3.4",
24+
"henrikbjorn/lurker": "^1.2",
25+
"magento/magento2-functional-testing-framework": "1.0.0",
26+
"php": "7.0.2|7.0.4|~7.0.6|~7.1.0",
27+
"vlucas/phpdotenv": "~2.4"
28+
},
29+
"autoload": {
30+
"psr-4": {
31+
"Magento\\": "tests/functional/Magento"
32+
}
33+
},
34+
"prefer-stable": true
35+
}

dev/tests/acceptance/tests/_bootstrap.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,9 @@
2222
}
2323
}
2424
defined('FW_BP') || define('FW_BP', PROJECT_ROOT . $RELATIVE_FW_PATH);
25+
26+
// add the debug flag here
27+
$debug_mode = $_ENV['MFTF_DEBUG'] ?? false;
28+
if (!(bool)$debug_mode && extension_loaded('xdebug')) {
29+
xdebug_disable();
30+
}

dev/tests/acceptance/tests/_suite/sampleSuite.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@
99
<suites xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Suite/etc/suiteSchema.xsd">
1010
<suite name="mySuite">
1111
<before>
12-
<createData entity="_defaultCategory" mergeKey="createCategory"/>
13-
<createData entity="_defaultProduct" mergeKey="createProduct">
12+
<createData entity="_defaultCategory" stepKey="createCategory"/>
13+
<createData entity="_defaultProduct" stepKey="createProduct">
1414
<required-entity createDataKey="createCategory"/>
1515
</createData>
1616
</before>
1717
<after>
18-
<deleteData mergeKey="deleteMyProduct" createDataKey="createProduct"/>
19-
<deleteData mergeKey="deleteMyCategory" createDataKey="createCategory"/>
18+
<deleteData stepKey="deleteMyProduct" createDataKey="createProduct"/>
19+
<deleteData stepKey="deleteMyCategory" createDataKey="createCategory"/>
2020
</after>
2121
<include>
2222
<group name="example"/>

dev/tests/acceptance/tests/functional.suite.dist.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,11 @@ modules:
3131
username: "%MAGENTO_ADMIN_USERNAME%"
3232
password: "%MAGENTO_ADMIN_PASSWORD%"
3333
pageload_timeout: 30
34+
host: %SELENIUM_HOST%
35+
port: %SELENIUM_PORT%
36+
protocol: %SELENIUM_PROTOCOL%
37+
path: %SELENIUM_PATH%
38+
capabilities:
39+
chromeOptions:
40+
args: ["--start-maximized", "--disable-extensions", "--enable-automation"]
41+
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
# Magento 2 Acceptance Tests
1+
# Magento 2 Functional Tests
22

3-
The Acceptance Tests Module for **Magento_AdminNotification** Module.
3+
The Functional Tests Module for **Magento_AdminNotification** Module.

0 commit comments

Comments
 (0)