setono/sylius-behat-pack

一个安装所有运行Sylius插件或应用程序behat测试所需的包


README

运行Sylius插件或应用程序的behat测试所需的库集合

$ composer require --dev setono/sylius-behat-pack

准备启用JS的测试环境

  • Chromedriver

    • 安装

      https://sites.google.com/a/chromium.org/chromedriver/downloads

      # platform options: linux32, linux64, mac64, win32
      PLATFORM=mac64
      VERSION=$(curl http://chromedriver.storage.googleapis.com/LATEST_RELEASE)
      cd /tmp
      curl http://chromedriver.storage.googleapis.com/$VERSION/chromedriver_$PLATFORM.zip > chromedriver.zip
      unzip -o chromedriver.zip
      chmod +x chromedriver
      mv chromedriver /usr/local/bin/chromedriver
      rm chromedriver.zip
      chromedriver -v
    • 运行

      chromedriver > /dev/null 2>&1 &
  • Selenium

    • 安装

      curl http://selenium-release.storage.googleapis.com/3.4/selenium-server-standalone-3.4.0.jar > /usr/local/bin/selenium.jar
    • 运行

      java -Dwebdriver.chrome.driver=/usr/local/bin/chromedriver -jar /usr/local/bin/selenium.jar > /dev/null 2>&1 &
  • Web服务器

    • 安装 symfony 命令行工具

      https://symfony.com.cn/download

      curl -sS https://get.symfony.com/cli/installer | bash
      mv ~/.symfony/bin/symfony /usr/local/bin/symfony
      symfony -v
    • 使用测试环境运行Web服务器

      # App
      APP_ENV=test symfony server:start --port=8080 --daemon
      
      # Plugin
      (cd tests/Application && APP_ENV=test symfony server:start --port=8080 --daemon)