Create a test in the Functional Testing Framework
The FTF helps to create a new test, you can extend an out-of-the-box test, or create a completely new test.
Extend an out-of-the-box test
You can extend a test by adding or replacing a test entity. Test entities for the module are stored in the
This approach is useful when the Magento functionality was extended. For example, the minor changes were made in the existing functionality of a module . Also you can extend an out-of-the-box test to extend the current test coverage if the target functionality is not completely covered by the out-of-the-box test.
Example use cases:
Create a functional test
If new modules are added to Magento you would need to create a new test to check the functionality.
New test must be stored in the corresponding module
Each test consists of four main components: a test object, test data, a test flow, a test assertion.
A test object is an object that you are going to test. Most of the test actions are performed under this object. The test object is represented by a fixture. The fixture defines properties of an object.
There are two types of test data:
- Data for the test, stored in a data set.
A test flow is a set of test steps that you want to perform under the test object to check required functionality. Test steps are defined in a test case. Usually, a test step contains a set of actions. Each action is managed by a method defined in a block. A page is a container for blocks. It stores selectors to identify blocks on an HTML page.
A test assertion compares the test flow results with the expected ones. Test assertions are represented by constraints.