3. BDD Workflow In Large Organisations
Business Analyst Designers
Tester
Developer
Tester
Business Analyst
Thursday, 18 October 12
4. BDD Workflow In Large Organisations
Business Analyst Designers
Tester
Concepts
Implementation
Developer
Thursday, 18 October 12
5. Example Steps Shipped With Mink Extension
Scenario: Searching for a page that does exist
Given I am on "/wiki/Main_Page"
When I fill in "search" with "Behavior Driven Development"
And I press "searchButton"
Then I should see "agile software development"
When /^(?:|I )fill in "(?P<field>(?:[^"]|")*)" with "(?P<value>(?:[^"]|")*)"$/
When /^(?:|I )press "(?P<button>(?:[^"]|")*)"$/
Thursday, 18 October 12
6. Problems Encountered At Sky / Orange
• Mink requires implementation details
• Test teams with no PHP skills
• Difficulty identifying elements on the page using Mink
Extension
Thursday, 18 October 12
8. Example
test.feature
Given I go to the page "Home Page"
When I follow the link "Add Subscription"
And I fill in the "first name box" field with "ben"
Then the "first name box" form field should contain "ben"
And I press the "test" button
And the "Widget" should contain "Area One Text"
selectors.yml
Add Subscription: "a.self-link"
first name box: "form#name_form
input[name=first_name]"
test: "form#name_form input[name=submit]"
Widget: div#user_widget
urls.yml
Home Page: "/"
Element Page: "/element.html"
Thursday, 18 October 12
9. Steps Shipped With Business Selector Extension
Given I go to the page "<PAGE NAME>"
When I follow the link "<LINK>"
When I click the "<CLICKABLE ELEMENT>"
When I press the "<BUTTON>" button
When I fill in the "<TEXT INPUT>" field with "value"
When the "<TEXT INPUT>" form field should not contain "value"
When I select "value" from the "<SELECT OR MULTISELECT>" selector
When I additionally select "value" from the "<MULTISELECT>" selector
When I check the "<CHECKBOX>" checkbox
When I uncheck the "<CHECKBOX>" checkbox
When I focus on the "<IFRAME (RELATES TO ID OR INDEX)>" iframe
When I refocus on the primary page
When I hover over "<PAGE ELEMENT>"
When I wait for the "<PAGE ELEMENT>" component to [dis]appear
Then the "<PAGE ELEMENT>" should contain "value"
Then the "<PAGE ELEMENT>" should not contain "value"
Then I should see "<PAGE ELEMENT>" component
Then I should not see "<PAGE ELEMENT>" component
Then "<PAGE ELEMENT>" should contain "<PAGE ELEMENT>"
Then "<PAGE ELEMENT>" should not contain "<PAGE ELEMENT>"
Then the "<CHECKBOX>" should be checked
Then the "<CHECKBOX>" should not be checked
Then the "<TEXT INPUT>" form field should contain "value"
Thursday, 18 October 12
10. Some Extra Steps Dealing With Common Tasks
When I focus on the "<IFRAME (RELATES TO ID OR INDEX)>" iframe
When I refocus on the primary page
Given I attach <FILEPATH> to <PAGEELEMENT>
When I wait for the "<PAGE ELEMENT>" component to [dis]appear
Thursday, 18 October 12
12. Extension Use
<?php
// Namespaces ...
class FeatureContext extends BehatContext
{
public function __construct(array $parameters)
{
$this->useContext('mink', new MinkContext($parameters));
$this->useContext('BS', new BusinessSelectorContext($parameters));
}
}
Thursday, 18 October 12