Skip to content
This repository has been archived by the owner on Mar 20, 2024. It is now read-only.

Commit

Permalink
removed incorrect usage of Given, removed excess comment breaks, fixe…
Browse files Browse the repository at this point in the history
…d order of methods (done in error), removed some instances of AND
  • Loading branch information
Sajjad Hossain committed Jun 9, 2015
1 parent f07c3e9 commit 2b0bdec
Showing 1 changed file with 12 additions and 29 deletions.
41 changes: 12 additions & 29 deletions src/Behat/MinkExtension/Context/MinkContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,10 @@ public function visit($page)

/**
* Reloads current page
* Example: Given I reload the page
* Example: When I reload the page
* Example: And I reload the page
*
* @When /^(?:|I )reload the page$/
*
*/
public function reload()
{
Expand All @@ -65,9 +63,7 @@ public function reload()

/**
* Moves backward one page in history
* Example: Given I move backward one page
* Example: When I move backward one page
* Example: And I move backward one page
*
* @When /^(?:|I )move backward one page$/
*/
Expand All @@ -78,8 +74,6 @@ public function back()

/**
* Moves forward one page in history
* Example: Given I move forward one page
* Example: When I move forward one page
* Example: And I move forward one page
*
* @When /^(?:|I )move forward one page$/
Expand All @@ -91,7 +85,6 @@ public function forward()

/**
* Presses button with specified id|name|title|alt|value
* Example: Given I press "Log In"
* Example: When I press "Log In"
* Example: And I press "Log In"
*
Expand All @@ -105,7 +98,6 @@ public function pressButton($button)

/**
* Clicks link with specified id|title|alt|text
* Example: Given I follow "Log In"
* Example: When I follow "Log In"
* Example: And I follow "Log In"
*
Expand All @@ -119,7 +111,6 @@ public function clickLink($link)

/**
* Fills in form field with specified id|name|label|value
* Example: Given I fill in "username" with "bwayne"
* Example: When I fill in "username" with: "bwayne"
* Example: And I fill in "bwayne" for "username"
*
Expand All @@ -136,9 +127,6 @@ public function fillField($field, $value)

/**
* Fills in form fields with provided table
* Example: Given I fill in the following"
* | username | bruceWayne |
* | password | iLoveBats123 |
* Example: When I fill in the following"
* | username | bruceWayne |
* | password | iLoveBats123 |
Expand All @@ -157,7 +145,6 @@ public function fillFields(TableNode $fields)

/**
* Selects option in select field with specified id|name|label|value
* Example: Given I select "Bats" from "user_fears"
* Example: When I select "Bats" from "user_fears"
* Example: And I select "Bats" from "user_fears"
*
Expand All @@ -172,7 +159,6 @@ public function selectOption($select, $option)

/**
* Selects additional option in select field with specified id|name|label|value
* Example: Given I additionally select "Deceased" from "parents_alive_status"
* Example: When I additionally select "Deceased" from "parents_alive_status"
* Example: And I additionally select "Deceased" from "parents_alive_status"
*
Expand All @@ -187,7 +173,6 @@ public function additionallySelectOption($select, $option)

/**
* Checks checkbox with specified id|name|label|value
* Example: Given I check "Pearl Necklace" from "itemsClaimed"
* Example: When I check "Pearl Necklace" from "itemsClaimed"
* Example: And I check "Pearl Necklace" from "itemsClaimed"
*
Expand All @@ -201,7 +186,6 @@ public function checkOption($option)

/**
* Unchecks checkbox with specified id|name|label|value
* Example: Given I uncheck "Broadway Plays" from "hobbies"
* Example: When I uncheck "Broadway Plays" from "hobbies"
* Example: And I uncheck "Broadway Plays" from "hobbies"
*
Expand All @@ -215,7 +199,6 @@ public function uncheckOption($option)

/**
* Attaches file to field with specified id|name|label|value
* Example: Given I attach "bwayne_profile.png" to "profileImageUpload"
* Example: When I attach "bwayne_profile.png" to "profileImageUpload"
* Example: And I attach "bwayne_profile.png" to "profileImageUpload"
*
Expand Down Expand Up @@ -469,6 +452,18 @@ public function assertFieldNotContains($field, $value)
$this->assertSession()->fieldValueNotEquals($field, $value);
}

/**
* Checks, that (?P<num>\d+) CSS elements exist on the page
* Example: Then I should see 5 "div" elements
* Example: And I should see 5 "div" elements
*
* @Then /^(?:|I )should see (?P<num>\d+) "(?P<element>[^"]*)" elements?$/
*/
public function assertNumElements($num, $element)
{
$this->assertSession()->elementsCount('css', $element, intval($num));
}

/**
* Checks, that checkbox with specified in|name|label|value is checked
* Example: Then the "remember_me" checkbox should be checked
Expand All @@ -482,18 +477,6 @@ public function assertCheckboxChecked($checkbox)
$this->assertSession()->checkboxChecked($this->fixStepArgument($checkbox));
}

/**
* Checks, that (?P<num>\d+) CSS elements exist on the page
* Example: Then I should see 5 "div" elements
* Example: And I should see 5 "div" elements
*
* @Then /^(?:|I )should see (?P<num>\d+) "(?P<element>[^"]*)" elements?$/
*/
public function assertNumElements($num, $element)
{
$this->assertSession()->elementsCount('css', $element, intval($num));
}

/**
* Checks, that checkbox with specified in|name|label|value is unchecked
* Example: Then the "newsletter" checkbox should be unchecked
Expand Down

0 comments on commit 2b0bdec

Please sign in to comment.