Tips and Tricks - magento/inventory GitHub Wiki

  1. PHPStorm 2017.1+ Codeception Support

  2. PHPStorm 2017 Template Files

  3. Metadata

    1. 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.
    2. TOOL(s)
      • Charles Proxy - Capture Network Traffic: https://www.charlesproxy.com/download/
        1. Start Charles Proxy and begin recording. Charles Proxy Recording
        2. Create the entity you need using the Admin UI. Save Entity via Admin UI
        3. Locate the POST request for your Store. Charles Proxy POST
        4. The POST request will have most of the details that you will need for your MetaData. MFTF Metadata XML
  4. Action Groups

    1. Available Action Groups worth noting:
      1. LoginAsAdmin
      2. LogoutOfAdmin
      3. AdminSaveAndClose
      4. AdminGridSearchByKeyword(VALUE)
      5. AdminGridFilterSearchResultsByInput(SELECTOR, VALUE)
      6. AdminClearGridFiltersIfPresent
  5. List Existing Files

    1. CD to the acceptance test directory:

      • cd [PATH_TO_MAGENTO_MSI]/dev/tests/acceptance
    2. 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
    3. 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
  6. 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 the extensions : enabled block of the codeception.yml file to Yandex\Allure\Adapter\AllureAdapter