Skip to content

Commit bf45681

Browse files
committed
Merge remote-tracking branch 'origin/develop' into MQE-1581
2 parents 3eadcc1 + 264aaea commit bf45681

File tree

14 files changed

+143
-58
lines changed

14 files changed

+143
-58
lines changed

.travis.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
language: php
22
php:
3-
- 7.0
4-
- 7.1
53
- 7.2
64
- 7.3
75
install: composer install --no-interaction --prefer-source

composer.json

Lines changed: 2 additions & 2 deletions
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.6.3",
5+
"version": "3.0.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||~7.3.0",
12+
"php": "~7.2.0||~7.3.0",
1313
"ext-curl": "*",
1414
"ext-json": "*",
1515
"ext-openssl": "*",

composer.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dev/tests/functional/standalone_bootstrap.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
$env->setEnvironmentVariable('DEFAULT_TIMEZONE', DEFAULT_TIMEZONE);
5252

5353
defined('WAIT_TIMEOUT') || define('WAIT_TIMEOUT', 30);
54-
$env->setEnvironmentVariable('WAIT_TIMEOUT', 30);
54+
$env->setEnvironmentVariable('WAIT_TIMEOUT', WAIT_TIMEOUT);
5555

5656
try {
5757
new DateTimeZone(DEFAULT_TIMEZONE);

dev/tests/unit/Magento/FunctionalTestFramework/Util/ModuleResolverTest.php

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -146,20 +146,6 @@ function ($arg) {
146146
'Test' . DIRECTORY_SEPARATOR .'Mftf'
147147
]
148148
);
149-
$mockResolver->verifyInvoked(
150-
'globRelevantPaths',
151-
[
152-
$magentoBaseCodePath
153-
. DIRECTORY_SEPARATOR . "dev"
154-
. DIRECTORY_SEPARATOR . "tests"
155-
. DIRECTORY_SEPARATOR . "acceptance"
156-
. DIRECTORY_SEPARATOR . "tests"
157-
. DIRECTORY_SEPARATOR . "functional"
158-
. DIRECTORY_SEPARATOR . "Magento"
159-
. DIRECTORY_SEPARATOR . "FunctionalTest"
160-
, ''
161-
]
162-
);
163149
}
164150

165151
/**

docs/metadata.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ The following diagram demonstrates the XML structure of a metadata file:
6767
## Principles {#principles}
6868

6969
1. A `dataType` value must match the `type` value of the corresponding entity.
70-
2. A file name should contain data type split with `_` and must end with `-meta`.
71-
Example: `product_attribute-meta.xml`.
70+
2. A file name should be PascalCase and end with `Meta.xml`.
71+
Example: `ProductAttributeMeta.xml`.
7272
3. A metadata file may contain different types of operations (`type`) with the same data entity (`dataType`).
7373

7474
Example:
@@ -139,7 +139,7 @@ _Catalog/Data/CategoryData.xml_:
139139
Here, `type` is equal to `"category"`, which instructs the MFTF to search an operation with `dataType="category"`.
140140
Since the action is __to create__ a category, the MFTF will also search for operation with `type="create"` in _Metadata_ for `dataType="category"`.
141141

142-
_Catalog/Metadata/category-meta.xml_:
142+
_Catalog/Metadata/CategoryMeta.xml_:
143143

144144
```xml
145145
<operation name="CreateCategory" dataType="category" type="create" auth="adminOauth" url="/V1/categories" method="POST">
@@ -187,10 +187,10 @@ Comments in the example below are used to demonstrate relation between JSON requ
187187
JSON does not support comments.
188188
</div>
189189

190-
Model schema for _catalogCategoryRepositoryV1SavePostBody_ with XML representation of _Catalog/Metadata/category-meta.xml_ in comments:
190+
Model schema for _catalogCategoryRepositoryV1SavePostBody_ with XML representation of _Catalog/Metadata/CategoryMeta.xml_ in comments:
191191

192192
```json
193-
{ // XML representation in the MFTF metadata format (see 'Catalog/Metadata/category-meta.xml')
193+
{ // XML representation in the MFTF metadata format (see 'Catalog/Metadata/CategoryMeta.xml')
194194
"category": { // <object key="category" dataType="category">
195195
"id": 0, // Skipped, because Category ID is not available on UI when you create a new category.
196196
"parent_id": 0, // <field key="parent_id">integer</field>
@@ -206,9 +206,9 @@ Model schema for _catalogCategoryRepositoryV1SavePostBody_ with XML representati
206206
"string" // <value>string</value>
207207
], // </array>
208208
"include_in_menu": true, // <field key="include_in_menu">boolean</field>
209-
"extension_attributes": {}, // <field key="extension_attributes">empty_extension_attribute</field>, where 'empty_extension_attribute' is a reference to operation with 'dataType="empty_extension_attribute"' (see 'Catalog/Metadata/empty_extension_attribute-meta.xml')
209+
"extension_attributes": {}, // <field key="extension_attributes">empty_extension_attribute</field>, where 'empty_extension_attribute' is a reference to operation with 'dataType="empty_extension_attribute"' (see 'Catalog/Metadata/EmptyExtensionAttributeMeta.xml')
210210
"custom_attributes": [ // <array key="custom_attributes">
211-
{ // <value>custom_attribute</value>, where 'custom_attribute' is a reference to operation with 'dataType="custom_attribute"' (see 'Catalog/Metadata/custom_attribute-meta.xml')
211+
{ // <value>custom_attribute</value>, where 'custom_attribute' is a reference to operation with 'dataType="custom_attribute"' (see 'Catalog/Metadata/CustomAttributeMeta.xml')
212212
"attribute_code": "string",
213213
"value": "string"
214214
}
@@ -343,7 +343,7 @@ You are able to create assurances with `successRegex`, and, optionally, return v
343343

344344
The `CreateStoreGroup` operation is used to persist a store group:
345345

346-
Source file is _Store/Metadata/store_group-meta.xml_:
346+
Source file is _Store/Metadata/StoreGroupMeta.xml_:
347347

348348
```xml
349349
<operation name="CreateStoreGroup" dataType="group" type="create" auth="adminFormKey" url="/admin/system_store/save" method="POST" successRegex="/messages-message-success/" >
@@ -379,7 +379,7 @@ The operation enables you to assign the following form fields:
379379

380380
The MFTF uses the `CreateWishlist` operation to create a wish list on storefront:
381381

382-
Source file is _Wishlist/Metadata/wishlist-meta.xml_
382+
Source file is _Wishlist/Metadata/WishlistMeta.xml_
383383

384384
```xml
385385
<operation name="CreateWishlist" dataType="wishlist" type="create" auth="customerFormKey" url="/wishlist/index/add/" method="POST" successRegex="" returnRegex="~\/wishlist_id\/(\d*?)\/~" >

docs/mftf-tests-packaging.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
<style>
2+
.mftf-dl {
3+
margin-bottom: 2.5em;
4+
}
5+
dl dt{
6+
font-weight:400;
7+
}
8+
</style>
9+
10+
# MFTF functional test modules and packaging
11+
12+
## MFTF predefined test module paths
13+
The Magento Functional Testing Framework can run tests from predefined paths and custom paths. The predefined paths are:
14+
```
15+
app/code/<Vendor>/<Module>/Test/Mftf
16+
dev/tests/acceptance/tests/functional/<Vendor>/<TestModule>
17+
vendor/<Vendor>/<Module>/Test/Mftf
18+
vendor/<Vendor>/<TestModule>
19+
```
20+
21+
To support future service isolation, Test module in `dev/tests/acceptance/tests/functional/<Vendor>/<TestModule>` and
22+
`vendor/<Vendor>/<TestModule>` must define the module type as `magento2-functional-test-module` in its `composer.json` file.
23+
No `composer.json` file is required for tests in `app/code/<Vendor>/<Module>/Test/Mftf` and `vendor/<Vendor>/<Module>/Test/Mftf`
24+
as they are part of the Magento modules.
25+
26+
Test module for a specific Magento module can only be in one of the paths.
27+
28+
## Test module composer.json format
29+
30+
Test module `composer.json` file should use type `magento2-functional-test-module`.
31+
32+
Test module `composer.json` file should define Magento module dependencies in suggests block.
33+
MFTF will recognize the dependency if the suggest message of a module specifies `type` using `magento2-module` and `name`
34+
using module name registered with Magento.
35+
36+
Here is an example `composer.json` file for the test module `dev/tests/acceptance/tests/functional/Magento/ConfigurableProductCatalogSearch`:
37+
38+
```json
39+
{
40+
"name": "magento/module-configurable-product-catalog-search-functional-test",
41+
"description": "MFTF test module for Magento_ConfigurableProduct and Magento_CatalogSearch",
42+
"type": "magento2-functional-test-module",
43+
"config": {
44+
"sort-packages": true
45+
},
46+
"require": {
47+
"magento/magento2-functional-testing-framework": ">=2.5"
48+
},
49+
"suggest": {
50+
"magento/module-configurable-product": "type: magento2-module, name: Magento_ConfigurableProduct, version: *",
51+
"magento/module-catalog-search": "type: magento2-module, name: Magento_CatalogSearch, version: *"
52+
},
53+
"license": [
54+
"OSL-3.0",
55+
"AFL-3.0"
56+
]
57+
}
58+
```

etc/config/functional.suite.dist.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ modules:
2929
username: "%MAGENTO_ADMIN_USERNAME%"
3030
password: "%MAGENTO_ADMIN_PASSWORD%"
3131
pageload_timeout: "%WAIT_TIMEOUT%"
32+
request_timeout: "%WAIT_TIMEOUT%"
33+
connection_timeout: "%WAIT_TIMEOUT%"
3234
host: "%SELENIUM_HOST%"
3335
port: "%SELENIUM_PORT%"
3436
protocol: "%SELENIUM_PROTOCOL%"

etc/di.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@
198198
<argument name="mergeablePaths" xsi:type="array">
199199
<item name="/operations/operation/object" xsi:type="string"/>
200200
</argument>
201-
<argument name="fileName" xsi:type="string">*-meta.xml</argument>
201+
<argument name="fileName" xsi:type="string">*Meta.xml</argument>
202202
<argument name="defaultScope" xsi:type="string">Metadata</argument>
203203
</arguments>
204204
</virtualType>

src/Magento/FunctionalTestingFramework/DataGenerator/etc/dataOperation.xsd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,4 +109,4 @@
109109
<xs:enumeration value="DELETE" />
110110
</xs:restriction>
111111
</xs:simpleType>
112-
</xs:schema>
112+
</xs:schema>

0 commit comments

Comments
 (0)