2017 © Pedro Peláez
 

library behat-drupal-utils

Provides utilities for running smoke tests and various useful behat contexts.

image

drunomics/behat-drupal-utils

Provides utilities for running smoke tests and various useful behat contexts.

  • Monday, April 30, 2018
  • by fago
  • Repository
  • 1 Watchers
  • 0 Stars
  • 211 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 314 % Grown

The README.md

drunomics Behat Drupal utils

Dependencies:

  • Behat
  • Drupal
  • Drupal Extension
  • Behat Driver with Javascript enabled (e.g. dmore/behat-chrome-extension)

The javascript step definitions are all tested with dmore/behat-chrome-extension., (*1)

Overview:

The package provides:, (*2)

  • Various useful behat contexts, organized the following context classes:, (*3)

    • DrupalUtilsApiContext
    • DrupalUtilsDrushContext
    • MinkUtilsContext
    • HttpHeadersContext

    Depending on your behat configuration, the suiting context classes should be added in. It automatically includes all compatible step definitions., (*4)

  • Optional additional context classes that add automatic checks or cleanup routines like:
    • DrupalCleanTestContentApiContext
    • DrupalErrorCheckApiContext

Smoke tests

The tests below ./examples/ ensure a simple Drupal login/logout works and a page of your site can be opened, while frontend assets are loaded and no javascript or watchdog errors are triggered., (*5)

Setup

  • Add this package to your project's dev dependencies.
  • Add one of the three context to your behat.yml, optionall also add optional contexts.
  • Feel free to copy the example behat features.
  • Add the provided js file to your sites js. The listener is required to catch js errors.

Detecting watchdog errors

Default behaviour

When DrupalErrorCheckApiContext is added, all watchdog entries excluding Notice, Info and Debug will be detected and trigger PHP errors in the behat PHP runner automatically., (*6)

Adjusting watchdog entries severity to NOTICE level

To change the error detection severity to NOTICE set the fail_on_notice parameter in the behat.yml to TRUE., (*7)

contexts:
  - drunomics\BehatDrupalUtils\Context\DrupalErrorCheckApiContext:
      fail_on_notice: TRUE

Credits

developed by drunomics GmbH, hello@drunomics.com Please refer to the commit log individual contributors., (*8)

The Versions

30/04 2018

1.x-dev

1.9999999.9999999.9999999-dev https://github.com/drunomics/behat-drupal-smoke

Provides utilities for running smoke tests and various useful behat contexts.

  Sources   Download

GPL-2.0+

by drunomics GmbH

behat drupal smoke smoketest logintest

30/04 2018

1.0.0

1.0.0.0 https://github.com/drunomics/behat-drupal-smoke

Provides utilities for running smoke tests and various useful behat contexts.

  Sources   Download

GPL-2.0+

by drunomics GmbH

behat drupal smoke smoketest logintest