boga881/drupal-extension

Drupal extension for Behat

Fund package maintenance!
jhedstrom

Installs: 86

Dependents: 2

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 190

Type:behat-extension

dev-master / 5.0.x-dev 2023-02-15 23:14 UTC

This package is auto-updated.

Last update: 2024-04-16 01:39:29 UTC


README

The Drupal Extension is an integration layer between Behat, Mink Extension, and Drupal. It provides step definitions for common testing scenarios specific to Drupal sites.

ci

The Drupal Extension 5.x supports Drupal 9 and 10, utilizes Behat 3.2+ and runs on:

  • PHP 7.4, 8.0, 8.1 with Drupal 9
  • PHP 8.1 with Drupal 10.

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

Use it for testing your Drupal site.

If you're new to the Drupal Extension, we recommend starting with the Full documentation

Documentation Status

Quick start

  1. Install using Composer:

    mkdir projectdir
    cd projectdir
    curl -sS https://getcomposer.org/installer | php
    COMPOSER_BIN_DIR=bin php composer.phar require drupal/drupal-extension='~5.0'
  2. In the projectdir, create a file called behat.yml. Below is the minimal configuration. Many more options are covered in the Full documentation

default:
  suites:
    default:
      contexts:
        - Drupal\DrupalExtension\Context\DrupalContext
  extensions:
    Drupal\MinkExtension:
      browserkit_http: ~
      base_url: http://example.org/  # Replace with your site's URL
    Drupal\DrupalExtension:
      blackbox: ~
  1. In the projectdir, run

    bin/behat --init
  2. Find pre-defined steps to work with using:

    bin/behat -di
  3. Define your own steps in projectdir\features\FeatureContext.php

  4. Start adding your feature files to the features directory of your repository.

Credits

Additional resources

Examples and code snippets

Release notes

See CHANGELOG.

Contributing

Features and bug fixes are welcome! First-time contributors can jump in with the issues tagged good first issue.

See CONTRIBUTING.md for more information.