Sublime Text 3
git clone https://github.com/maxmckenzie/cucumber-boilerplate-sublime-snippits.git ~/Library/Application\ Support/Sublime\ Text\ 3/Packages/User/cucumber-boilerplate-sublime-snippits
Package Control for Sublime Text 3
import urllib.request,os,hashlib; h = '2915d1851351e5ee549c20394736b442' + '8bc59f460fa1548d1514676163dafc88'; pf = 'Package Control.sublime-package'; ipp = sublime.installed_packages_path(); urllib.request.install_opener( urllib.request.build_opener( urllib.request.ProxyHandler()) ); by = urllib.request.urlopen( 'http://packagecontrol.io/' + pf.replace(' ', '%20')).read(); dh = hashlib.sha256(by).hexdigest(); print('Error validating download (got %s instead of %s), please try manual install' % (dh, h)) if dh != h else open(os.path.join( ipp, pf), 'wb' ).write(by)
Install Package Cucumber
Mac OSX:
cd ~/Library/Application\ Support/Sublime\ Text\ 2/Packages
git clone git://github.com/drewda/cucumber-sublime-bundle.git Cucumber
Linux:
cd ~/.config/sublime-text-2/Packages
git clone git://github.com/drewda/cucumber-sublime-bundle.git Cucumber
Windows:
cd Users/<user>/AppData/Roaming/Sublime\ Text\ 2/Packages/
git clone git://github.com/drewda/cucumber-sublime-bundle.git Cucumber
- Given
giv+tab
- When
whe+tab
- then
the+tab
Check out all predefined snippets. You can see how they get used in sampleSnippets.feature
.
/I open the (url|site) "$string"
Open a site in the current browser window/tabthe element "$string" is( not)* visible
Check the (in)visibility of a elementthe element "$string" is( not)* enabled
Check if a element is (not) enabledthe element "$string" is( not)* selected
Check if a element is (not) selectedthe checkbox "$string" is( not)* checked
Check if a checkbox is (not) checkedthere is (an|no) element "$string" on the page
Check if a element (does not) existthe title is( not)* "$string"
Check the title of the current browser window/tabthe element "$string" contains( not)* the same text as element "$string"
Compaire the text of two elementsthe (element|inputfield) "$string" does( not)* contain the text "$string"
Check if a element contains the given textthe (element|inputfield) "$string" does( not)* contain any text
Check if a element does not contain any textthe page url is( not)* "$string"
Check the url of the current browser window/tabthe( css)* attribute "$string" from element "$string" is( not)* "$string"
Check the value of a element's (css) attributethe cookie "$string" contains( not)* the value "$string"
Check the value of a cookiethe cookie "$string" does( not)* exist
Check the existence of a cookiethe element "$string" is( not)* ([\d]+)px (broad|tall)
Check the width/height of a elementthe element "$string" is( not)* positioned at ([\d]+)px on the (x|y) axis
Check the position of a elementI have a screen that is ([\d]+) by ([\d]+) pixels
Set the browser size to a given sizeI have closed all but the first (window|tab)
Close all but the first browser window/taba (alertbox|confirmbox|prompt) is( not)* opened
Check if a modal is opened
I expect that the title is( not)* "$string"
Check the title of the current browser window/tabI expect that element "$string" is( not)* visible
Check if a certain element is visibleI expect that element "$string" becomes( not)* visible
Check if a certain element becomes visibleI expect that element "$string" is( not)* within the viewport
Check if a certain element is within the current viewportI expect that element "$string" does( not)* exist
Check if a certain element existsI expect that element "$string" does( not)* contain the same text as element "$string"
Compaire the text of two elementsI expect that (element|inputfield) "$string"( not)* contains the text "$string"
Check if a element or input field contains the given textI expect that (element|inputfield) "$string" does( not)* contain any text
Check if a element or input field contains any textI expect that (element|inputfield) "$string" is( not)* empty
Check if a element or input field is emptyI expect that the url is( not)* "$string"
Check if the the url of the current browser window/tab is a certain stringI expect that the path is( not)* "$string"
Check if the path of the url of the current browser window/tab is a certain stringI expect the url to( not)* contain "$string"
Check if the url of the current browser window/tab contains a certain stringI expect that the( css)* attribute "$string" from element "$string" is( not)* "$string"
Check the value of a element's (css) attributeI expect that checkbox "$string" is( not)* checked
Check if a checkbox is (not) checkedI expect that element "$string" is( not)* selected
Check if a element is (not) selectedI expect that element "$string" is( not)* enabled
Check if a element is (not) enabledI expect that cookie "$string"( not)* contains "$string"
Check if a cookie with a certain name contains a certain valueI expect that cookie "$string"( not)* exists
Check if a cookie with a certain name existI expect that element "$string" is( not)* ([\d]+)px (broad|tall)
Check the width/height of an elementI expect that element "$string" is( not)* positioned at ([\d]+)px on the (x|y) axis
Check the position of an elementI expect that element "$string" (has|does not have) the class "$string"
Check if a element has a certain classI expect a new (window|tab) has( not)* been opened
Check if a new window/tab has been openedI expect the url "$string" is opened in a new (tab|window)
Check if a url is opened in a new browser window/tabI expect that element "$string" is( not)* focused
Check if a element has the focusI wait on element "$string"( for (\d+)ms)*( to( not)* (be checked|be enabled|be selected|be visible|contain a text|contain a value|exist))*
Wait for a element to be checked, enabled, selected, visible, contain a certain value or text or to existI expect that a (alertbox|confirmbox|prompt) is( not)* opened
Check if a modal is openedI expect that a (alertbox|confirmbox|prompt)( not)* contains the text "$text"
Check the text of a modal
I (click|doubleclick) on the (link|button|element) "$string"
(Double)click a link, button or elementI (add|set) "$string" to the inputfield "$string"
Add or set the content of an input fieldI clear the inputfield "$string"
Clear an input fieldI drag element "$string" to element "$string"
Drag a element to another elementI submit the form "$string"
Submit a formI pause for (\d+)ms
Pause for a certain number of millisecondsI set a cookie "$string" with the content "$string"
Set the content of a cookie with the given name to the given stringI delete the cookie "$string"
Delete the cookie with the given nameI press "$string"
Press a given key. You’ll find all supported characters here. To do that, the value has to correspond to a key from the table.I (accept|dismiss) the (alertbox|confirmbox|prompt)
Accept or dismiss a modal windowI enter "$string" into the prompt
Enter a given text into a modal promptI scroll to element "$string"
Scroll to a given elementI close the last opened (window|tab)
Close the last opened browser window/tabI focus the last opened (window|tab)
Focus the last opened browser window/tabI log in to site with username "$string" and password "$string"
Login to a site with the given username and passwordI select the (\d+)(st|nd|rd|th) option for element "$string"
Select a option based on it's indexI select the option with the (name|value|text) "$string" for element "$string"
Select a option based on it's name, value or visible textI move to element "$string"( with an offset of (\d+),(\d+))
Move the mouse by an (optional) offset of the specificed element