Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
tag: v0,0,3
Fetching contributors…

Cannot retrieve contributors at this time

102 lines (68 sloc) 1.944 kB

Prickle

Build Status

Configuration

To install prickle execute

gem install prickle

and to configure update your features/support/env.rb to include the following:

require 'prickle/capybara'    # require


World do
   include Capybara::DSL
   include Prickle::Capybara  # include  Prickle
end

Waiting for elements to become visible

To enable this feature you need to set the Prickle::Capybara.wait_time property.

Prickle::Capybara.wait_time = 5

If you only want to extend the wait time for a particular feature, then you need to reset the wait time using Prickle::Capybara = nil.

Usage

Find elements by any html tag(s)

element(:href => "http://google.com")
element(:name => "blue")
element(:id => "key")
element(:class => "key", :id => "button")

Find elements by type and html tag(s)

element(:link, :href => "http://google.com")    # you can also use link and paragraph (instead of a and p)
element(:input, :name => "blue")

Apply a search, a click or a text matcher

element(:name => "flower").exists?
element(:name => "flower").click
element(:name => "flower").contains_text? "Roses"

Alternative syntax

Find

find_by_name "green"
find_button_by_name "green" #find_<element_tag>_by_name "<name>"

Click

click_by_name "blue"
click_input_by_name "blue" #click_<element_tag>_by_name "<name>"

Match text

div_contains_text? "text" #<element_tag>_contains_text? "text"

Popup actions

confirm_popup  # can be used for both confirmation boxed and alert boxes
dismiss_popup
popup_message

popup_message_contains? "<text>"

Capturing screenshots

capture_screen
capture_screen "<file>"
Jump to Line
Something went wrong with that request. Please try again.