Skip to content
This repository was archived by the owner on Dec 19, 2019. It is now read-only.

Commit e0e5a93

Browse files
authored
Merge pull request #1560 from magento-pangolin/MQE-420
[Pangolin] Deliver changes after MFTF training feedback - MQE-369: [Data Input] Non Web Api Data Persistence. - MQE-378: Create API metadata for Coupon Code - MQE-309: [Customizability] Update nested API dependency schema and execution - MQE-365: Template Files - MQE-411: Fixed template and coupon meta data files. - MQE-402: Workshop Feedback - MQE-352: Review and Update SampleCest.xml for added functionality - MQE-419: README.MD should not reference the magento-pangolin org - MQE-424: Fix static code issues in MFTF tests and MFTF
2 parents 55e9a5c + 61ebc05 commit e0e5a93

File tree

78 files changed

+780
-368
lines changed

Some content is hidden

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

78 files changed

+780
-368
lines changed

dev/tests/acceptance/README.md

Lines changed: 58 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,20 @@
88
----
99

1010
# Prerequisites
11-
* **IMPORTANT**: Configure your Magento Store for [Automated Testing](http://devdocs.magento.com/guides/v2.0/mtf/mtf_quickstart/mtf_quickstart_magento.html)
11+
* **IMPORTANT**
12+
* You will need to have a running instance of Magento that you can access.
13+
* You will need to configure your instance of Magento for [Automated Testing](http://devdocs.magento.com/guides/v2.0/mtf/mtf_quickstart/mtf_quickstart_magento.html).
1214
* [PHP v7.x](http://php.net/manual/en/install.php)
1315
* [Composer v1.4.x](https://getcomposer.org/download/)
14-
* [Java](https://www.java.com/en/download/)
16+
* [Java v1.8.x](https://www.java.com/en/download/)
1517
* [Selenium Server](http://www.seleniumhq.org/download/) - [v2.53.x](http://selenium-release.storage.googleapis.com/index.html?path=2.53/)
16-
* [ChromeDriver](https://sites.google.com/a/chromium.org/chromedriver/downloads)
17-
* [Allure CLI](https://docs.qameta.io/allure/latest/#_installing_a_commandline)
18+
* [ChromeDriver v2.32.x](https://sites.google.com/a/chromium.org/chromedriver/downloads)
19+
* [Allure CLI v2.3.x](https://docs.qameta.io/allure/latest/#_installing_a_commandline)
1820
* [GitHub](https://desktop.github.com/)
1921

2022
### Recommendations
2123
* We recommend using [PHPStorm 2017](https://www.jetbrains.com/phpstorm/) for your IDE. They recently added support for [Codeception Test execution](https://blog.jetbrains.com/phpstorm/2017/03/codeception-support-comes-to-phpstorm-2017-1/) which is helpful when debugging.
22-
* We also recommend updating your [$PATH to include](https://stackoverflow.com/questions/7703041/editing-path-variable-on-mac) `./vendor/bin` so you can easily execute the necessary `robo` and `codecept` commands instead of `./vendor/bin/robo` or `./vendor/bin/codecept`.
24+
* We also recommend updating your [$PATH to include](https://stackoverflow.com/questions/7703041/editing-path-variable-on-mac) `./vendor/bin` so you can easily execute the necessary `robo` and `codecept` commands instead of using `./vendor/bin/robo` or `./vendor/bin/codecept`.
2325

2426
----
2527

@@ -28,19 +30,29 @@ Due to the current setup of the Framework you will need to do the following:
2830

2931
* `mkdir [DIRECTORY_NAME]`
3032
* `cd [DIRECTORY_NAME]`
31-
* Pull down - [EE](https://github.com/magento-pangolin/magento2ee)
32-
* Pull down - [CE](https://github.com/magento-pangolin/magento2ce)
33+
* Pull down - [EE](https://github.com/magento/magento2ee)
34+
* Pull down - [CE](https://github.com/magento/magento2ce)
3335
* `cd magento2ee`
3436
* `php -f dev/tools/build-ee.php -- --command=link --exclude=true`
35-
* Generate a `github-oauth` token: [Instructions](https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/#creating-a-token)
37+
* `cd ..`
38+
* Generate a `github-oauth` token:
39+
* [How to setup an auth.json file for the Composer?](https://mage2.pro/t/topic/743)
40+
* [Creating a personal access token for the command line.](https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/#creating-a-token)
3641
* `touch magento2ce/dev/tests/acceptance/auth.json`
3742
* `nano magento2ce/dev/tests/acceptance/auth.json`
43+
* Copy/Paste the following:
44+
```
45+
{
46+
"github-oauth": {
47+
"github.com": "<personal access token>"
48+
}
49+
}
50+
```
3851
* Replace `<personal access token>` with the token you generated in GitHub.
3952
* Save your work.
40-
* `cd ../magento2ce`
41-
* `cd dev/tests/acceptance`
53+
* `cd magento2ce/dev/tests/acceptance`
4254
* `composer install`
43-
* **PLEASE IGNORE THE "Installation" SECTION THAT FOLLOWS, START WITH THE "Building The Framework" SECTION INSTEAD.**
55+
* **PLEASE IGNORE THE "Installation" SECTION THAT FOLLOWS, START WITH THE "Building The Framework" SECTION INSTEAD.**
4456
4557
----
4658
@@ -116,7 +128,7 @@ To determine which version of the Allure command you need to use please run `all
116128
----
117129
118130
# Building The Framework
119-
After installing the dependencies you will want to build the Codeception project in the [Magento 2 Functional Testing Framework](https://github.com/magento-pangolin/magento2-functional-testing-framework), which is a dependency of the CE or EE Tests repo. Run `./vendor/bin/robo build:project` to complete this task.
131+
After installing the dependencies you will want to build the Codeception project in the [Magento 2 Functional Testing Framework](https://github.com/magento/magento2-functional-testing-framework), which is a dependency of the CE or EE Tests repo. Run the following to complete this task:
120132
121133
`./vendor/bin/robo build:project`
122134
@@ -127,9 +139,15 @@ Before you can generate or run the Tests you will need to edit the Configuration
127139
128140
In the `.env` file you will find key pieces of information that are unique to your local Magento setup that will need to be edited before you can generate tests:
129141
* **MAGENTO_BASE_URL**
142+
* Example: `MAGENTO_BASE_URL=http://127.0.0.1:32772/`
143+
* Note: Please end the URL with a `/`.
130144
* **MAGENTO_BACKEND_NAME**
145+
* Example: `MAGENTO_BACKEND_NAME=admin`
146+
* Note: Set this variable to `admin`.
131147
* **MAGENTO_ADMIN_USERNAME**
148+
* Example: `MAGENTO_ADMIN_USERNAME=admin`
132149
* **MAGENTO_ADMIN_PASSWORD**
150+
* Example: `MAGENTO_ADMIN_PASSWORD=123123`
133151
134152
##### Additional Codeception settings can be found in the following files:
135153
* **tests/functional.suite.yml**
@@ -222,25 +240,31 @@ Due to the interdependent nature of the 2 repos it is recommended to Symlink the
222240
`sudo nano /etc/paths`
223241
224242
* StackOverflow Help: https://stackoverflow.com/questions/7703041/editing-path-variable-on-mac
225-
* Allure `@env error` - Allure recently changed their Codeception Adapter that breaks Codeception when tests include the `@env` tag. A workaround for this error is to revert the changes they made to a function.
226-
* Locate the `AllureAdapter.php` file here: `vendor/allure-framework/allure-codeception/src/Yandex/Allure/Adapter/AllureAdapter.php`
227-
* Edit the `_initialize()` function found on line 77 and replace it with the following:
228-
```
229-
public function _initialize(array $ignoredAnnotations = [])
230-
{
231-
parent::_initialize();
232-
Annotation\AnnotationProvider::registerAnnotationNamespaces();
233-
// Add standard PHPUnit annotations
234-
Annotation\AnnotationProvider::addIgnoredAnnotations($this->ignoredAnnotations);
235-
// Add custom ignored annotations
236-
$ignoredAnnotations = $this->tryGetOption('ignoredAnnotations', []);
237-
Annotation\AnnotationProvider::addIgnoredAnnotations($ignoredAnnotations);
238-
$outputDirectory = $this->getOutputDirectory();
239-
$deletePreviousResults =
240-
$this->tryGetOption(DELETE_PREVIOUS_RESULTS_PARAMETER, false);
241-
$this->prepareOutputDirectory($outputDirectory, $deletePreviousResults);
242-
if (is_null(Model\Provider::getOutputDirectory())) {
243-
Model\Provider::setOutputDirectory($outputDirectory);
244-
}
245-
}
246-
```
243+
* Allure `@env error` - Allure recently changed their Codeception Adapter that breaks Codeception when tests include the `@env` tag. There are 2 workarounds for this issue currently.
244+
1. You can edit the `composer.json` and point the Allure-Codeception Adapter to a previous commit:
245+
* Edit the `composer.json` file.
246+
* Make the following change:
247+
* ORIGINAL: `“allure-framework/allure-codeception”: "dev-master"`
248+
* UPDATED: `“allure-framework/allure-codeception”: “dev-master#af40af5ae2b717618a42fe3e137d75878508c75d”`
249+
1. You can revert the changes that they made manually:
250+
* Locate the `AllureAdapter.php` file here: `vendor/allure-framework/allure-codeception/src/Yandex/Allure/Adapter/AllureAdapter.php`
251+
* Edit the `_initialize()` function found on line 77 and replace it with the following:
252+
```
253+
public function _initialize(array $ignoredAnnotations = [])
254+
{
255+
parent::_initialize();
256+
Annotation\AnnotationProvider::registerAnnotationNamespaces();
257+
// Add standard PHPUnit annotations
258+
Annotation\AnnotationProvider::addIgnoredAnnotations($this->ignoredAnnotations);
259+
// Add custom ignored annotations
260+
$ignoredAnnotations = $this->tryGetOption('ignoredAnnotations', []);
261+
Annotation\AnnotationProvider::addIgnoredAnnotations($ignoredAnnotations);
262+
$outputDirectory = $this->getOutputDirectory();
263+
$deletePreviousResults =
264+
$this->tryGetOption(DELETE_PREVIOUS_RESULTS_PARAMETER, false);
265+
$this->prepareOutputDirectory($outputDirectory, $deletePreviousResults);
266+
if (is_null(Model\Provider::getOutputDirectory())) {
267+
Model\Provider::setOutputDirectory($outputDirectory);
268+
}
269+
}
270+
```
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,16 @@
88

99
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/DataGenerator/etc/dataProfileSchema.xsd">
11+
<entity name="CustomAttributeCategoryUrlKey" type="custom_attribute">
12+
<data key="attribute_code">url_key</data>
13+
<data key="value" unique="suffix">category</data>
14+
</entity>
1115
<entity name="CustomAttributeProductUrlKey" type="custom_attribute">
1216
<data key="attribute_code">url_key</data>
1317
<data key="value" unique="suffix">product</data>
1418
</entity>
19+
<entity name="CustomAttributeCategoryIds" type="custom_attribute_array">
20+
<data key="attribute_code">category_ids</data>
21+
<var key="value" entityType="category" entityKey="id"/>
22+
</entity>
1523
</config>

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Data/ProductData.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
<data key="status">1</data>
2020
<data key="quantity">100</data>
2121
<required-entity type="product_extension_attribute">EavStockItem</required-entity>
22+
<required-entity type="custom_attribute_array">CustomAttributeCategoryIds</required-entity>
2223
</entity>
2324
<entity name="SimpleProduct" type="product">
2425
<data key="sku" unique="suffix">SimpleProduct</data>
@@ -29,6 +30,7 @@
2930
<data key="visibility">4</data>
3031
<data key="status">1</data>
3132
<required-entity type="product_extension_attribute">EavStockItem</required-entity>
33+
<required-entity type="custom_attribute_array">CustomAttributeCategoryIds</required-entity>
3234
<!--required-entity type="custom_attribute">CustomAttributeProductUrlKey</required-entity-->
3335
</entity>
3436
</config>

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Metadata/category-meta.xml

Lines changed: 33 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -5,58 +5,57 @@
55
* See COPYING.txt for license details.
66
*/
77
-->
8-
98
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
109
xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/DataGenerator/etc/dataOperation.xsd">
11-
<operation name="CreateCategory" dataType="category" type="create" auth="/rest/V1/integration/admin/token" url="/rest/V1/categories" method="POST">
12-
<header param="Content-Type">application/json</header>
13-
<jsonObject key="category" dataType="category">
14-
<entry key="parent_id">integer</entry>
15-
<entry key="name">string</entry>
16-
<entry key="is_active">boolean</entry>
17-
<entry key="position">integer</entry>
18-
<entry key="level">integer</entry>
19-
<entry key="children">string</entry>
20-
<entry key="created_at">string</entry>
21-
<entry key="updated_at">string</entry>
22-
<entry key="path">string</entry>
23-
<entry key="include_in_menu">boolean</entry>
10+
<operation name="CreateCategory" dataType="category" type="create" auth="adminOauth" url="/V1/categories" method="POST">
11+
<contentType>application/json</contentType>
12+
<object key="category" dataType="category">
13+
<field key="parent_id">integer</field>
14+
<field key="name">string</field>
15+
<field key="is_active">boolean</field>
16+
<field key="position">integer</field>
17+
<field key="level">integer</field>
18+
<field key="children">string</field>
19+
<field key="created_at">string</field>
20+
<field key="updated_at">string</field>
21+
<field key="path">string</field>
22+
<field key="include_in_menu">boolean</field>
2423
<array key="available_sort_by">
2524
<value>string</value>
2625
</array>
27-
<entry key="extension_attributes">empty_extension_attribute</entry>
26+
<field key="extension_attributes">empty_extension_attribute</field>
2827
<array key="custom_attributes">
2928
<value>custom_attribute</value>
3029
</array>
31-
</jsonObject>
30+
</object>
3231
</operation>
3332

34-
<operation name="UpdateCategory" dataType="category" type="update" auth="/rest/V1/integration/admin/token" url="/rest/V1/categories" method="PUT">
35-
<header param="Content-Type">application/json</header>
36-
<jsonObject key="category" dataType="category">
37-
<entry key="id">integer</entry>
38-
<entry key="parent_id">integer</entry>
39-
<entry key="name">string</entry>
40-
<entry key="is_active">boolean</entry>
41-
<entry key="position">integer</entry>
42-
<entry key="level">integer</entry>
43-
<entry key="children">string</entry>
44-
<entry key="created_at">string</entry>
45-
<entry key="updated_at">string</entry>
46-
<entry key="path">string</entry>
33+
<operation name="UpdateCategory" dataType="category" type="update" auth="adminOauth" url="/V1/categories" method="PUT">
34+
<contentType>application/json</contentType>
35+
<object key="category" dataType="category">
36+
<field key="id">integer</field>
37+
<field key="parent_id">integer</field>
38+
<field key="name">string</field>
39+
<field key="is_active">boolean</field>
40+
<field key="position">integer</field>
41+
<field key="level">integer</field>
42+
<field key="children">string</field>
43+
<field key="created_at">string</field>
44+
<field key="updated_at">string</field>
45+
<field key="path">string</field>
4746
<array key="available_sort_by">
4847
<value>string</value>
4948
</array>
50-
<entry key="include_in_menu">boolean</entry>
51-
<entry key="extension_attributes">empty_extension_attribute</entry>
49+
<field key="include_in_menu">boolean</field>
50+
<field key="extension_attributes">empty_extension_attribute</field>
5251
<array key="custom_attributes">
5352
<value>custom_attribute</value>
5453
</array>
55-
</jsonObject>
54+
</object>
5655
</operation>
5756

58-
<operation name="DeleteCategory" dataType="category" type="delete" auth="/rest/V1/integration/admin/token" url="/rest/V1/categories" method="DELETE">
59-
<header param="Content-Type">application/json</header>
57+
<operation name="DeleteCategory" dataType="category" type="delete" auth="adminOauth" url="/V1/categories" method="DELETE">
58+
<contentType>application/json</contentType>
6059
<param key="categoryId" type="path">{id}</param>
6160
</operation>
6261
</config>

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Metadata/custom_attribute-meta.xml

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)