diff --git a/README.md b/README.md index 73bc88c..3873c10 100644 --- a/README.md +++ b/README.md @@ -140,6 +140,7 @@ To find out all available steps (and the files they are defined in), run the fol Note: There are more specific step definitions in the SilverStripe `framework` module for interacting with the CMS interfaces (see `framework/tests/behat/features/bootstrap`). +In addition to the dynamic list, a cheatsheet of available steps can be found at the end of this guide. ## Fixtures @@ -324,6 +325,243 @@ Here's a sample profile for your `behat.yml`: browser: "firefox" version: "15" +## Cheatsheet + +### Basics + + Then /^(?:|I )should see "(?P(?:[^"]|\\")*)"$/ + - Checks, that page contains specified text. + + Then /^(?:|I )should not see "(?P(?:[^"]|\\")*)"$/ + - Checks, that page doesn't contain specified text. + + Then /^(?:|I )should see text matching (?P"(?:[^"]|\\")*")$/ + - Checks, that page contains text matching specified pattern. + + Then /^(?:|I )should not see text matching (?P"(?:[^"]|\\")*")$/ + - Checks, that page doesn't contain text matching specified pattern. + + Then /^the response should contain "(?P(?:[^"]|\\")*)"$/ + - Checks, that HTML response contains specified string. + + Then /^the response should not contain "(?P(?:[^"]|\\")*)"$/ + - Checks, that HTML response doesn't contain specified string. + + Then /^(?:|I )should see "(?P(?:[^"]|\\")*)" in the "(?P[^"]*)" element$/ + - Checks, that element with specified CSS contains specified text. + + Then /^(?:|I )should not see "(?P(?:[^"]|\\")*)" in the "(?P[^"]*)" element$/ + - Checks, that element with specified CSS doesn't contain specified text. + + Then /^the "(?P[^"]*)" element should contain "(?P(?:[^"]|\\")*)"$/ + - Checks, that element with specified CSS contains specified HTML. + + Then /^(?:|I )should see an? "(?P[^"]*)" element$/ + - Checks, that element with specified CSS exists on page. + + Then /^(?:|I )should not see an? "(?P[^"]*)" element$/ + - Checks, that element with specified CSS doesn't exist on page. + + Then /^(?:|I )should be on "(?P[^"]+)"$/ + - Checks, that current page PATH is equal to specified. + + Then /^the (?i)url(?-i) should match (?P"([^"]|\\")*")$/ + - Checks, that current page PATH matches regular expression. + + Then /^the response status code should be (?P\d+)$/ + - Checks, that current page response status is equal to specified. + + Then /^the response status code should not be (?P\d+)$/ + - Checks, that current page response status is not equal to specified. + + Then /^(?:|I )should see (?P\d+) "(?P[^"]*)" elements?$/ + - Checks, that (?P\d+) CSS elements exist on the page + + Then /^print last response$/ + - Prints last response to console. + + Then /^show last response$/ + - Opens last response content in browser. + + Then /^I should be redirected to "([^"]+)"/ + + Given /^I wait (?:for )?([\d\.]+) second(?:s?)$/ + +### Navigation + + Given /^(?:|I )am on homepage$/ + - Opens homepage. + + When /^(?:|I )go to homepage$/ + - Opens homepage. + + Given /^(?:|I )am on "(?P[^"]+)"$/ + - Opens specified page. + + When /^(?:|I )go to "(?P[^"]+)"$/ + - Opens specified page. + + When /^(?:|I )reload the page$/ + - Reloads current page. + + When /^(?:|I )move backward one page$/ + - Moves backward one page in history. + + When /^(?:|I )move forward one page$/ + - Moves forward one page in history + +### Forms + + When /^(?:|I )press "(?P