Skip to content

Instantly share code, notes, and snippets.

@mnapoli
Last active February 12, 2024 10:54
Show Gist options
  • Star 81 You must be signed in to star a gist
  • Fork 16 You must be signed in to fork a gist
  • Save mnapoli/5848556 to your computer and use it in GitHub Desktop.
Save mnapoli/5848556 to your computer and use it in GitHub Desktop.
Behat Mink reference
# Given
Given I am on [the] homepage
Given I am on "url"
# When
When I go to [the] homepage
When I go to "url"
When I reload the page
When I move backward one page
When I move forward one page
When I press "button"
When I follow "link"
When I fill in "field" with "value"
When I fill in "field" with:
"""
long text
"""
When I fill in "value" for "field"
When I fill in the following:
| field | value |
| name | Bob |
When I select "option" from "select"
When I additionally select "option" from "select"
When I check "option"
When I uncheck "option"
When I attach the file "path" to "field"
# Then
Then I should be on "url"
Then I should be on [the] homepage
Then the url should match "regex"
Then the response status code should [not] be 404
Then I should [not] see "text"
Then I should [not] see text matching "regex"
Then the response should [not] contain "text"
Then I should [not] see "text" in the "element" element
Then the "element" element should [not] contain "value"
Then I should [not] see a [an] "element" element
Then the "field" field should [not] contain "value"
Then the "checkbox" checkbox should be/should not be checked
Then the checkbox "checkbox" is/should be/should not be checked
Then I should see 5 "element" element[s]
Then print current URL # print to console
Then print last response # print to console
Then show last response # open in browser
@fer-ri
Copy link

fer-ri commented Nov 4, 2015

Thanks a lot πŸ’ƒ

πŸ‘

@bweston92
Copy link

What about asserting values of form elements?

@yahyafakhroji
Copy link

Thanks bro πŸ‘ 🀘

@ronaldodrumond
Copy link

Obrigado! :) (Thank you)

@todomagichere
Copy link

Tnks! :)

@aturcey
Copy link

aturcey commented Nov 8, 2017

Thanks πŸ‘Œ

@chadyred
Copy link

All right, thanks a lot man ! πŸ‘

@strawburrypokki
Copy link

Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment