diff --git a/.travis.yml b/.travis.yml index e6075f1b..2067e1be 100644 --- a/.travis.yml +++ b/.travis.yml @@ -48,6 +48,7 @@ script: - grunt install --db-url=sqlite:/`pwd`/.ht.sqlite --quiet - grunt serve:test >/dev/null & - until curl -I -XGET -s $GDT_TEST_URL 2>/dev/null | egrep -q '^HTTP.*200'; do sleep 0.5; done + - vendor/bin/phantomjs --webdriver=8643 2&>/dev/null & - vendor/bin/drush --root=build/html en -y simpletest - grunt test - sleep 1; while (ps aux | grep '[b]ehat' > /dev/null); do sleep 1; done diff --git a/example/composer.json b/example/composer.json index 3f61cc81..3545ed07 100644 --- a/example/composer.json +++ b/example/composer.json @@ -19,7 +19,7 @@ "roave/security-advisories": "dev-master" }, "require-dev": { - "behat/mink-zombie-driver": "dev-master#dd32fbd6988881dbab583225b65b787a893bb131", + "jakoch/phantomjs-installer": "^2.1", "drupal/drupal-extension": "~3.0", "drush/drush": "^8", "drupal/console": "~0.10", diff --git a/example/package.json b/example/package.json index 46ec253c..dd21fd95 100644 --- a/example/package.json +++ b/example/package.json @@ -5,7 +5,6 @@ "private": true, "dependencies": { "grunt": "^1.0.0", - "grunt-drupal-tasks": "~1.0.0", - "zombie": "^4.2.1" + "grunt-drupal-tasks": "~1.0.0" } } diff --git a/example/test/behat.yml b/example/test/behat.yml index 7cbbf5c8..3cc7a47a 100644 --- a/example/test/behat.yml +++ b/example/test/behat.yml @@ -8,10 +8,12 @@ default: extensions: Behat\MinkExtension: goutte: ~ - selenium2: ~ - zombie: ~ + # PhantomJS uses the Selenium2 mink driver. + # To run: `vendor/bin/phantomjs --webdriver=8643` + selenium2: + wd_host: "http://localhost:8643/wd/hub" base_url: http://127.0.0.1:8080 - javascript_session: 'zombie' + javascript_session: 'selenium2' Drupal\DrupalExtension: blackbox: ~ drush: @@ -19,6 +21,8 @@ default: drupal: drupal_root: './build/html' api_driver: 'drupal' + region_map: + header: "#header" ci: formatter: diff --git a/tasks/behat.js b/tasks/behat.js index c9d86c53..f1a9d2f4 100644 --- a/tasks/behat.js +++ b/tasks/behat.js @@ -69,7 +69,7 @@ module.exports = function(grunt) { bin: path, debug: true, env: _.extend({}, process.env, { - BEHAT_PARAMS: "{\"extensions\": {\"Drupal\\\\DrupalExtension\": {\"drupal\": {\"drupal_root\": \"./" + config.buildPaths.html + "\"}}, \"Behat\\\\MinkExtension\": {\"base_url\": \"" + config.siteUrls[key] + "\", \"zombie\": {\"node_modules_path\": \"" + process.cwd() + "/node_modules/\"}}}}" + BEHAT_PARAMS: "{\"extensions\": {\"Drupal\\\\DrupalExtension\": {\"drupal\": {\"drupal_root\": \"./" + config.buildPaths.html + "\"}}, \"Behat\\\\MinkExtension\": {\"base_url\": \"" + config.siteUrls[key] + "\"}}}" }) }, options) } diff --git a/test/test_assets_d8/composer.json b/test/test_assets_d8/composer.json new file mode 100644 index 00000000..65c9f44c --- /dev/null +++ b/test/test_assets_d8/composer.json @@ -0,0 +1,25 @@ +{ + "name": "client/project", + "description": "{Project} drupal codebase for {client}.", + "require-dev": { + "drupal/drupal-extension": "~3.0", + "drush/drush": "dev-master", + "phpmd/phpmd": "~2.1", + "drupal/coder": "^8.2", + "guzzlehttp/guzzle" : "^6.0@dev", + "jakoch/phantomjs-installer": "2.1.1", + "symfony/dependency-injection": "2.7.*", + "symfony/event-dispatcher": "2.7.*" + }, + "require": { + "roave/security-advisories": "dev-master" + }, + "scripts": { + "post-install-cmd": [ + "PhantomInstaller\\Installer::installPhantomJS" + ], + "post-update-cmd": [ + "PhantomInstaller\\Installer::installPhantomJS" + ] + } +} diff --git a/test/test_assets_d8/test/features/example.feature b/test/test_assets_d8/test/features/example.feature index b94d23b9..4761b662 100644 --- a/test/test_assets_d8/test/features/example.feature +++ b/test/test_assets_d8/test/features/example.feature @@ -22,7 +22,7 @@ tests are meant both to verify the Drupal install as well as Behat test features menu item is clicked. Given I am logged in as a user with the "administrator" role And I am on the homepage - And I click "My account" + And I click "My account" in the header And I click "Edit" When I fill in "pass[pass1]" with "123" Then I should see "Password strength" in the ".form-item-pass-pass1" element