diff --git a/.travis.yml b/.travis.yml
index 6e0592754..0a01c1a13 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,6 +1,7 @@
# Note that the example .travis.yml file for child projects lives in /install.
sudo: true
language: php
+dist: trusty
php:
- 5.6
@@ -24,7 +25,12 @@ notifications:
addons:
ssh_known_hosts:
- - svn-5223.devcloud.hosting.acquia.com
+ - svn-5223.devcloud.hosting.acquia.com
+ apt:
+ packages:
+ - mysql-server-5.6
+ - mysql-client-core-5.6
+ - mysql-client-5.6
before_install:
# Decrypt private SSH key id_rsa_blt.enc, save as ~/.ssh/id_rsa_blt.
@@ -40,7 +46,7 @@ before_install:
- echo "memory_limit=-1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
- git config --global user.name "Travis-CI"
- git config --global user.email "noreply@travis-ci.org"
- - mysql -e 'CREATE DATABASE drupal;'
+ - mysql -u root -e 'CREATE DATABASE drupal;'
install:
# Load composer dependencies.
@@ -54,6 +60,12 @@ install:
- nvm use 4.4.1
# Initialize drupal console default configuration.
- drupal init
+ # Initialize xvfb (see https://docs.travis-ci.com/user/gui-and-headless-browsers)
+ - sudo apt-get install xvfb
+ - export DISPLAY=:99.0
+ - sh -e /etc/init.d/xvfb start
+ # Installs chromedriver to vendor/bin.
+ - ./scripts/linux/install-chrome.sh $TRAVIS_BUILD_DIR/vendor/bin
before_script:
# Clear drush release history cache, to pick up new releases.
diff --git a/INSTALL.md b/INSTALL.md
index 824210906..e93ecfb79 100644
--- a/INSTALL.md
+++ b/INSTALL.md
@@ -20,7 +20,7 @@ Ensure that [Xcode](https://itunes.apple.com/us/app/xcode/id497799835?mt=12) is
Then install the minimum dependencies for BLT. The preferred method is via Homebrew, though you could install these yourself without a package manager.
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
- brew install git composer drush
+ brew install php56 git composer drush
composer global require "hirak/prestissimo:^0.3"
If you'd like to create a VM with BLT, you will require the following additional libraries. If you'd like to use a LAMP stack other than Drupal VM, see [Local Development](readme/local-development.md).
@@ -29,6 +29,10 @@ If you'd like to create a VM with BLT, you will require the following additional
brew install ansible
brew cask install virtualbox vagrant
+If you'd like to execute Behat tests from the host machine, you will need Java:
+
+ brew cask install java
+
### Windows
Windows is currently supported only when using the [Bash on Ubuntu on Windows](https://msdn.microsoft.com/en-us/commandline/wsl/about) feature available in the latest version of Windows 10.
diff --git a/phing/build.yml b/phing/build.yml
index 663d5fed6..269a6cc81 100644
--- a/phing/build.yml
+++ b/phing/build.yml
@@ -1,16 +1,18 @@
behat:
config: ${repo.root}/tests/behat/local.yml
+ haltonerror: true
+ strict: true
profile: local
# If true, `drush runserver` will be used for executing tests.
run-server: false
# This is used for ad-hoc creation of a server via `drush runserver`.
server-url: http://127.0.0.1:8888
- # If true, PhantomJS GhostDriver will be launched with Behat.
- launch-phantom: true
+ # If true, Selenium standalone server will be launched with Behat.
+ launch-selenium: true
# An array of paths with behat tests that should be executed.
paths:
# - ${docroot}/modules
- # - ${docroot}/profiles
+ - ${docroot}/profiles
- ${repo.root}/tests/behat
tags: '~ajax'
verbose: ${blt.verbose}
diff --git a/phing/tasks/setup.xml b/phing/tasks/setup.xml
index 1412dcb75..8dce1ca82 100644
--- a/phing/tasks/setup.xml
+++ b/phing/tasks/setup.xml
@@ -8,6 +8,7 @@
+
Attempting to generate tests/behat/local.yml.
@@ -15,21 +16,6 @@
-
-
-
-
-
-
-
-
-
-
-
- Found PhantomJS at ${phantomjs.bin}
-
-
-
diff --git a/phing/tasks/tests.xml b/phing/tasks/tests.xml
index 7ce54de9a..699f20cf9 100644
--- a/phing/tasks/tests.xml
+++ b/phing/tasks/tests.xml
@@ -8,10 +8,10 @@
-
+
-
+
@@ -32,8 +32,8 @@
config="${behat.config}"
profile="${behat.profile}"
verbose="${behat.verbose}"
- strict="true"
- haltonerror="false"
+ strict="${behat.strict}"
+ haltonerror="${behat.haltonerror}"
returnProperty="behatPass"
out="std,${reports.localDir}"
format="pretty,junit"
@@ -44,7 +44,7 @@
-
+
@@ -58,30 +58,49 @@
-
-
+
-
-
+
+
+
+
-
-
-
+ level="${blt.exec_level}"
+ logoutput="false"/>
+ Selenium2 logs are being written to ${reports.selenium2}.
+
+
+
+
+
+
+
+
+ Unable to start Selenium2 standalone server on http://127.0.0.1:4444/wd/hub.
+
+
+
+
+ Not starting Selenium2 standalone server. Hope that you have something else setup!
+
-
-
+
+
+
diff --git a/scripts/drupal-vm/config.yml b/scripts/drupal-vm/config.yml
index 6f5dd7151..219acb557 100644
--- a/scripts/drupal-vm/config.yml
+++ b/scripts/drupal-vm/config.yml
@@ -46,6 +46,7 @@ npm_config_prefix: "/home/{{ drupalvm_user }}/.npm-global"
installed_extras:
- adminer
- nodejs
+ - java
# Use PHP 5.6 and change package names to work with 5.6.
php_version: "5.6"
diff --git a/scripts/linux/install-chrome.sh b/scripts/linux/install-chrome.sh
new file mode 100755
index 000000000..c44581321
--- /dev/null
+++ b/scripts/linux/install-chrome.sh
@@ -0,0 +1,19 @@
+#!/usr/bin/env bash
+# Installs chromedriver and chrome for Linux 64 bit systems.
+# Requires Trusty or higher.
+# example usage `./install-chrome.sh usr/local/bin`
+
+# Scripts expect argument specifying bin dir.
+BIN_DIR=$1
+
+if [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then
+ # Download google chrome.
+ wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
+ sudo dpkg -i --force-depends google-chrome-stable_current_amd64.deb
+
+ # Installs chromedriver for Linux 64 bit systems.
+ wget -N http://chromedriver.storage.googleapis.com/2.24/chromedriver_linux64.zip
+ unzip chromedriver_linux64.zip
+ chmod +x chromedriver
+ mv -f chromedriver $BIN_DIR
+fi
diff --git a/scripts/pipelines/acquia-pipelines.yml b/scripts/pipelines/acquia-pipelines.yml
index 72cc22eab..441ef4f81 100644
--- a/scripts/pipelines/acquia-pipelines.yml
+++ b/scripts/pipelines/acquia-pipelines.yml
@@ -25,8 +25,14 @@ events:
type: script
script:
- export PATH=$PATH:$BUILD_DIR/vendor/bin
- - drupal init
+ # Install chromedriver.
+ - ./vendor/acquia/blt/scripts/linux/chromedriver.sh $BUILD_DIR/vendor/bin
+ # Initialize xvfb (see https://docs.travis-ci.com/user/gui-and-headless-browsers)
+ - sudo apt-get install xvfb
+ - export DISPLAY=:99.0
+ - sh -e /etc/init.d/xvfb start
# The local.hostname must be set to 127.0.0.1:8888 because we are using drush runserver to test the site.
+ - drupal init
- drupal yaml:update:value project.yml project.local.hostname '127.0.0.1:8888'
- blt -Dbehat.run-server=true -Dcreate_alias=false -Dbehat.launch-phantom=true ci:build:validate:test
diff --git a/template/composer.json b/template/composer.json
index 9f5e9494b..de5e87a9f 100644
--- a/template/composer.json
+++ b/template/composer.json
@@ -21,25 +21,21 @@
"drupal/search_api": "8.1.0-alpha14",
"drupal/search_api_solr": "8.1.0-alpha3",
"drupal/security_review": "8.*",
- "drupal-composer/drupal-security-advisories": "8.0.x-dev",
- "roave/security-advisories": "dev-master"
+ "drupal-composer/drupal-security-advisories": "8.0.x-dev"
},
"require-dev": {
- "behat/behat": "3.0.*",
- "behat/mink": "~1.7",
- "behat/mink-browserkit-driver": "*",
- "behat/mink-extension": "*",
- "behat/mink-goutte-driver": "*",
- "behat/mink-selenium2-driver": "*",
- "drupal/coder": "~8.2",
- "drupal/drupal-extension": "~3.0",
- "drush/drush": "^9.0",
- "drupal-composer/drupal-scaffold": "^2.0.0",
- "jakoch/phantomjs-installer": "dev-master as 1.9.8",
- "jarnaiz/behat-junit-formatter": "^1.2",
- "phing/phing": "~2",
- "phpunit/phpunit": "~5.4",
- "squizlabs/php_codesniffer": "2.*"
+ "behat/behat": "^3.0",
+ "behat/mink": "~1.7",
+ "behat/mink-selenium2-driver": "*",
+ "drupal/coder": "~8.2",
+ "drupal/drupal-extension": "^3.2",
+ "drush/drush": "^9.0",
+ "drupal-composer/drupal-scaffold": "^2.0.0",
+ "jarnaiz/behat-junit-formatter": "^1.2",
+ "phing/phing": "~2",
+ "phpunit/phpunit": "~5.4",
+ "se/selenium-server-standalone": "^2.53",
+ "squizlabs/php_codesniffer": "2.*"
},
"autoload-dev": {
"psr-4": {
@@ -60,6 +56,9 @@
},
"drupal/features": {
"Bundle support": "https://www.drupal.org/files/issues/features-2808303-2.patch"
+ },
+ "drupal/lightning": {
+ "Fix failing Behat test for Selenium": "https://www.drupal.org/files/issues/issue-158-selenium-behat-tests.patch"
}
}
},
@@ -68,16 +67,6 @@
"nuke": [
"rm -rf vendor composer.lock",
"@composer install"
- ],
- "install-phantomjs": [
- "rm -rf vendor/bin/phantomjs",
- "PhantomInstaller\\Installer::installPhantomJS"
- ],
- "post-install-cmd": [
- "PhantomInstaller\\Installer::installPhantomJS"
- ],
- "post-update-cmd": [
- "PhantomInstaller\\Installer::installPhantomJS"
]
},
"minimum-stability": "dev",
diff --git a/template/tests/behat/example.local.yml b/template/tests/behat/example.local.yml
index 87aae0422..5c7923e1c 100644
--- a/template/tests/behat/example.local.yml
+++ b/template/tests/behat/example.local.yml
@@ -29,13 +29,6 @@ local:
base_url: ${project.local.uri}
# set default command for "Show last response" step.
show_cmd: "open %s"
- # ADDITIONAL OPTIONS FOR WEB DRIVERS
- # use the following 3 lines to use phantomjs
- # browser_name: phantomjs
- # selenium2:
- # wd_host: "http://localhost:4444/wd/hub"
- # browser: chrome
- #
# use the following lines to disable SSL authentication for goutte.
# goutte:
# guzzle_parameters: