Merge pull request #225 from open-sausages/pulls/4.0/selenium-upgrade

Update selenium to chromedriver
This commit is contained in:
Robbie Averill 2018-04-13 10:50:50 +12:00 committed by GitHub
commit 9d8193d19c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 16 deletions

View File

@ -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:

View File

@ -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 @<module>
# composer require silverstripe/recipe-testing ^1
# vendor/bin/behat-ss @<module>
# ========================================================================= #
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