Parent

Webrat::Selenium::Matchers::HaveXpath

Public Class Methods

new(expected) click to toggle source
# File lib/webrat/selenium/matchers/have_xpath.rb, line 5
def initialize(expected)
  @expected = expected
end

Public Instance Methods

does_not_match?(response) click to toggle source
# File lib/webrat/selenium/matchers/have_xpath.rb, line 17
def does_not_match?(response)
  response.session.wait_for do
    !response.selenium.is_element_present("xpath=#{@expected}")
  end
  rescue Webrat::TimeoutError
    false
end
failure_message() click to toggle source

Returns

String

The failure message.

# File lib/webrat/selenium/matchers/have_xpath.rb, line 27
def failure_message
  "expected following text to match xpath #{@expected}:\n#{@document}"
end
matches?(response) click to toggle source
# File lib/webrat/selenium/matchers/have_xpath.rb, line 9
def matches?(response)
  response.session.wait_for do
    response.selenium.is_element_present("xpath=#{@expected}")
  end
  rescue Webrat::TimeoutError
    false
end
negative_failure_message() click to toggle source

Returns

String

The failure message to be displayed in negative matches.

# File lib/webrat/selenium/matchers/have_xpath.rb, line 33
def negative_failure_message
  "expected following text to not match xpath #{@expected}:\n#{@document}"
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.