behat/mink-extension
's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.Name | Version | Size | License | Type | Vulnerabilities |
---|---|---|---|---|---|
behat/behat | v3.14.0 | - | MIT | prod | 1 |
behat/mink | v1.11.0 | - | MIT | prod | |
symfony/config | v4.4.44 | - | MIT | prod dev |
The Behat/MinkExtension is a robust integration layer that bridges the gap between Behat 3.0+ and Mink 1.5+. Its primary role is to provide additional services for Behat, such as Mink, Sessions, and Drivers. Simultaneously, it offers Behat\MinkExtension\Context\MinkAwareContext
that delivers a Mink instance for your contexts. The base context Behat\MinkExtension\Context\MinkContext
is endowed with essential step definitions and hooks for your contexts or sub-contexts. This basic context can either be used independently or provide a reliable foundation for more specific contexts.
To utilize the Behat/MinkExtension, you must first install it in your project. For this, use the composer tool. Here is a simple command you should use in your terminal:
composer require --dev behat/mink-extension
After successfully installing the extension, you should activate it in your Behat suites. In your Behat project’s behat.yml configuration file, add the MinkExtension and configure your browser simulator:
default:
extensions:
Behat\MinkExtension:
base_url: http://example.com
sessions:
default:
goutte: ~
Here, we used goutte
as the default web browser simulator for non-JS scenarios. Use this in your feature context files, and Mink will become available as a service.
<?php
namespace FeatureContext extends \Behat\MinkExtension\Context\MinkContext
{
// your context methods go here
}
In the code above, FeatureContext
class extends MinkContext
, giving it access to Mink and all its functionality.
The official documentation of Behat/MinkExtension is accessible and provides an in-depth explanation of how to make the most of this extension. You can find this information on the Official documentation. Documentation comes with details on what the extension offers, how to use it efficiently and keep up-to-date with its features.