From d678bd76f9560ca7b29a97a679b4119a63ea1684 Mon Sep 17 00:00:00 2001 From: Damian Mooyman Date: Fri, 13 Apr 2018 09:27:25 +1200 Subject: [PATCH] Update selenium to chromedriver --- .travis.yml | 17 ++++++++++------- behat.yml | 18 +++++++++--------- 2 files changed, 19 insertions(+), 16 deletions(-) diff --git a/.travis.yml b/.travis.yml index b72eb26..562fbc9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,16 +2,15 @@ language: php dist: trusty -sudo: required - -group: deprecated-2017Q4 +before_install: + - sudo apt-get update + - sudo apt-get install chromium-chromedriver cache: directories: - $HOME/.composer/cache/files addons: - firefox: "31.0" apt: packages: - tidy @@ -22,6 +21,8 @@ env: - COMPOSER_ROOT_VERSION="4.0.x-dev" - DISPLAY=":99" - XVFBARGS=":99 -ac -screen 0 1024x768x16" + - SS_BASE_URL="http://localhost:8080/" + - SS_ENVIRONMENT_TYPE="dev" matrix: fast_finish: true @@ -66,6 +67,9 @@ matrix: - PDO=1 before_script: +# Extra $PATH + - export PATH=/usr/lib/chromium-browser/:$PATH + # Init PHP - phpenv rehash - phpenv config-rm xdebug.ini || true @@ -74,17 +78,16 @@ before_script: # Install composer dependencies - composer validate - if [[ $DB == PGSQL ]]; then composer require --no-update silverstripe/postgresql:2.0.x-dev; fi - - if [[ $BEHAT_TEST ]]; then composer require --no-update silverstripe/behat-extension:^3 silverstripe/serve:^2 se/selenium-server-standalone:2.41.0; fi; + - if [[ $BEHAT_TEST ]]; then composer require --no-update silverstripe/recipe-testing:^1; fi; - if [[ $HEALTH_TEST ]]; then composer require --no-update silverstripe/serve:^2; fi; - if ! [[ $HEALTH_TEST ]]; then composer install --prefer-dist --no-interaction --no-progress --no-suggest --optimize-autoloader --verbose --profile; fi; - if [[ $HEALTH_TEST ]]; then composer install --prefer-dist --no-interaction --no-progress --no-suggest --optimize-autoloader --verbose --profile --no-dev; fi; # Start behat services - - if [[ $BEHAT_TEST ]] || [[ $HEALTH_TEST ]]; then echo 'SS_BASE_URL=http://localhost:8080/' >> .env; fi - if [[ $BEHAT_TEST ]] || [[ $HEALTH_TEST ]]; then mkdir artifacts; fi - if [[ $BEHAT_TEST ]] || [[ $HEALTH_TEST ]]; then cp composer.lock artifacts/; fi - if [[ $BEHAT_TEST ]]; then sh -e /etc/init.d/xvfb start; sleep 3; fi - - if [[ $BEHAT_TEST ]]; then (vendor/bin/selenium-server-standalone > artifacts/selenium.log 2>&1 &); fi + - if [[ $BEHAT_TEST ]]; then (chromedriver > artifacts/chromedriver.log 2>&1 &); fi - if [[ $BEHAT_TEST ]] || [[ $HEALTH_TEST ]]; then (vendor/bin/serve --bootstrap-file vendor/silverstripe/cms/tests/behat/serve-bootstrap.php &> artifacts/serve.log &); sleep 3; fi script: diff --git a/behat.yml b/behat.yml index feb4362..f092b55 100644 --- a/behat.yml +++ b/behat.yml @@ -1,20 +1,20 @@ -# Note: Currently firefox 31-ESR is recommended +# Note: Currently chrome latest is recommended # Behat test setup requires an `.env` with `SS_BASE_URL` defined, as well # as each of the following commands to initiate a test run: # ========================================================================= # -# composer require silverstripe/behat-extension:^3 silverstripe/serve:dev-master se/selenium-server-standalone:2.41.0 -# vendor/bin/selenium-server-standalone -Dwebdriver.firefox.bin="/Applications/Firefox31.app/Contents/MacOS/firefox-bin" -# vendor/bin/serve --bootstrap-file vendor/silverstripe/cms/tests/behat/serve-bootstrap.php -# vendor/bin/behat @ +# composer require silverstripe/recipe-testing ^1 +# vendor/bin/behat-ss @ # ========================================================================= # default: suites: [] extensions: SilverStripe\BehatExtension\MinkExtension: - default_session: selenium2 - javascript_session: selenium2 - selenium2: - browser: firefox + default_session: facebook_web_driver + javascript_session: facebook_web_driver + facebook_web_driver: + browser: chrome + wd_host: "http://127.0.0.1:9515" #chromedriver port + browser_name: chrome SilverStripe\BehatExtension\Extension: bootstrap_file: vendor/silverstripe/cms/tests/behat/serve-bootstrap.php screenshot_path: %paths.base%/artifacts/screenshots