Automated testing using Behat with Mink

  1. Setup MAMP (Mac) / LAMP (linux) / XAMPP (Windows) (Apache, MySQL and PHP)

  2. System-wide installation of Composer

  3. Local Drupal8  site setup

  4. Any IDE of your choice. (PHPStorm preferred - which comes with a trial version for 30 days)

Preferred to have the above setup prior to training.

However, if the problem faced, please email us on and for resolution.
For people who couldn't set up, please come 30 mins in advance so that we can help you with the setup.

Workshop Details

This exercise is intended for those people who want to get started with automating testing of web applications using Behat with Mink & Drupal extension, exerting the BDD procedure. With the help of Mink extension, you can impersonate user intercommunication with the browser whereas, assimilation of Drupal extension with Behat and Mink will let you automate Drupal specific scenarios when using Drupal as your development technology. 

With both extensions, testers & developers can automate their backend and front-end utilitarian scenarios and thus being a classic fit for an Agile pattern. Behat is ready to use PHP testing framework, which will enable you to get started instantly with automation testing with less code, thereby saving time to even get started with automation activities. It can be set up on Mac, Windows, and Linux and generate readable test reports too with the help of reporting extensions.

Duration: 3-4 hours

Syllabus / Agenda

  1. Introduction to BDD

    1. How does it work in real life?

    2. Why is it used?

  2. Introduction to Behat

    1. What is Behat?

    2. Initialize a Behat project

      1. Explain composer.json and composer.lock in brief

      2. Explain composer install and composer update in brief

    3. Architecture of Behat

  3. Introduction to Gherkin

    1. Hello Gherkin

      1. Background

      2. Scenario

      3. Scenario Outline

      4. Gherkin keywords

    2. Write your first feature file

    3. Let’s try execution together

  4. Introduction to Mink: web app testing

    1. What is Mink?

    2. Installing Mink 

    3. Let’s update the composer together

      1. Add dependencies in composer.json

      2. Update the composer

    4. Configuring Mink

      1. Activate the extension in behat.yml

      2. Configure Selenium2 drivers

    5. Let’s extend Mink in the current context

      1.  Modify the FeatureContext file to point to the right context

    6. Ready to use steps in Mink

      1. Interact with all types of web elements

    7. Let’s try executing it together!

      1. Browser-based execution

      2. Execute tests using Headless Chrome

    8. Enhance your tests

      1. Add custom step definitions by minimal PHP coding

    9. Screenshot extension

      1. How screenshots will be taken and saved in the directory.

    10. Reporting extension 

      1. Reporting extension to generate readable test reports

  5. Introduction to Drupal Extension: 

    1. What is Drupal extension?

      1. What does the Drupal extension add to Behat and Mink?

    2. Installing Drupal extension

      1. Add dependencies to install the drupal extension

      2. Update the composer

    3. Configuring Drupal extension

      1. Activate the extension in behat.yml file

      2. Configure the drivers: BlackBox and Drupal API


Learning Objectives

The attendees will gain knowledge about

  • Behaviour Driven Development

  • Getting started with Behat 

  • Writing scenarios in Gherkin language

  • How to automate user interaction with the browser using Mink extension

  • Introduction of Drupal extension and installation process.

  • Write and execute behat scenarios on Mac, Windows or Linux

  • Enhance your tests by writing custom functions (PHP coding knowledge required)


Who Will Gain the Most From This Training?

BDD is one of the most trending technologies in the industry since it helps customers, business people, and the techies to collaborate to achieve the desired results. QA Engineers, Developers, Technical Project Managers willing to automate web applications and ease out the execution of Functional and Regression test cases. Students who wish to have a career in automated testing will be happy to attend this since Behat is an open-source tool and easy to get started with.

Experience Level