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
Copy file name to clipboardExpand all lines: docs/guides/test-modularity.md
+10-9Lines changed: 10 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ Within MFTF, test modularity can refer to two different concepts:
8
8
9
9
### Test material merging
10
10
11
-
This concept is covered extensively in the [merging] topic, so it will not be our focus in this guide
11
+
Test material merging is covered extensively in the [merging] topic, so it will not be our focus in this guide.
12
12
13
13
### Modular test materials
14
14
@@ -18,9 +18,9 @@ Since MFTF queries the Magento instance for enabled modules, MFTF test materials
18
18
19
19
## Why is test modularity important?
20
20
21
-
This concept is important simply because without proper modularity, tests or test materials may be incorrectly merged in (or be left out), leading to the the test itself being out of sync with the Magento instance.
21
+
This concept is important simply because without proper modularity, tests or test materials may be incorrectly merged in (or left out), leading to the the test itself being out of sync with the Magento instance.
22
22
23
-
For example, in a situation where an extension drastically alters the login process (something like two factor authentication), the only way the tests will be able to pass is if the test materials are correctly nested in the extension.
23
+
For example, in a situation where an extension drastically alters the login process (for instance: two factor authentication), the only way the tests will be able to pass is if the test materials are correctly nested in the extension.
24
24
25
25
## How can I achieve test modularity?
26
26
@@ -32,21 +32,22 @@ This is should be the first step when creating new test materials. We will use t
32
32
33
33
#### Intuitive reasoning
34
34
35
-
The easiest way to do this has limited application, but some times it's fairly obvious where a test material comes from due to nomenclature or functionality.
35
+
The easiest way to do this has limited application, but some times it is fairly obvious where test material comes from due to nomenclature or functionality.
36
36
37
-
For instance, the following `<select>` for `Tax Class` clearly belongs to the `Tax` module
37
+
The following `<select>` for `Tax Class` clearly belongs to the `Tax` module:
This approach will work on getting the quickest ownership, but it's fairly obvious that it may be necessary to double check
43
+
This approach will work on getting the quickest ownership, but it is fairly obvious that it may be necessary to double check.
44
44
45
45
#### Deduction
46
46
47
47
This is the next step up in difficulty from the above method, as it involves searching through the Magento codebase.
48
48
49
-
Let's take the `Add Attribute` button for example. The button has an `id="addAttribute"`, and searching through the codebase for `"addAttribute"` will lead you to `Catalog/view/adminhtml/ui_component/product_form.xml`:
49
+
Take the `Add Attribute` button for example. The button has an `id="addAttribute"`, and searching through the codebase for `"addAttribute"` will lead you to `Catalog/view/adminhtml/ui_component/product_form.xml`:
@@ -57,12 +58,12 @@ This kind of deduction is more involved, but it much more likely to give you the
57
58
58
59
### Use bin/mftf static-checks
59
60
60
-
The latter aspect of modular test materials involves test material references to other test materials, and making sure the dependencies are not out of sync with the parent module.
61
+
The second aspect of modular test materials involves test material references to other test materials, and making sure the dependencies are not out of sync with the parent module.
61
62
62
63
The `static-checks` command includes a test material ownership check that should help suss out these kind of dependency issues.
0 commit comments