diff --git a/.travis.yml b/.travis.yml index b3ccc8e..0d79bde 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,11 +1,23 @@ language: php -dist: trusty +os: linux -sudo: false +dist: bionic php: - '7.3' + - '7.4' + +services: + - mysql + +addons: + apt: + sources: + - google-chrome + packages: + - google-chrome-stable + chrome: stable cache: yarn: true @@ -35,37 +47,23 @@ before_script: - (cd tests/Application && bin/console cache:warmup -vvv) - (cd tests/Application && yarn build) - # Configure display - - /sbin/start-stop-daemon --start --quiet --pidfile /tmp/xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -ac -screen 0 1680x1050x16 - - export DISPLAY=:99 - - # Download and configure ChromeDriver - - | - if [ ! -f $SYLIUS_CACHE_DIR/chromedriver ] || [ "$($SYLIUS_CACHE_DIR/chromedriver --version | grep -c 2.34)" = "0" ]; then - curl http://chromedriver.storage.googleapis.com/2.34/chromedriver_linux64.zip > chromedriver.zip - unzip chromedriver.zip - chmod +x chromedriver - mv chromedriver $SYLIUS_CACHE_DIR - fi - - # Run ChromeDriver - - $SYLIUS_CACHE_DIR/chromedriver > /dev/null 2>&1 & - - # Download and configure Selenium + # Downloading Symfony CLI - | - if [ ! -f $SYLIUS_CACHE_DIR/selenium.jar ] || [ "$(java -jar $SYLIUS_CACHE_DIR/selenium.jar --version | grep -c 3.4.0)" = "0" ]; then - curl http://selenium-release.storage.googleapis.com/3.4/selenium-server-standalone-3.4.0.jar > selenium.jar - mv selenium.jar $SYLIUS_CACHE_DIR + if [ ! -f $SYLIUS_CACHE_DIR/symfony ]; then + wget https://get.symfony.com/cli/installer -O - | bash + mv ~/.symfony/bin/symfony $SYLIUS_CACHE_DIR fi + php -v | head -n 1 | awk '{ print $2 }' > .php-version - # Run Selenium - - java -Dwebdriver.chrome.driver=$SYLIUS_CACHE_DIR/chromedriver -jar $SYLIUS_CACHE_DIR/selenium.jar > /dev/null 2>&1 & + # Run Chrome Headless + - google-chrome-stable --enable-automation --disable-background-networking --no-default-browser-check --no-first-run --disable-popup-blocking --disable-default-apps --allow-insecure-localhost --disable-translate --disable-extensions --no-sandbox --enable-features=Metal --headless --remote-debugging-port=9222 --window-size=2880,1800 --proxy-server='direct://' --proxy-bypass-list='*' http://127.0.0.1 > /dev/null 2>&1 & # Run webserver - - (cd tests/Application && bin/console server:run 127.0.0.1:8080 --quiet > /dev/null 2>&1 &) + - (cd tests/Application && $SYLIUS_CACHE_DIR/symfony server:start --port=8080 --dir=public --daemon) script: - composer validate + - vendor/bin/phpstan analyse -c phpstan.neon -l max src/ - vendor/bin/phpunit diff --git a/behat.yml.dist b/behat.yml.dist index 312ece7..27609b6 100644 --- a/behat.yml.dist +++ b/behat.yml.dist @@ -4,6 +4,8 @@ imports: default: extensions: + DMore\ChromeExtension\Behat\ServiceContainer\ChromeExtension: ~ + Lakion\Behat\MinkDebugExtension: directory: etc/build clean_start: false @@ -13,10 +15,14 @@ default: files_path: "%paths.base%/vendor/sylius/sylius/src/Sylius/Behat/Resources/fixtures/" base_url: "http://localhost:8080/" default_session: symfony - javascript_session: chrome + javascript_session: chrome_headless sessions: symfony: symfony: ~ + chrome_headless: + chrome: + api_url: http://127.0.0.1:9222 + validate_certificate: false chrome: selenium2: browser: chrome diff --git a/composer.json b/composer.json index d7de7cd..3055ebb 100644 --- a/composer.json +++ b/composer.json @@ -7,25 +7,27 @@ "require": { "php": "^7.3", - "sylius/sylius": "^1.7.4" + "sylius/sylius": "^1.7.5" }, "require-dev": { "behat/behat": "^3.6.1", - "behat/mink-selenium2-driver": "^1.3", + "behat/mink-selenium2-driver": "^1.4", + "dmore/behat-chrome-extension": "^1.3", + "dmore/chrome-mink-driver": "^2.7", "friends-of-behat/mink": "^1.8", - "friends-of-behat/mink-browserkit-driver": "^1.3", - "friends-of-behat/mink-extension": "^2.2", + "friends-of-behat/mink-browserkit-driver": "^1.4", + "friends-of-behat/mink-extension": "^2.4", "friends-of-behat/page-object-extension": "^0.3", "friends-of-behat/suite-settings-extension": "^1.0", - "friends-of-behat/symfony-extension": "^2.0", - "friends-of-behat/variadic-extension": "^1.1", + "friends-of-behat/symfony-extension": "^2.1", + "friends-of-behat/variadic-extension": "^1.3", "lakion/mink-debug-extension": "^1.2.3", "phpspec/phpspec": "^6.1", - "phpstan/phpstan-doctrine": "^0.12", - "phpstan/phpstan": "^0.12", - "phpstan/phpstan-webmozart-assert": "^0.12", - "phpunit/phpunit": "^8.0", - "sensiolabs/security-checker": "^5.0", + "phpstan/phpstan": "0.12.25", + "phpstan/phpstan-doctrine": "0.12.13", + "phpstan/phpstan-webmozart-assert": "0.12.4", + "phpunit/phpunit": "^8.5", + "sensiolabs/security-checker": "^6.0", "sylius-labs/coding-standard": "^3.1", "symfony/browser-kit": "^4.4", "symfony/debug-bundle": "^4.4|^5.0", diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 2572002..042a638 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,7 +1,7 @@ @@ -11,9 +11,11 @@ + + - +