Download the PHP package alnutile/business-selector-extension without Composer
On this page you can find all versions of the php package alnutile/business-selector-extension. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download alnutile/business-selector-extension
More information about alnutile/business-selector-extension
Files in alnutile/business-selector-extension
Package business-selector-extension
Short Description CSS Selector Substitution For Behat
License MIT
Homepage http://github.com/orangedigital/business-selector-extension
Informations about the package business-selector-extension
Business Selectors For Behat
Introduction
--
The original project can be seen here https://github.com/orangedigital/business-selector-extension
And many notes still apply below. I needed to simplify it a bit for the project I am using it on though it still is extendable to to other projects.
Basically I do not want errors thrown if a token is not found since it can default back to the string the user used and then let Behat error out as needed
--
The Mink Extension for Behat is an excellent way to quickly get up and running with web acceptance testing. It allows the user to specify HTML elements on the page using common attributes like 'title', 'alt' and 'value'. Some steps allow the use of CSS selectors inline in the Gherkin files.
While this approach is great it has a few draw backs:
1) The attribute values may not always be the most business friendly and can reduce the readability of the Gherkin scenarios.
2) Sometimes it isn't possible to identify an element using the attributes the MinkExtension provides.
3) By using these attributes directly in the Gherkin files, they become tightly coupled to the front end implementation. Gherkin should express business requirements rather than implementation details.
Business Selectors for Behat allow the user to use steps very similar to the ones provided by the MinkExtension to describe elements on the page in business terms. At the time the test is run the business terms are swapped for a CSS selector which is maintained in a yml file.
Example
Gherkin Written With Steps Provided By BusinessSelectorsExtension
` The quoted values map to the values in the file configured in behat.yml by the parameter 'selectorFilePath'.
`
Installation
The best way to install the contexts is by using composer.
1) For instructions on installing Behat see: behat.org
2) Add in the following to the composer.json of the project you'd like to test.
`
3) Add the OrangeDigital\BusinessSelectorExtension\Extension section to your behat.yml file as in the example below.
`
4) Amend your FeatureContext file to use the BusinessSelectorContext file.
``
Installation: Examples
Install the provided examples by moving the html files in 'example/www' to the web root of a local webserver or create a vhost pointing to 'example/www'.
Edit 'example/behat.yml' 'base_url' to point to your the url of web root above.
Run ../bin/behat
Steps Provided By Business Selectors
Bellow are a list of steps provided by the business selector extension. Values in \<BRACKETS> denote arbitrary business friendly names which should match CSS selectors in the relevant config file (specified in behat.yml by 'urlFilePath' and 'selectorFilePath'). See the provided example implementation for details.
The URL below should be placed in the URLS file specified in behat.yml by the parameter "urlFilePath"
`
` Note: This requires the assetPath to be configured to a relative directory that contains your assets (e.g. assetPath: assets/). Filename must include the extension associated with the file (e.g. example.jpeg).
All CSS Selectors below should be placed in the CSS selector file specified in behat.yml by the parameter "selectorFilePath"
`
`
`
`
`
`
`
`
`
` Note: The step above is the only step where the selector MUST be an ID. If the iframe does not have an ID, you can provide the index of the iframe, where 0 relates to the first iframe, 1 the second etc. An example of this can be found in example/features/example.feature
``
`
`
`
`
`
`
`
`
`
`
`
All versions of business-selector-extension with dependencies
behat/behat Version >=2.4@stable
behat/mink-extension Version *
symfony/config Version >=2.0.0,<2.2.0
symfony/dependency-injection Version >=2.0.0,<2.2.0