Skip to content

Commit b889251

Browse files
authored
Merge pull request #759 from magento/MQE-2221
Mqe 2221: Merge master back into develop
2 parents f630b5d + d8b1111 commit b889251

15 files changed

+329
-74
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,12 @@ Magento Functional Testing Framework Changelog
8888
* [MFTF 3.0.0 RC2](https://www.youtube.com/watch?v=BJOQAw6dX5o)
8989
* [MFTF 3.0.0 RC3](https://www.youtube.com/watch?v=scLb7pi8pR0)
9090

91+
2.6.4
92+
-----
93+
94+
### Fixes
95+
* added dependency to packages MFTF used but never specified in composer.json
96+
9197
2.6.3
9298
-----
9399

_config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
theme: jekyll-theme-hacker

bin/mftf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ try {
3131
$version = $version['version'];
3232
$application = new Symfony\Component\Console\Application();
3333
$application->setName('Magento Functional Testing Framework CLI');
34-
$application->setVersion('3.0.0');
34+
$application->setVersion($version);
3535
/** @var \Magento\FunctionalTestingFramework\Console\CommandListInterface $commandList */
3636
$commandList = new \Magento\FunctionalTestingFramework\Console\CommandList;
3737
foreach ($commandList->getCommands() as $command) {

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "magento/magento2-functional-testing-framework",
33
"description": "Magento2 Functional Testing Framework",
44
"type": "library",
5-
"version": "3.0.0-RC5",
5+
"version": "3.0.0",
66
"license": "AGPL-3.0",
77
"keywords": ["magento", "automation", "functional", "testing"],
88
"config": {
@@ -30,6 +30,7 @@
3030
"spomky-labs/otphp": "^10.0",
3131
"symfony/console": "^4.4",
3232
"symfony/finder": "^5.0",
33+
"symfony/http-foundation": "^5.0",
3334
"symfony/mime": "^5.0",
3435
"symfony/process": "^4.4",
3536
"vlucas/phpdotenv": "^2.4",

composer.lock

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

docs/backward-incompatible-changes.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ We removed support to read test modules from the deprecated path `dev/tests/acce
1515
- Files under test modules `ActionGroup`, `Page`, `Section`, `Test` and `Suite` only support a single entity per file.
1616
- The `file` attribute from `<module>` has been removed from the suite schema. `<module file=""/>` is no longer supported in suites.
1717
- Metadata filename format changed to ***`*Meta.xml`***.
18-
- Only nested assertion syntax will be supported. See the [assertions page](./docs/test/assertions.md) for details. Here is an example of the nested assertion syntax:
18+
- Only nested assertion syntax will be supported. See the [assertions page](test/assertions.md) for details. Here is an example of the nested assertion syntax:
1919
```xml
2020
<assertEquals stepKey="assertAddressOrderPage">
2121
<actualResult type="const">$billingAddressOrderPage</actualResult>
@@ -40,7 +40,7 @@ To run the upgrade tests:
4040

4141
1. Run `bin/mftf reset --hard` to remove old generated configurations.
4242
1. Run `bin/mftf build:project` to generate new configurations.
43-
1. Run `bin/mftf upgrade:tests`. [See command page for details](./docs/commands/mftf.md#upgradetests).
43+
1. Run `bin/mftf upgrade:tests`. [See command page for details](commands/mftf.md#upgradetests).
4444
1. Lastly, try to generate all tests. Tests should all be generated as a result of the upgrades. If not, the most likely issue will be a changed XML schema. Check error messaging and search your codebase for the attributes listed.
4545

4646
## MFTF commands
@@ -57,7 +57,7 @@ To run the upgrade tests:
5757

5858
**Details**:
5959

60-
The `helper` allows test writers to solve advanced requirements beyond what MFTF offers out of the box. See [custom-helpers](./docs/custom-helpers.md) for more information on usage.
60+
The `helper` allows test writers to solve advanced requirements beyond what MFTF offers out of the box. See [custom-helpers](custom-helpers.md) for more information on usage.
6161

6262
Here is an example of using `helper` in place of `executeSelenium` to achieve same workflow.
6363

@@ -95,7 +95,7 @@ New usage:
9595

9696
**Details**:
9797

98-
See the [actions page for details](./docs/test/actions.md#pause). Here is a usage example:
98+
See the [actions page for details](test/actions.md#pause). Here is a usage example:
9999

100100
```xml
101101
<pause stepKey="pauseExecutionKey"/>

docs/best-practices.md

Lines changed: 53 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,49 @@
22

33
Check out our best practices below to ensure you are getting the absolute most out of the Magento Functional Testing Framework.
44

5+
## Focus on reusability
6+
7+
### Use existing Tests and resources
8+
9+
Magento offers more than **3000** acceptance tests, **2500** [Action group]s, **750** Page declarations with more than **1500** Section definitions.
10+
It is very probable that behaviour you want to test already exists as a Test or Action Group.
11+
Instead of writing everything by yourself - use `extends` attribute to refer to existing element and customize it.
12+
13+
**Reusable Resources**
14+
15+
{%raw%}
16+
17+
* Tests (reusable with `<test extends="...">` argument)
18+
* Action Group (reusable with including `<actionGroup ref="...">`, or extending `<actionGroup extends="...">`)
19+
* Pages (reusable with reference `{{PageDefinition.url}}`)
20+
* Sections (reusable with reference `{{SectionDefinition.elementDefinition}}`)
21+
* Data Entities (reusable with reference `<createData entity="...">"` or extending `<entity extends="...">`)
22+
23+
{%endraw%}
24+
25+
<div class="bs-callout bs-callout-warning" markdown="1">
26+
27+
Avoid using resources that are marked as **Deprecated**. Usually there is a replacement provided for a deprecated resource.
28+
29+
</div>
30+
31+
### Extract repetitive Actions
32+
33+
Instead of writing a few of Tests that perform mostly the same actions, you should thing about [Action group] that is a container for repetitive Actions.
34+
If each run needs different data, use `<arguments>` to inject necessary information.
35+
36+
We recommend to keep Action Groups having single responsibility, for example `AdminLoginActionGroup`, which expected outcome is being logged in as Administrator when [Action group] is executed.
37+
38+
## Contribute
39+
40+
Althought the Magento Core team and Contributors join forces to cover most of the features with tests, it is impossible to have this done quickly.
41+
If you've covered Magento Core feature with Functional Tests - you are more than welcome to contribute.
42+
43+
You can also help with MFTF Test Migration to get the experience and valuable feedback from other community members and maintainers.
44+
545
## Action group
646

7-
1. [Action group] names should be sufficiently descriptive to inform a test writer of what the action group does and when it should be used.
8-
Add additional explanation in annotations if needed.
47+
1. [Action group] names should be sufficiently descriptive to inform a test writer of what the action group does and when it should be used. Add additional explanation in annotations if needed.
948
2. Provide default values for the arguments that apply to your most common case scenarios.
1049
3. One `<actionGroup>` tag is allowed per action group XML file.
1150

@@ -95,20 +134,20 @@ Use the _Foo.camelCase_ naming convention, which is similar to _Classes_ and _cl
95134

96135
Use an upper case first letter for:
97136

98-
- File names. Example: _StorefrontCreateCustomerTest.xml_
99-
- Test name attributes. Example: `<test name="TestAllTheThingsTest">`
100-
- Data entity names. Example: `<entity name="OutOfStockProduct">`
101-
- Page name. Example: `<page name="AdminLoginPage">`
102-
- Section name. Example: `<section name="AdminCategorySidebarActionSection">`
103-
- Action group name. Example: `<actionGroup name="LoginToAdminActionGroup">`
137+
* File names. Example: _StorefrontCreateCustomerTest.xml_
138+
* Test name attributes. Example: `<test name="TestAllTheThingsTest">`
139+
* Data entity names. Example: `<entity name="OutOfStockProduct">`
140+
* Page name. Example: `<page name="AdminLoginPage">`
141+
* Section name. Example: `<section name="AdminCategorySidebarActionSection">`
142+
* Action group name. Example: `<actionGroup name="LoginToAdminActionGroup">`
104143

105144
#### Lower case
106145

107146
Use a lower case first letter for:
108147

109-
- Data keys. Example: `<data key="firstName">`
110-
- Element names. Examples: `<element name="confirmDeleteButton"/>`
111-
- Step keys. For example: `<click selector="..." stepKey="clickLogin"/>`
148+
* Data keys. Example: `<data key="firstName">`
149+
* Element names. Examples: `<element name="confirmDeleteButton"/>`
150+
* Step keys. For example: `<click selector="..." stepKey="clickLogin"/>`
112151

113152
## Page object
114153

@@ -147,9 +186,9 @@ Define these three elements and reference them by name in the tests.
147186
1. Keep your tests short and granular for target testing, easier reviews, and easier merge conflict resolution.
148187
It also helps you to identify the cause of test failure.
149188
1. Use comments to keep tests readable and maintainable:
150-
- Keep the inline `<!-- XML comments -->` and [`<comment>`] tags up to date.
189+
* Keep the inline `<!-- XML comments -->` and [`<comment>`] tags up to date.
151190
It helps to inform the reader of what you are testing and to yield a more descriptive Allure report.
152-
- Explain in comments unclear or tricky test steps.
191+
* Explain in comments unclear or tricky test steps.
153192
1. Refer to [sections] instead of writing selectors.
154193
1. One `<test>` tag is allowed per test XML file.
155194

@@ -178,3 +217,4 @@ Since the configurable product module could be disabled, this approach is more r
178217
[merging]: merging.html
179218
[parameterized selectors]: section/parameterized-selectors.html
180219
[sections]: section.html
220+
[MFTF Test Migration]: https://github.com/magento/magento-functional-tests-migration

docs/commands/mftf.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ vendor/bin/mftf generate:tests [option] [<test name>] [<test name>] [--remove]
151151
| Option | Description|
152152
| ---| --- |
153153
| `--config=[<default> or <singleRun> or <parallel>]` | Creates a single manifest file with a list of all tests. The default location is `tests/functional/Magento/FunctionalTest/_generated/testManifest.txt`.<br/> You can split the list into multiple groups using `--config=parallel`; the groups will be generated in `_generated/groups/` like `_generated/groups/group1.txt, group2.txt, ...`.<br/> Available values: `default` (default), `singleRun`(same as `default`), and `parallel`.<br/> Example: `generate:tests --config=parallel`. |
154-
| `--filter` | Option to filter tests to be generated.<br/>Template: '<filterName>:<filterValue>'.<br/>Existing filter types: severity.<br/>Existing severity values: BLOCKER, CRITICAL, MAJOR, AVERAGE, MINOR.<br/>Example: --filter=severity:CRITICAL|
154+
| `--filter` | Option to filter tests to be generated.<br/>Template: '&lt;filterName&gt;:&lt;filterValue&gt;'.<br/>Existing filter types: severity.<br/>Existing severity values: BLOCKER, CRITICAL, MAJOR, AVERAGE, MINOR.<br/>Example: --filter=severity:CRITICAL|
155155
| `--force` | Forces test generation, regardless of the module merge order defined in the Magento instance. Example: `generate:tests --force`. |
156156
| `-i,--time` | Set time in minutes to determine the group size when `--config=parallel` is used. The __default value__ is `10`. Example: `generate:tests --config=parallel --time=15`|
157157
| `--tests` | Defines the test configuration as a JSON string.|

0 commit comments

Comments
 (0)