How to modify Magento Admin configuration in MFTF tests

  • Post author:
  • Post category:Magento 2

To modify Magento Admin configuration in MFTF tests it’s better to create custom configuration file in your tests. To do that you need to create a config data file with predefined configurations. Let’s create Vendor/YourModule/Test/Mftf/Data/ConfigData.xml with following data:

It’s necessary to add path, value, label to your entity.

Path – is the configuration path in core_config_data table.

Label – is the label of your configuration in Magento Admin.

Value – is the value that is passes from Magento Admin to backend while saving configuration.

Entity name – is the name of the entity that is called in your test.

If configuration in Magento Admin is a simple input field then values of label and value should be the same. See example above in DefaultFeatureLimit entity.

You can modify your configuration in before and after conditions of your test calling to your entities. Check example below: