11/20/2017 - 9:25 PM

Run Functional

Running Magento 2 functional tests

  1. If not installed, download and install JDK:
  2. Download selenium server:
  3. Run selenium filter: java -jar ~/Downloads/selenium-server-standalone-2.53.1.jar
  4. [Automated in current vagrant box] Copy dev/tests/functional/phpunit.xml and change: app_frontend_url, app_backend_url (i.e. URL's of your storefront and admin page).
  5. [Automated in current vagrant box] Copy dev/tests/functional/etc/config.xml and change: application/backendLogin, application/backendPassword (i.e. admin username and password).
  6. Add the following custom server declarations to dev/tests/functional/etc/config.xml and use one of them at a time
        <item name="selenium" type="default" browser="Fire Fox" browserName="firefox" host="" port="4444" seleniumServerRequestsTimeout="180" sessionStrategy="shared">
        <!--<item name="selenium" type="default" browser="Google Chrome" browserName="chrome" host="" port="4444" seleniumServerRequestsTimeout="180" sessionStrategy="shared">-->
  1. Run composer install on host in project directory: cd magento2ce/dev/tests/functional && ../../../../scripts/host/composer.phar --ignore-platform-reqs install && cd ../../../..
  2. Generate fixtures, run on guest using vagrant ssh, in project directory: cd magento2ce/dev/tests/functional/utils && php generate.php && cd ../../../../..
  3. [Automated in current vagrant box] Change Magento Store config:
  4. Make sure FireFox version is 46 OR install webdriver for Chrome: , tests work faster in Chrome
  5. Run necessary test in PhpStorm using dev/tests/functional/phpunit.xml configuration
  • Right click on desired test.
  • Select Run. (Expected failure)
  • Select PHPStorm popup to change configuration.
  • Specify default configuration as phpunit file just selected.