2017 © Pedro Peláez
 

library testable-drupal

A simple set of tools and files to make your Drupal Installation a Testable Drupal Installation Based on Behat, Mink and using Selenium2, Phantomjs and CasperJs, provide a basic structure to integrate with your tests.

image

vincenzodibiaggio/testable-drupal

A simple set of tools and files to make your Drupal Installation a Testable Drupal Installation Based on Behat, Mink and using Selenium2, Phantomjs and CasperJs, provide a basic structure to integrate with your tests.

  • Wednesday, July 31, 2013
  • by vincenzodibiaggio
  • Repository
  • 2 Watchers
  • 4 Stars
  • 12 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 3 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Testable Drupal

A simple set of tools and files to make your Drupal Installation a Testable Drupal Installation. Based on Behat, Mink and using Selenium2, Phantomjs and CasperJs, Testable Drupal provide a basic structure to integrate with your tests., (*1)

What it does

At this time Testable Drupal has basic tests to * verify Drupal installation. - using Mink and CasperJs * to perform a screenshot when required or when a test fail (if you are not using Goutte). - Using Mink * to perform a 'node create' and 'node update' with interface interaction (waiting for the appearance of the menu, then click... etc). - Using CasperJs, (*2)

Integration are welcome :)

Components and requirements

Component installation

  1. Install and configure your Drupal installation, (*3)

  2. Download Composer in the root of your project, (*4)

    curl -s https://getcomposer.org/installer | php
  1. If not present create in the root of your project a file with name composer.json with this content:
    {
        "require": {
            "vincenzodibiaggio/testable-drupal": "*"
        },
        "minimum-stability": "dev",
        "config": {
            "bin-dir": "bin/"
        }
    }
  1. Download dependencies in your project directory
    php composer.phar install
  1. Download Selenium server, (*5)

  2. Download PhantomJs, (*6)

  3. Download CasperJs - Pay attention: to use all of feature the minimum version is 1.1-beta1 !, (*7)

  4. Puth both PhantomJs and CasperJs executables in your PATH, (*8)

Configuration

Now Testable Drupal support two test suite 1. 'PHP': Behat/Mink/Selenium/PhantomJs using deep Drupal integration 2. 'JS': PhantomJs/CasperJs to deep interface behavior testing, (*9)

Testable Drupal 'PHP'

Configuration

  1. Modify paths and host in tests/behat_dist.yml : wd_host , root, drupal_root
  2. If you want you can rename behat_dist.yml in behat.yml but if you launch behat --init you overwrite it!

(if you launch a behat --init for error you can use the FeatureContext_dist.php to replace the new file), (*10)

Run suite

  1. Run Selenium2
    java -jar selenium-server-standalone-YOUR_VERSION.jar -role hub
  1. Run PhantomJs
    phantomjs --webdriver=8080 --webdriver-selenium-grid-hub=http://127.0.0.1:4444
  1. Run tests
    cd vendor/vincenzodibiaggio/testable-drupal/tests
    ./../../../../bin/behat --config behat_dist.yml features/test.feature

Testable Drupal 'JS'

Configuration

  1. Modify values in testable-drupal/jsTests/includes/includeCasper.js - I'm working in a better integration with Drupal

I recommend to you: put both PhantomJs and CasperJs executables in your PATH. They work fine together without configuration ;), (*11)

Run suite

  1. Just run the test: (if you respect the order of filenames you will create nodes and make other test on it... otherwise you will test a failure :D )
    cd vendor/vincenzodibiaggio/testable-drupal/jsTests
    casperjs test FILENAME

The Versions

31/07 2013

dev-master

9999999-dev

A simple set of tools and files to make your Drupal Installation a Testable Drupal Installation Based on Behat, Mink and using Selenium2, Phantomjs and CasperJs, provide a basic structure to integrate with your tests.

  Sources   Download

GPL-2.0

The Requires

 

by Vincenzo Di Biaggio

test behat drupal phantomjs mink casperjs selenium2