Tips and Tricks - magento/inventory GitHub Wiki
-
PHPStorm 2017.1+ Codeception Support
- PHPStorm 2017.1+ has a Codeception Test Runner that provides incredibly useful tools for debugging Codeception based tests. Please review their Blog post regarding how to setup the Test Runner.
-
PHPStorm 2017 Template Files
- PHPStorm has a feature were you can setup Templates for files that you create often. Please review their post regarding how to setup Live Templates.
-
Metadata
- If you are automating a feature of the Admin that is used often, i.e. "Adding a Product", you should look into creating the Metadata for the object you are trying to create via the UI. This will allow you to quickly setup the same entity in the future without "driving" the UI saving you LOTS of time in your test.
- TOOL(s)
- Charles Proxy - Capture Network Traffic: https://www.charlesproxy.com/download/
- Start Charles Proxy and begin recording.
- Create the entity you need using the Admin UI.
- Locate the POST request for your Store.
- The POST request will have most of the details that you will need for your MetaData.
- Start Charles Proxy and begin recording.
- Charles Proxy - Capture Network Traffic: https://www.charlesproxy.com/download/
-
Action Groups
- Available Action Groups worth noting:
- LoginAsAdmin
- LogoutOfAdmin
- AdminSaveAndClose
- AdminGridSearchByKeyword(VALUE)
- AdminGridFilterSearchResultsByInput(SELECTOR, VALUE)
- AdminClearGridFiltersIfPresent
- Available Action Groups worth noting:
-
List Existing Files
-
CD to the acceptance test directory:
cd [PATH_TO_MAGENTO_MSI]/dev/tests/acceptance
-
Locate a list of Action Groups, Pages, Sections, Data and Meta Data in Magento2 using the following Terminal commands:
ls -lG tests/functional/Magento/FunctionalTest/*/ActionGroup
ls -lG tests/functional/Magento/FunctionalTest/*/Data
ls -lG tests/functional/Magento/FunctionalTest/*/Metadata
ls -lG tests/functional/Magento/FunctionalTest/*/Page
ls -lG tests/functional/Magento/FunctionalTest/*/Section
-
Locate a list of Action Groups, Pages, Sections, Data and Meta Data in MSI Modules using the following Terminal commands:
ls -lG ../../../app/code/Magento/Inventory*/Tests/Mftf/ActionGroup
ls -lG ../../../app/code/Magento/Inventory*/Tests/Mftf/Data
ls -lG ../../../app/code/Magento/Inventory*/Tests/Mftf/Metadata
ls -lG ../../../app/code/Magento/Inventory*/Tests/Mftf/Page
ls -lG ../../../app/code/Magento/Inventory*/Tests/Mftf/Section
ls -lG ../../../app/code/Magento/Inventory*/Tests/Mftf/Test
-
-
Decrease local test runs times by disabling AllureAdapter
- Performance of running MFTF tests locally can be significantly improved by removing the MagentoAllureAdapter Module from Codeception and replacing with a standard Allure Adapter
- However, this will disable the ability to have Allure reporting from your local runs. The standard adapter will not be usable with MFTF data.
- To do so, replace the line
Magento\FunctionalTestingFramework\Allure\Adapter\MagentoAllureAdapter
from theextensions : enabled
block of thecodeception.yml
file toYandex\Allure\Adapter\AllureAdapter