---
url: 'https://metadrop.net/en/articles/sevilla-drupal-camp-behat-workshop'
title: 'Sevilla Drupal Camp Behat workshop'
author: 'Ricardo Sanz'
date: '2023-09-25T08:30:12+00:00'
updated: '2026-08-04T11:05:41+00:00'
type: article
summary: 'At the Drupal Camp in Sevilla, a practical introductory workshop to Behat was offered, which can now also be done at home thanks to the publication of the presentation and the repository with the dev environment to do the exercises.'
tags:
  - 'Drupal Planet'
  - Behat
  - Workshop
  - DrupalCamp
  - DrupalCampEs
  - Testing
published: true
og:
  determiner: Automatic
  site_name: Metadrop
  'image:alt': 'Sevilla Drupal Camp Behat workshop'
  street_address: 'Calle Manuel Luna, 12, 3 Dcha'
  locality: Madrid
  region: Madrid
  postal_code: '28020'
  country_name: España
  email: hola@metadrop.net
  phone_number: '910053180'
schema:
  '@context': 'https://schema.org'
  '@graph':
    -
      '@type': Article
      '@id': 'https://metadrop.net/en/articles/sevilla-drupal-camp-behat-workshop#article'
      name: 'Sevilla Drupal Camp Behat workshop'
      headline: 'Sevilla Drupal Camp Behat workshop'
      description: 'At the Drupal Camp in Sevilla, a practical introductory workshop to Behat was offered, which can now also be done at home thanks to the publication of the presentation and the repository with the dev environment to do the exercises.'
      about:
        - Behat
        - Workshop
        - DrupalCamp
        - DrupalCampEs
        - Testing
      datePublished: '2023-09-25T10:30:12+0200'
      dateModified: '2026-08-04T13:05:41+0200'
      author:
        '@type': Person
        name: 'Ricardo Sanz'
      publisher:
        '@type': Organization
        '@id': 'https://metadrop.net/#organization'
      mainEntityOfPage: 'https://metadrop.net/en/articles/sevilla-drupal-camp-behat-workshop'
    -
      '@type': Organization
      '@id': 'https://metadrop.net/#organization'
      url: 'https://metadrop.net/'
      name: Metadrop
      sameAs:
        - 'https://www.drupal.org/metadrop'
        - 'https://twitter.com/metadrop'
        - 'https://asociaciondrupal.es/partner/metadrop'
        - 'https://www.linkedin.com/company/metadrop'
      logo:
        '@type': ImageObject
        url: 'https://metadrop.net/themes/custom/mdrop_radix/logo-metadrop-500-500.jpg'
        width: '500'
        height: '500'
    -
      '@type': ItemPage
      '@id': 'https://metadrop.net/en/articles/sevilla-drupal-camp-behat-workshop'
      breadcrumb:
        '@type': BreadcrumbList
        itemListElement:
          -
            '@type': ListItem
            position: 1
            name: Home
            item: 'https://metadrop.net/en'
          -
            '@type': ListItem
            position: 2
            name: 'Expert Drupal & Tech Articles'
            item: 'https://metadrop.net/en/articles'
      publisher:
        '@type': Organization
        '@id': 'https://metadrop.net/#organization'
---
 1. [Articles](https://metadrop.net/en/articles)
 
  

# Sevilla Drupal Camp Behat workshop

Monday, September 25, 2023

 

 



At the Drupal Camp in Sevilla, a practical introductory workshop to Behat was offered, which can now also be done at home thanks to the publication of the presentation and the repository with the dev environment to do the exercises.



   



For this year's Drupal Camp a [joint effort has been made to offer three different workshops on testing with Drupal](https://metadrop.net/en/articles/sevilla-drupal-camp-behat-workshop "Potenciando la calidad en Drupal"). One of them was a Behat workshop where a theoretical basis was given and different **practical exercises with Behat** were proposed.

Through this article we want to make this same Behat workshop available to anyone who is interested so that they access the presentation and the exercises. Unfortunately, the slides are only available in Spanish. However, the exercises are written in English so **even if you don't speak Spanish you may benefit of doing the practical part**.

## The workshop

The workshop uses two repositories, the first is **a presentation** used as a guide for the workshop, and the second is a p**re-configured environment** with Behat ready to be run.

The presentation can be [viewed online](https://rsanzante.github.io/drupalcampspain-2023-presentacion-taller-behat/ "Behat workshop slides") directly from the browser. It consists of three parts:

1. A very **basic introduction to Behat**, supported by more information during the practical part.
2. How to **configure the environment** to perform the exercises using the second repository. This step is **very simple** as it is based on [Metadrop's Boilerplate](https://github.com/Metadrop/drupal-boilerplate "Metadrop's Bolierplate"), which includes a set of Docker containers already configured to run Drupal and Behat (as well as other tools).
3. The **practical part**, where exercises are presented in the form of user stories to be written using Behat.

The interesting thing about the practical part is that all the **exercises have a solution** that can be consulted to validate the exercise. This allows the doer to have at least one reference solution to each problem.

## How to

First go to the [workshop's slides](https://rsanzante.github.io/drupalcampspain-2023-presentacion-taller-behat "Workshop slides"). Read the first part with the introduction to Behat. Since it is a presentation, there are not many details but you can learn more in the [official Behat documentation](https://behat.org/en/latest/guides.html "Official Behat docs") or in other references you can find.

For the practical part, check the slide "Montar entorno" (which is duplicated, once at the beginning of the presentation and then at the beginning of the practical part), where you can find the the **three simple commands** required:

1. Clone the repo:
    
    ```bash
    git clone git@github.com:rsanzante/drupalcampspain2023-behat-workshop.git
    ```
2. Install PHP pacakges (run inside the cloned repository):
    
    ```bash
    composer install              
    ```
3. Run the assistant to configure the environment:
    
    ```bash
    composer boilerplate:assistant
    ```
    
    The assitant will ask several questions but the default values are fine except the profile to install: **you must select the Umami profile**. This is because the workshop makes use of the functionalities and content of this demo profile that comes with the Drupal core. It also asks whether to create a Radix subtheme; although we can leave the default option (yes), it is not required for the workshop and it takes a while to generate it, so it's better not to generate it.

The exercise repository contains a workshop branch and several tags:

 

 

*Commits and repository tags from the practical part. The dev branch and "Initial commit" commit are generated by the assistant and can be ignored (or select not to initialise the Git repository so that it doesn't add the branch and commit).*

Start by **jumping to the first tag**, *initial-setup*, and test that Behat works (`make shell` and then just `behat`). Then, checkout the tag of the **first exercise** (*us1-exercise*) and check the directory *tests/functional/behat/features/umami/* to find the exercise. Once done, you can checkout the next tag to **see the suggested solution** (*us1-solution*). This cycle is repeated for all exercises.

Each exercise is completed in a file and the solution is in another file, so that both solutions can coexist (the suggested one and the one wrote by the person doing the workshop). In fact, the suggested solutions are not executed because the files do not have the `.feature` extension. The last commit renames the suggested solutions by adding this extension, so that these solutions can be tested quickly and easily.

Slides' URL: [https://rsanzante.github.io/drupalcampspain-2023-presentacion-taller-behat/](https://rsanzante.github.io/drupalcampspain-2023-presentacion-taller-behat)

URL to clone exercises repository: git@github.com:rsanzante/drupalcampspain2023-behat-workshop.git



[Behat](https://metadrop.net/en/articles?text=Behat)

[Workshop](https://metadrop.net/en/articles?text=Workshop)

[DrupalCamp](https://metadrop.net/en/articles?text=DrupalCamp)

[DrupalCampEs](https://metadrop.net/en/articles?text=DrupalCampEs)

[Testing](https://metadrop.net/en/articles?text=Testing)

 

- Ricardo Sanz
    
    CTO