Drupal

Behat Mink: 09 - CLI Options Behat v2.5 Guide

 

Gherkin Filters

If you want to run only part of your suite, or some scenarios, you can do it with name or tags filters.

Tag filters supports three logical operators:

  • Tags separated by commas will be combined using the OR operation
  • Tags separated by && will be combined using the AND operation
  • Tags preceded by ~ will be excluded using the NOT operation

For example:

Behat Mink: 05 - regions in behat.yml

 

 

behat.yml

  • added region_map: footer: "#footer"
default:
  suites:
    default:
      contexts:
      - FeatureContext
      - Drupal\DrupalExtension\Context\DrupalContext
      - Drupal\DrupalExtension\Context\MinkContext
      - Drupal\DrupalExtension\Context\MessageContext
      - Drupal\DrupalExtension\Context\DrushContext
  extensions:
    Behat\MinkExtension:
      goutte: ~
      selenium2: ~
      base_url: http://unityconstruct.org/uc/
    Drupal\DrupalExtension:
      blackbox: ~
      region_map:
        footer: "#footer"

 

 

 

Behat Mink: 03 - First working

cmder session with passing results

  •  
T:\git\behatmink
λ bin\behat
Feature: Product basket
  In order to buy products
  As a customer
  I need to be able to put interesting products into a basket

  Rules:
  - VAT is 20%
  - Delivery for basket under $10 is $3
  - Delivery for basket over $10 is $2

  Scenario: Buying a single product under $10               # features\basket.feature:11
    Given there is a "Sith Lord Lightsaber", which costs $5 # FeatureContent::thereIsAWhichCosts()
    When I add the "Sith Lord Lightsaber" to the basket     # FeatureContent::iAddTheToTheBasket()
    Then I should have 1 product in the basket              # FeatureContent::iShouldHaveProductInTheBasket()
    And the overall basket price should be $9               # FeatureContent::theOverallBasketPriceShouldBe()

  Scenario: Buying a single product over $10                 # features\basket.feature:17
    Given there is a "Sith Lord Lightsaber", which costs $15 # Featu

Behat Mink: 02 - Drupal Extension(& Mink ) Framework (Inital State)

Behat Quick Start

 

Comoposer.json

{
  "require":{
      "drupal/drupal-extension":"~3.0",
      "guzzlehttp/guzzle" : "^6.0@dev"
    },
      "config":{
        "bin-dir":"bin/"
      }
}
    

Behat.yml

default:
  suites:
    default:
      contexts:
       - FeatureContent
       - Drupal\Extension\Context\DrupalContext
       - Drupal\Extension\Context\MinkContext
       - Drupal\Extension\Context\MessageContext
       - Drupal\Extension\Context\DrushContext
  extensions:
    Behat\MinkExtension:
      goutte: ~
      selenium2: ~
      base_url: http://unityconstruct.org
    Drupal\DrupalExtension:
      blackbox: ~

 

Get Composer & Compile

 

Subscribe to Drupal