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

Commit

Permalink
added addtional documents, added examples to all step definitions for…
Browse files Browse the repository at this point in the history
… additional clarity when running 'behat -di' or 'behat -dl'
  • Loading branch information
Sajjad Hossain committed Jun 1, 2015
2 parents 1d12b01 + 981c7f6 commit f07c3e9
Showing 1 changed file with 16 additions and 15 deletions.
31 changes: 16 additions & 15 deletions src/Behat/MinkExtension/Context/MinkContext.php
Expand Up @@ -38,8 +38,8 @@ public function iAmOnHomepage()
/**
* Opens specified page
* Example: Given I am on "http://batman.com"
* Example: When I am on "http://batman.com"
* Example: And I go to "http://batman.com"
* Example: And I am on "/articles/isBatmanBruceWayne"
* Example: When I go to "/articles/isBatmanBruceWayne"
*
* @Given /^(?:|I )am on "(?P<page>[^"]+)"$/
* @When /^(?:|I )go to "(?P<page>[^"]+)"$/
Expand All @@ -56,6 +56,7 @@ public function visit($page)
* Example: And I reload the page
*
* @When /^(?:|I )reload the page$/
*
*/
public function reload()
{
Expand Down Expand Up @@ -118,7 +119,7 @@ public function clickLink($link)

/**
* Fills in form field with specified id|name|label|value
* Example: Given I fill in "username" with: "bwayne"
* 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 Down Expand Up @@ -481,6 +482,18 @@ 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 All @@ -496,18 +509,6 @@ public function assertCheckboxNotChecked($checkbox)
$this->assertSession()->checkboxNotChecked($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));
}

/**
* Prints current URL to console.
* Example: Then print current URL
Expand Down

0 comments on commit f07c3e9

Please sign in to comment.