nuvoleweb/drupal-behat

Drupal Behat extension.

Installs: 452 411

Dependents: 4

Suggesters: 0

Security: 0

Stars: 34

Watchers: 9

Forks: 24

Open Issues: 4

Type:behat-extension

1.3.0 2023-11-09 15:14 UTC

README

Build Status Scrutinizer Code Quality Latest Stable Version Latest Unstable Version Total Downloads License

Nuvole's Behat Drupal Extension extends the popular Behat Drupal Extension in order to provide the following features:

  • Additional step definitions covering contributed modules, core functionality and popular third-party plugins.
  • Contexts can access the global Behat service container.
  • Developers can organize their test using dependency injection by declaring their services in a YAML file and/or override default Behat services.
  • Developers can override Drupal driver core classes and allow their step definitions to run transparently on different Drupal core versions.

For more information please check the documentation.

Installation and setup

Install Nuvole's Behat Drupal Extension with Composer by running:

$ composer require nuvoleweb/drupal-behat

Setup the extension by following the Quick start section available on the original Behat Drupal Extension page, just use NuvoleWeb\Drupal\DrupalExtension instead of the native Drupal\DrupalExtension in your behat.yml as shown below:

default:
  suites:
    default:
      contexts:
        - Drupal\DrupalExtension\Context\DrupalContext
        - NuvoleWeb\Drupal\DrupalExtension\Context\DrupalContext
        ...
  extensions:
    Behat\MinkExtension:
      goutte: ~
      ...
    # Use "NuvoleWeb\Drupal\DrupalExtension" instead of "Drupal\DrupalExtension".
    NuvoleWeb\Drupal\DrupalExtension:
      api_driver: "drupal"
      ...
      services: "tests/my_services.yml"
      text:
        node_submit_label: "Save and publish"

Extension settings

Nuvole's Behat Drupal Extension accepts all parameters of the original Behat Drupal Extension and it provides the following additional ones:

Parameter Description
services: "tests/my_services.yml" Path to your custom service definition YAML file.
text.node_submit_label: "Save and publish" Label of node form submit button (different in Drupal 7/6 and Drupal 8).

Additional resources