Class Webrat::Selenium::Matchers::HaveSelector

  1. lib/webrat/selenium/matchers/have_selector.rb (view online)
Parent: Object

Methods

public class

  1. new

public instance

  1. failure_message
  2. matches?
  3. negative_failure_message

Public class methods

new (expected)
[show source]
# File lib/webrat/selenium/matchers/have_selector.rb, line 5
        def initialize(expected)
          @expected = expected
        end

Public instance methods

failure_message ()

Returns

String:The failure message.
[show source]
# File lib/webrat/selenium/matchers/have_selector.rb, line 19
        def failure_message
          "expected following text to match selector #{@expected}:\n#{@document}"
        end
matches? (response)
[show source]
# File lib/webrat/selenium/matchers/have_selector.rb, line 9
        def matches?(response)
          response.session.wait_for do
            response.selenium.is_element_present("css=#{@expected}")
          end
          rescue Webrat::TimeoutError
            false
        end
negative_failure_message ()

Returns

String:The failure message to be displayed in negative matches.
[show source]
# File lib/webrat/selenium/matchers/have_selector.rb, line 25
        def negative_failure_message
          "expected following text to not match selector #{@expected}:\n#{@document}"
        end