You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Avoid using resources that are marked as **Deprecated**. Usually there is a replacement provided for a deprecated resource.
24
+
25
+
</div>
26
+
27
+
### Extract repetitive Actions
28
+
29
+
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.
30
+
If each run needs different data, use `<arguments>` to inject necessary information.
31
+
32
+
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.
33
+
34
+
## Contribute
35
+
36
+
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.
37
+
If you've covered Magento Core feature with Functional Tests - you are more than welcome to contribute.
38
+
39
+
You can also help with MFTF Test Migration to get the experience and valuable feedback from other community members and maintainers.
40
+
5
41
## Action group
6
42
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.
9
-
2. Provide default values for the arguments that apply to your most common case scenarios.
43
+
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.
44
+
1. Provide default values for the arguments that apply to your most common case scenarios.
10
45
11
46
## `actionGroups` vs `extends`
12
47
@@ -94,20 +129,20 @@ Use the _Foo.camelCase_ naming convention, which is similar to _Classes_ and _cl
We are actively developing functional tests. Check out the [MFTF Test Migration][] repository.
36
58
37
-
- Test user interactions with web applications in testing.
38
-
- Write functional tests located in `<magento_root>/app/code/<vendor_name>/<module_name>/Test/Mftf/`.
39
-
- Cover basic functionality using out-of-the-box tests. You can test extended functionality using custom tests.
40
-
- Automate regression testing.
59
+
</div>
41
60
42
61
## Use cases
43
62
44
-
As a Magento developer, test changes, such as extended search functionality, a new form attribute, or new product tags.
63
+
- Contributor: changes the core behaviour, fixing the annoing bug.
64
+
He wants to have automated "supervisor" which is going to verify his work continuously across the stages of bug fixing. Finally, when fix is done - Functional Test is also proof of work done.
65
+
- Extension Developer: offers extension that changes core behaviour.
66
+
He can easily write new tests to make sure that after enabling the feature, Magento behaves properly. Everything with just extending existing tests. As a result he don't need to write coverage from scratch.
They are able to customize tests delivered with Magento core to follow customizations implemented to Magento. After each upgrade they can just run the MFTF tests to know that no regression was introduced.
69
+
70
+
## MFTF output
45
71
46
-
As a software engineer, perform regression testing before release to ensure that Magento works as expected with new functionality.
72
+
- Generated PHP Codeception tests
73
+
- Codeception results and console logs
74
+
- Screenshots and HTML failure report
75
+
- Allure formatted XML results
76
+
- Allure report dashboard of results
47
77
48
78
## Find your MFTF version
49
79
@@ -52,22 +82,16 @@ There are two options to find out your MFTF version:
52
82
- using the MFTF CLI
53
83
- using the Composer CLI
54
84
55
-
### MFTF CLI
85
+
All the Command Line commands needs to be executed from `<magento_root>`
56
86
57
-
```bash
58
-
cd<magento_root>/
59
-
```
87
+
### MFTF CLI
60
88
61
89
```bash
62
90
vendor/bin/mftf --version
63
91
```
64
92
65
93
### Composer CLI
66
94
67
-
```bash
68
-
cd<magento_root>/
69
-
```
70
-
71
95
```bash
72
96
composer show magento/magento2-functional-testing-framework
73
97
```
@@ -89,41 +113,6 @@ utils // The test-running utilities.
89
113
codeception.dist.yml // Codeception configuration (generated while running 'bin/mftf build:project')
90
114
```
91
115
92
-
## MFTF output
93
-
94
-
- Generated PHP Codeception tests
95
-
- Codeception results and console logs
96
-
- Screenshots and HTML failure report
97
-
- Allure formatted XML results
98
-
- Allure report dashboard of results
99
-
100
-
## MFTF tests
101
-
102
-
The MFTF supports two different locations for storing the tests and test artifacts:
103
-
104
-
-`<magento_root>/app/code/<vendor_name>/<module_name>/Test/Mftf/` is the directory to create new tests.
105
-
-`<magento_root>/vendor/<vendor_name>/<module_name>/Test/Mftf/` is the directory with the out of the box tests (fetched by the Composer).
106
-
107
-
All tests and test data from these locations are merged in the order indicated in the above list.
108
-
109
-
The file structure under the both path cases is the same:
110
-
111
-
```tree
112
-
<Path>
113
-
├── ActionGroup
114
-
│ └── ...
115
-
├── Data
116
-
│ └── ...
117
-
├── Metadata
118
-
│ └── ...
119
-
├── Page
120
-
│ └── ...
121
-
├── Section
122
-
│ └── ...
123
-
└── Test
124
-
└── ...
125
-
```
126
-
127
116
## MFTF on Github
128
117
129
118
Follow the [MFTF project] and [contribute on Github].
Copy file name to clipboardExpand all lines: docs/merging.md
+10Lines changed: 10 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -27,6 +27,15 @@ For example:
27
27
Although a file name does not influence merging, we recommend using the same file names in merging updates.
28
28
This makes it easier to search later on.
29
29
30
+
## Merging precedence
31
+
32
+
**Magento Functional Testing Framework** uses Module's `<sequence>` to merge all XML configurations into Codeception instructions. If there's no Sequence specified, MFTF would use:
33
+
34
+
1. Vendor modules (Magento & Vendors) located in `vendor/`
35
+
1. Tests located in `app/code/*/*/Test/Mftf`
36
+
37
+
![Usual precedence for merging MFTF Tests and resources][mftfExtendingPrecedence image]
38
+
30
39
## Add a test
31
40
32
41
You cannot add another [`<test>`][tests] using merging functionality.
@@ -570,3 +579,4 @@ The `_defaultSample` results corresponds to:
0 commit comments