Skip to content

Instantly share code, notes, and snippets.

@indeyets
Created April 6, 2015 20:01
Show Gist options
  • Save indeyets/3420cdd53c6f5db53309 to your computer and use it in GitHub Desktop.
Save indeyets/3420cdd53c6f5db53309 to your computer and use it in GitHub Desktop.
Mink's steps
default | Given /^(?:|I )am on (?:|the )homepage$/
| Opens homepage.
| at `FeatureContext::iAmOnHomepage()`
default | When /^(?:|I )go to (?:|the )homepage$/
| Opens homepage.
| at `FeatureContext::iAmOnHomepage()`
default | Given /^(?:|I )am on "(?P<page>[^"]+)"$/
| Opens specified page.
| at `FeatureContext::visit()`
default | When /^(?:|I )go to "(?P<page>[^"]+)"$/
| Opens specified page.
| at `FeatureContext::visit()`
default | When /^(?:|I )reload the page$/
| Reloads current page.
| at `FeatureContext::reload()`
default | When /^(?:|I )move backward one page$/
| Moves backward one page in history.
| at `FeatureContext::back()`
default | When /^(?:|I )move forward one page$/
| Moves forward one page in history
| at `FeatureContext::forward()`
default | When /^(?:|I )press "(?P<button>(?:[^"]|\\")*)"$/
| Presses button with specified id|name|title|alt|value.
| at `FeatureContext::pressButton()`
default | When /^(?:|I )follow "(?P<link>(?:[^"]|\\")*)"$/
| Clicks link with specified id|title|alt|text.
| at `FeatureContext::clickLink()`
default | When /^(?:|I )fill in "(?P<field>(?:[^"]|\\")*)" with "(?P<value>(?:[^"]|\\")*)"$/
| Fills in form field with specified id|name|label|value.
| at `FeatureContext::fillField()`
default | When /^(?:|I )fill in "(?P<field>(?:[^"]|\\")*)" with:$/
| Fills in form field with specified id|name|label|value.
| at `FeatureContext::fillField()`
default | When /^(?:|I )fill in "(?P<value>(?:[^"]|\\")*)" for "(?P<field>(?:[^"]|\\")*)"$/
| Fills in form field with specified id|name|label|value.
| at `FeatureContext::fillField()`
default | When /^(?:|I )fill in the following:$/
| Fills in form fields with provided table.
| at `FeatureContext::fillFields()`
default | When /^(?:|I )select "(?P<option>(?:[^"]|\\")*)" from "(?P<select>(?:[^"]|\\")*)"$/
| Selects option in select field with specified id|name|label|value.
| at `FeatureContext::selectOption()`
default | When /^(?:|I )additionally select "(?P<option>(?:[^"]|\\")*)" from "(?P<select>(?:[^"]|\\")*)"$/
| Selects additional option in select field with specified id|name|label|value.
| at `FeatureContext::additionallySelectOption()`
default | When /^(?:|I )check "(?P<option>(?:[^"]|\\")*)"$/
| Checks checkbox with specified id|name|label|value.
| at `FeatureContext::checkOption()`
default | When /^(?:|I )uncheck "(?P<option>(?:[^"]|\\")*)"$/
| Unchecks checkbox with specified id|name|label|value.
| at `FeatureContext::uncheckOption()`
default | When /^(?:|I )attach the file "(?P<path>[^"]*)" to "(?P<field>(?:[^"]|\\")*)"$/
| Attaches file to field with specified id|name|label|value.
| at `FeatureContext::attachFileToField()`
default | Then /^(?:|I )should be on "(?P<page>[^"]+)"$/
| Checks, that current page PATH is equal to specified.
| at `FeatureContext::assertPageAddress()`
default | Then /^(?:|I )should be on (?:|the )homepage$/
| Checks, that current page is the homepage.
| at `FeatureContext::assertHomepage()`
default | Then /^the (?i)url(?-i) should match (?P<pattern>"(?:[^"]|\\")*")$/
| Checks, that current page PATH matches regular expression.
| at `FeatureContext::assertUrlRegExp()`
default | Then /^the response status code should be (?P<code>\d+)$/
| Checks, that current page response status is equal to specified.
| at `FeatureContext::assertResponseStatus()`
default | Then /^the response status code should not be (?P<code>\d+)$/
| Checks, that current page response status is not equal to specified.
| at `FeatureContext::assertResponseStatusIsNot()`
default | Then /^(?:|I )should see "(?P<text>(?:[^"]|\\")*)"$/
| Checks, that page contains specified text.
| at `FeatureContext::assertPageContainsText()`
default | Then /^(?:|I )should not see "(?P<text>(?:[^"]|\\")*)"$/
| Checks, that page doesn't contain specified text.
| at `FeatureContext::assertPageNotContainsText()`
default | Then /^(?:|I )should see text matching (?P<pattern>"(?:[^"]|\\")*")$/
| Checks, that page contains text matching specified pattern.
| at `FeatureContext::assertPageMatchesText()`
default | Then /^(?:|I )should not see text matching (?P<pattern>"(?:[^"]|\\")*")$/
| Checks, that page doesn't contain text matching specified pattern.
| at `FeatureContext::assertPageNotMatchesText()`
default | Then /^the response should contain "(?P<text>(?:[^"]|\\")*)"$/
| Checks, that HTML response contains specified string.
| at `FeatureContext::assertResponseContains()`
default | Then /^the response should not contain "(?P<text>(?:[^"]|\\")*)"$/
| Checks, that HTML response doesn't contain specified string.
| at `FeatureContext::assertResponseNotContains()`
default | Then /^(?:|I )should see "(?P<text>(?:[^"]|\\")*)" in the "(?P<element>[^"]*)" element$/
| Checks, that element with specified CSS contains specified text.
| at `FeatureContext::assertElementContainsText()`
default | Then /^(?:|I )should not see "(?P<text>(?:[^"]|\\")*)" in the "(?P<element>[^"]*)" element$/
| Checks, that element with specified CSS doesn't contain specified text.
| at `FeatureContext::assertElementNotContainsText()`
default | Then /^the "(?P<element>[^"]*)" element should contain "(?P<value>(?:[^"]|\\")*)"$/
| Checks, that element with specified CSS contains specified HTML.
| at `FeatureContext::assertElementContains()`
default | Then /^the "(?P<element>[^"]*)" element should not contain "(?P<value>(?:[^"]|\\")*)"$/
| Checks, that element with specified CSS doesn't contain specified HTML.
| at `FeatureContext::assertElementNotContains()`
default | Then /^(?:|I )should see an? "(?P<element>[^"]*)" element$/
| Checks, that element with specified CSS exists on page.
| at `FeatureContext::assertElementOnPage()`
default | Then /^(?:|I )should not see an? "(?P<element>[^"]*)" element$/
| Checks, that element with specified CSS doesn't exist on page.
| at `FeatureContext::assertElementNotOnPage()`
default | Then /^the "(?P<field>(?:[^"]|\\")*)" field should contain "(?P<value>(?:[^"]|\\")*)"$/
| Checks, that form field with specified id|name|label|value has specified value.
| at `FeatureContext::assertFieldContains()`
default | Then /^the "(?P<field>(?:[^"]|\\")*)" field should not contain "(?P<value>(?:[^"]|\\")*)"$/
| Checks, that form field with specified id|name|label|value doesn't have specified value.
| at `FeatureContext::assertFieldNotContains()`
default | Then /^the "(?P<checkbox>(?:[^"]|\\")*)" checkbox should be checked$/
| Checks, that checkbox with specified in|name|label|value is checked.
| at `FeatureContext::assertCheckboxChecked()`
default | Then /^the checkbox "(?P<checkbox>(?:[^"]|\\")*)" (?:is|should be) checked$/
| Checks, that checkbox with specified in|name|label|value is checked.
| at `FeatureContext::assertCheckboxChecked()`
default | Then /^the "(?P<checkbox>(?:[^"]|\\")*)" checkbox should not be checked$/
| Checks, that checkbox with specified in|name|label|value is unchecked.
| at `FeatureContext::assertCheckboxNotChecked()`
default | Then /^the checkbox "(?P<checkbox>(?:[^"]|\\")*)" should (?:be unchecked|not be checked)$/
| Checks, that checkbox with specified in|name|label|value is unchecked.
| at `FeatureContext::assertCheckboxNotChecked()`
default | Then /^the checkbox "(?P<checkbox>(?:[^"]|\\")*)" is (?:unchecked|not checked)$/
| Checks, that checkbox with specified in|name|label|value is unchecked.
| at `FeatureContext::assertCheckboxNotChecked()`
default | Then /^(?:|I )should see (?P<num>\d+) "(?P<element>[^"]*)" elements?$/
| Checks, that (?P<num>\d+) CSS elements exist on the page
| at `FeatureContext::assertNumElements()`
default | Then /^print current URL$/
| Prints current URL to console.
| at `FeatureContext::printCurrentUrl()`
default | Then /^print last response$/
| Prints last response to console.
| at `FeatureContext::printLastResponse()`
default | Then /^show last response$/
| Opens last response content in browser.
| at `FeatureContext::showLastResponse()`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment