Skip to main content

Behat Drupal Extension Stand-alone installation

There are 2 types of installation described by Drupal Extension official website. First one is Stand-alone installation. A stand-alone installation is recommended when you want your tests and testing environment to be portable, from local development to CI server, to client infrastructure. It also makes documentation consistent and reliable.

Step 1: Create folder for your BDD tests:

$ mkdir projectfolder
$ cd projectfolder

Step 2: Install Composer, PHP package manager:

$ curl -s https://getcomposer.org/installer | php

Step 3: Create a composer.json file to tell Composer what to install. To do that, paste the following code into your editor and save as composer.json. The Drupal Extension requires Behat, Mink, and the Mink Extension. They will all be set up because they’re dependencies of the Drupal Extension, so you don’t have to specify them directly in the composer.json file:

{
  "require": {
    "drupal/drupal-extension": "^3.2"
  },
  "config": {
    "bin-dir": "bin/"
  }
}

Step 4: Run the following command to install the Drupal Extension and all those dependencies. This takes a while before you start to see output:

$ php composer.phar install

Step 5: Test that your installation work by typing below command:

$ bin/behat --help

 If you were successful, you’ll see the help output.

Submitted by tgoswami on November 5, 2020

Tarun has 11+ years of experience in Quality Assurance in different domains like Banking, E-commerce, Health and Education.

About

At ProgramsBuzz, you can learn, share and grow with millions of techie around the world from different domain like Data Science, Software Development, QA and Digital Marketing. You can ask doubt and get the answer for your queries from our experts.