Skip to content

Commit b124a11

Browse files
authored
Formatting
1 parent 5e5fb96 commit b124a11

File tree

1 file changed

+32
-29
lines changed

1 file changed

+32
-29
lines changed

docs/guides/using-suites.md

Lines changed: 32 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
# Using suites
22

3-
With increasing number of MFTF tests, it's important to have a mechanism to organize and consolidate them for ease-of-use.
3+
With an increasing number of MFTF tests, it is important to have a mechanism to organize and consolidate them for ease-of-use.
44

55
### What is a suite?
66

7-
Suite is a collection of MFTF tests that are intended to test specific behaviors of Magento. It may contain common initialization and clean up steps specific to the test cases included. It allows you to include, exclude and/or group tests with preconditions and post conditions.
7+
A suite is a collection of MFTF tests that are intended to test specific behaviors of Magento. It may contain initialization and clean up steps common to the included test cases. It allows you to include, exclude and/or group tests with preconditions and post conditions.
88
You can create a suite referencing tests, test groups and modules.
99

1010
### How is a suite defined?
1111

12-
A suite should be created under `<magento 2 root>/dev/tests/acceptance/tests/_suite` if it has cross-module references. If a suite references only a specific module, it should be created under `<module>/Test/Mftf/Suite`. The generated tests for each suite are grouped into their own directory under `<magento 2 root>/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/_generated/`.
12+
A suite should be created under `<magento2 root>/dev/tests/acceptance/tests/_suite` if it has cross-module references. If a suite references only a single module, it should be created under `<module>/Test/Mftf/Suite`. The generated tests for each suite are grouped into their own directory under `<magento2 root>/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/_generated/`.
1313

1414
### What is the format of a suite?
1515

16-
A suite comprises of the below blocks:
16+
A suite is comprised of blocks:
1717

18-
* `<before>` : executes precondition once per suite run.
19-
* `<after>` : executes postcondition once per suite run.
20-
* `<include>`: includes specific tests/groups/modules in the suite.
21-
* `<exclude>`: excludes specific tests/groups/modules from the suite.
18+
* `<before>` : executes precondition once per suite run.
19+
* `<after>` : executes postcondition once per suite run.
20+
* `<include>`: includes specific tests/groups/modules in the suite.
21+
* `<exclude>`: excludes specific tests/groups/modules from the suite.
2222

2323
```xml
2424
<?xml version="1.0" encoding="UTF-8"?>
@@ -65,34 +65,37 @@ A suite comprises of the below blocks:
6565
```
6666

6767
This example declares a suite with name `WYSIWYGDisabledSuite`:
68-
* Disables WYSIWYG of the Magento instance before running the tests.
69-
* Runs all tests from `Catalog` module, except `WYSIWYGIncompatibleTest`
70-
* Returns the Magento instance back to it's original state by enabling WYSIWYG at the end of testing.
68+
69+
* Disables WYSIWYG of the Magento instance before running the tests.
70+
* Runs all tests from the `Catalog` module, except `WYSIWYGIncompatibleTest`
71+
* Returns the Magento instance back to its original state, by enabling WYSIWYG at the end of testing.
7172

7273
### Using MFTF suite commands
7374

74-
* Generate all tests within a suite.
75-
```bash
76-
vendor/bin/mftf generate:suite <suiteName> [<suiteName>]
77-
```
78-
* Run all tests within suite.
79-
```bash
80-
vendor/bin/mftf run:group <suiteName> [<suiteName>]
81-
```
82-
* Generates any combination of suites and tests.
83-
```bash
84-
vendor/bin/mftf generate:tests --tests '{"tests":["testName1","testName2"],"suites":{"suite1":["suite_test1"],"suite2":null}}'
85-
```
75+
* Generate all tests within a suite.
76+
77+
```bash
78+
vendor/bin/mftf generate:suite <suiteName> [<suiteName>]
79+
```
80+
* Run all tests within suite.
81+
82+
```bash
83+
vendor/bin/mftf run:group <suiteName> [<suiteName>]
84+
```
85+
* Generates any combination of suites and tests.
86+
87+
```bash
88+
vendor/bin/mftf generate:tests --tests '{"tests":["testName1","testName2"],"suites":{"suite1":["suite_test1"],"suite2":null}}'
89+
```
8690

87-
### How to run specific tests within a suite?
91+
### Run specific tests within a suite
92+
93+
If a test is referenced in a suite, it can be run in the suite's context with MFTF `run` command. If a test is referenced in multiple suites, the `run` command will run the test multiple times in all contexts.
8894
89-
If a test is referenced in a suite, it can be run in the suite's context with MFTF run command. If a test is referenced in multiple suites, the run command will run the test multiple times in all contexts.
9095
```bash
91-
vendor/bin/mftf run:test <testName> [<testName>]
96+
vendor/bin/mftf run:test <testName> [<testName>]
9297
```
9398
9499
### When to use suites?
95100
96-
Suites are a great way to organize tests which need magento environment to be configured in a specific way as a pre-requisite. The conditions are executed once per suite which optimizes test execution time. If you wish to categorize tests solely based on functionality, use group tags instead.
97-
98-
<!-- Link definitions -->
101+
Suites are a great way to organize tests which need the Magento environment to be configured in a specific way as a pre-requisite. The conditions are executed once per suite which optimizes test execution time. If you wish to categorize tests solely based on functionality, use group tags instead.

0 commit comments

Comments
 (0)