|
1 | 1 | # Test Isolation |
2 | 2 |
|
3 | | -Since MFTF is a framework for testing a highly customizable and ever changing application, MFTF tests need to be properly isolated. |
| 3 | +Because MFTF is a framework for testing a highly customizable and ever changing application, MFTF tests need to be properly isolated. |
4 | 4 |
|
5 | 5 | ## What is test isolation? |
6 | 6 |
|
7 | | -Test isolation refers to a test that does not leave behind any data or configurations in the Magento instance. |
| 7 | +Test isolation refers to a test that does not leave behind any data or configuration changes in the Magento instance. |
8 | 8 |
|
9 | | -An MFTF test is considered fully isolated if |
| 9 | +An MFTF test is considered fully isolated if: |
10 | 10 |
|
11 | 11 | 1. It does not leave data behind. |
12 | | -2. It does not leave Magento configured in a different state than when the test started. |
13 | | -3. It does not affect a following test's outcome. |
14 | | -4. It does not rely on an irregular configuration to start its preconditions. |
| 12 | +1. It does not leave Magento configured in a different state than when the test started. |
| 13 | +1. It does not affect a following test's outcome. |
| 14 | +1. It does not rely on an irregular configuration to start its preconditions. |
15 | 15 |
|
16 | | -### Deleting versus Restoring |
| 16 | +### Deleting versus restoring |
17 | 17 |
|
18 | | -In the above list, points 1 and 2 refer to leaving things behind during test execution. This means you will be either deleting or restoring entities in Magento after your test's execution. |
| 18 | +In the above list, points 1 and 2 refer to leaving things behind during test execution. This means you are either deleting or restoring entities in Magento after your test's execution. |
19 | 19 |
|
20 | 20 | Some examples of entities to be deleted include: |
| 21 | + |
21 | 22 | 1. Products |
22 | | -2. Categories |
23 | | -3. Rules (Price, Related Products) |
| 23 | +1. Categories |
| 24 | +1. Rules (Price, Related Products) |
24 | 25 |
|
25 | 26 | The list of entities to restore is much simpler: |
| 27 | + |
26 | 28 | 1. Application Configuration |
27 | 29 |
|
28 | 30 | The distinction above is because MFTF tests expect the environment to be in a completely clean state, outside of a test or suite's preconditions. Data must be cleaned up and any application configuration must go back to the default. |
@@ -115,5 +117,3 @@ A test's workflow can also alter the application's configuration, and much like |
115 | 117 | ``` |
116 | 118 |
|
117 | 119 | One thing to note, unless a test is specifically testing the configuration page's frontend capabilities, configuring the application should always be done with a `<magentoCLI>` action. |
118 | | - |
119 | | -<!-- Link definitions --> |
0 commit comments