Introduction to Mink Behat

Profile picture for user devraj

Mink is an open source browser controller/emulator for web applications. In order to test user interaction and to ensure web application behaves correctly, we need a way to simulate user interaction between the browser and the web application in our tests. For this we need Mink. Mink help you to choose best emulator for your project by removing API differences between different browser emulators, by providing different drivers, for every browser emulator. 

There are two types of browser emulator, Headless and browser controller. Main difference between both is that headless are faster but provide no support for JS/Ajax, while browser emulator like selenium provide support for JS/Ajax but are slower compare to headless. Also browser controller like Selenium and Sahi require an installed browser and extra configuration. In real world application we need to use both browser Headless and browser contoller for our project.

Some Key Points about Mink

  • Mink is a library that allows you to browse application programmatically and access its contents.
  • Mink is a PHP 5.3+ library that you'll use inside your test and feature suites.
  • Lead developers of Mink are Konstantin Kudryashov, Christophe Coevoet and Alexander Obuhovich.
  • Mink is Integrated with Behat using MinkExtension. The extension takes care of all configuration and initialization of the Mink.
  • Mink always talks with browser emulators through its driver. 
  • Mink is an open source browser controller/emulator for web applications which you can install using Composer.
Tags