Skip to content

maxmckenzie/Default-Gherkin-Sublime-Snippets

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Install

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

Triggers

  • Given giv+tab
  • When whe+tab
  • then the+tab

List of predefined steps

Check out all predefined snippets. You can see how they get used in sampleSnippets.feature.

Given steps

  • /I open the (url|site) "$string"
    Open a site in the current browser window/tab
  • the element "$string" is( not)* visible
    Check the (in)visibility of a element
  • the element "$string" is( not)* enabled
    Check if a element is (not) enabled
  • the element "$string" is( not)* selected
    Check if a element is (not) selected
  • the checkbox "$string" is( not)* checked
    Check if a checkbox is (not) checked
  • there is (an|no) element "$string" on the page
    Check if a element (does not) exist
  • the title is( not)* "$string"
    Check the title of the current browser window/tab
  • the element "$string" contains( not)* the same text as element "$string"
    Compaire the text of two elements
  • the (element|inputfield) "$string" does( not)* contain the text "$string"
    Check if a element contains the given text
  • the (element|inputfield) "$string" does( not)* contain any text
    Check if a element does not contain any text
  • the page url is( not)* "$string"
    Check the url of the current browser window/tab
  • the( css)* attribute "$string" from element "$string" is( not)* "$string"
    Check the value of a element's (css) attribute
  • the cookie "$string" contains( not)* the value "$string"
    Check the value of a cookie
  • the cookie "$string" does( not)* exist
    Check the existence of a cookie
  • the element "$string" is( not)* ([\d]+)px (broad|tall)
    Check the width/height of a element
  • the element "$string" is( not)* positioned at ([\d]+)px on the (x|y) axis
    Check the position of a element
  • I have a screen that is ([\d]+) by ([\d]+) pixels
    Set the browser size to a given size
  • I have closed all but the first (window|tab)
    Close all but the first browser window/tab
  • a (alertbox|confirmbox|prompt) is( not)* opened
    Check if a modal is opened

Then steps

  • I expect that the title is( not)* "$string"
    Check the title of the current browser window/tab
  • I expect that element "$string" is( not)* visible
    Check if a certain element is visible
  • I expect that element "$string" becomes( not)* visible
    Check if a certain element becomes visible
  • I expect that element "$string" is( not)* within the viewport
    Check if a certain element is within the current viewport
  • I expect that element "$string" does( not)* exist
    Check if a certain element exists
  • I expect that element "$string" does( not)* contain the same text as element "$string"
    Compaire the text of two elements
  • I expect that (element|inputfield) "$string"( not)* contains the text "$string"
    Check if a element or input field contains the given text
  • I expect that (element|inputfield) "$string" does( not)* contain any text
    Check if a element or input field contains any text
  • I expect that (element|inputfield) "$string" is( not)* empty
    Check if a element or input field is empty
  • I expect that the url is( not)* "$string"
    Check if the the url of the current browser window/tab is a certain string
  • I expect that the path is( not)* "$string"
    Check if the path of the url of the current browser window/tab is a certain string
  • I expect the url to( not)* contain "$string"
    Check if the url of the current browser window/tab contains a certain string
  • I expect that the( css)* attribute "$string" from element "$string" is( not)* "$string"
    Check the value of a element's (css) attribute
  • I expect that checkbox "$string" is( not)* checked
    Check if a checkbox is (not) checked
  • I expect that element "$string" is( not)* selected
    Check if a element is (not) selected
  • I expect that element "$string" is( not)* enabled
    Check if a element is (not) enabled
  • I expect that cookie "$string"( not)* contains "$string"
    Check if a cookie with a certain name contains a certain value
  • I expect that cookie "$string"( not)* exists
    Check if a cookie with a certain name exist
  • I expect that element "$string" is( not)* ([\d]+)px (broad|tall)
    Check the width/height of an element
  • I expect that element "$string" is( not)* positioned at ([\d]+)px on the (x|y) axis
    Check the position of an element
  • I expect that element "$string" (has|does not have) the class "$string"
    Check if a element has a certain class
  • I expect a new (window|tab) has( not)* been opened
    Check if a new window/tab has been opened
  • I expect the url "$string" is opened in a new (tab|window)
    Check if a url is opened in a new browser window/tab
  • I expect that element "$string" is( not)* focused
    Check if a element has the focus
  • I 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 exist
  • I expect that a (alertbox|confirmbox|prompt) is( not)* opened
    Check if a modal is opened
  • I expect that a (alertbox|confirmbox|prompt)( not)* contains the text "$text"
    Check the text of a modal

When steps

  • I (click|doubleclick) on the (link|button|element) "$string"
    (Double)click a link, button or element
  • I (add|set) "$string" to the inputfield "$string"
    Add or set the content of an input field
  • I clear the inputfield "$string"
    Clear an input field
  • I drag element "$string" to element "$string"
    Drag a element to another element
  • I submit the form "$string"
    Submit a form
  • I pause for (\d+)ms
    Pause for a certain number of milliseconds
  • I set a cookie "$string" with the content "$string"
    Set the content of a cookie with the given name to the given string
  • I delete the cookie "$string"
    Delete the cookie with the given name
  • I 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 window
  • I enter "$string" into the prompt
    Enter a given text into a modal prompt
  • I scroll to element "$string"
    Scroll to a given element
  • I close the last opened (window|tab)
    Close the last opened browser window/tab
  • I focus the last opened (window|tab)
    Focus the last opened browser window/tab
  • I log in to site with username "$string" and password "$string"
    Login to a site with the given username and password
  • I select the (\d+)(st|nd|rd|th) option for element "$string"
    Select a option based on it's index
  • I select the option with the (name|value|text) "$string" for element "$string"
    Select a option based on it's name, value or visible text
  • I move to element "$string"( with an offset of (\d+),(\d+))
    Move the mouse by an (optional) offset of the specificed element

About

set of snippets that work with this cucumber boilerplate https://github.com/maxmckenzie/cucumber-boilerplate

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published