Download the PHP package creativesoftworks/behat-wiremock-context-extension without Composer
On this page you can find all versions of the php package creativesoftworks/behat-wiremock-context-extension. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download creativesoftworks/behat-wiremock-context-extension
More information about creativesoftworks/behat-wiremock-context-extension
Files in creativesoftworks/behat-wiremock-context-extension
Package behat-wiremock-context-extension
Short Description A Behat Extension that makes use of Wiremock as a test double for API calls
License MIT
Homepage https://github.com/creativesoftworks/BehatWiremockContextExtension
Informations about the package behat-wiremock-context-extension
BehatWiremockContextExtension
A Behat Extension that makes use of Wiremock as a test double for API calls.
Versions and compatibility
- Versions 1.x are compatible with behat 2.4+
- No compatibility for behat 3 (yet...)
- No compatibility for Windows
Installation
Via composer:
Your FeatureContext class must implement the CreativeSoftworks\BehatWiremockContextExtension\WiremockContextAware interface, here's an example:
Configuration
Configuration options, in your behat.yml:
The extension will reset the wiremock mappings before each scenario execution, so all mappings under wiremock_mappings_path will get loaded with no guaranteed order. Frequently you would want to guarantee that certain mappings will become defaults in wiremock (usually successful responses instead of failed ones). In order for that to happen you can define an array of mappings to be loaded, relative to wiremock_mappings_path, like in this example:
Usage Example:
The WiremockContext provides a step definition to submit mappings to wiremock. Here's an example of a scenario using it:
The first step in the scenario POSTs the mapping information in the file %wiremock_mappings_path%/greeting/helloWorld.json to the Wiremock server. Check this for more information about wiremock stubbing using JSON mapping files.