Getting Started with MFTF - magento/inventory GitHub Wiki

Documentation

  1. Getting started with the Magento Functional Testing Framework | Magento 2 Developer Documentation

Prepare Environment

  1. Disable Add Secret Key in URLs option in Stores->Configuration->Admin->Security.

  2. Run the Selenium Server:

    • Download the latest Selenium Server Standalone JAR.
    • Download a Selenium web driver for your web browser into the same directory that contains the Selenium server.
    • Add the directory with the web driver to PATH.
    • Run the Selenium server in terminal (or other command line interface):
      java -jar <path_to_selenium_directory>/selenium-server-standalone-<version>.jar
      

Prepare Repository

Below is a rough overview of the key steps outlined in the Official MFTF Dev Docs tailored to Extension Developers and the MSI project.

  1. Clone MSI Repo: * git clone https://github.com/magento/inventory.git [PATH_TO_MAGENTO_MSI]
  2. CD to the acceptance test directory of msi:
    • cd [PATH_TO_MAGENTO_MSI]/dev/tests/acceptance
  3. Install the dependencies:
    • composer install
  4. Build the project:
    • ./vendor/bin/robo build:project
  5. Locate and Open the .env file.
  6. Fill in the minimal necessary details:
    #Magento Base url. It should include `index.php/` if rewrites rules are not enabled.
    MAGENTO_BASE_URL=http://magento.url/
    
    #Magento backend route name
    MAGENTO_BACKEND_NAME=admin
    
    #admin username
    MAGENTO_ADMIN_USERNAME=admin
    
    #admin password
    MAGENTO_ADMIN_PASSWORD=admin123
  7. Generate the tests:
    • ./vendor/bin/robo generate:tests

Run MSI Tests

  1. Execute the MSI group of the tests in Single Source/Stock Mode:
    • cd [PATH_TO_MAGENTO_MSI]/dev/tests/acceptance
    • ./vendor/bin/robo group single_mode
  2. Execute the MSI group of the tests in Multi Source/Stock Mode:
    • cd [PATH_TO_MAGENTO_MSI]/dev/tests/acceptance
    • ./vendor/bin/robo group multi_mode
⚠️ **GitHub.com Fallback** ⚠️