lib/kelp/attribute.rb
def should_be_disabled(element_id)
      if page.has_xpath?("//*[@id='#{element_id}']")
        if !page.has_xpath?("//*[@id='#{element_id}' and @disabled]")
          raise Kelp::Unexpected,
            "Expected element with id='#{element_id}' to be disabled," + \
            " but the 'disabled' attribute is not present."
        end
      else
        raise Kelp::Unexpected,
          "Element with id='#{element_id}' not found."
      end
    end
# Verify that the HTML element with the given ID exists, and is disabled (has
# the `disabled` attribute).
#
# @param [String] element_id
#   HTML `id` attribute of the element that should be disabled
#
# @raise [Kelp::Unexpected]
#   If the given element id is not found, or the element is not disabled
#
Verify that the HTML element with the given ID exists, and is disabled (has
the `disabled` attribute).
Verify that the HTML element with the given ID exists and is disabled ( has the ` disabled ` attribute ) .
def should_be_disabled(element_id)
      if page.has_xpath?("//*[@id='#{element_id}']")
        if !page.has_xpath?("//*[@id='#{element_id}' and @disabled]")
          raise Kelp::Unexpected,
            "Expected element with id='#{element_id}' to be disabled," + \
            " but the 'disabled' attribute is not present."
        end
      else
        raise Kelp::Unexpected,
          "Element with id='#{element_id}' not found."
      end
    end
def should_be_disabled ( element_id ) if page . has_xpath? ( "//*[@id='#{element_id}']" ) if ! page . has_xpath? ( "//*[@id='#{element_id}' and @disabled]" ) raise Kelp :: Unexpected , "Expected element with id='#{element_id}' to be disabled," + " but the 'disabled' attribute is not present." end else raise Kelp :: Unexpected , "Element with id='#{element_id}' not found." end end
Verify that the HTML element with the given ID exists, and is disabled (has
the `disabled` attribute).
Verify that the HTML element with the given ID exists and is disabled ( has the ` disabled ` attribute ) .
[Kelp::Unexpected] If the given element id is not found, or the element is not disabled
[ Kelp :: Unexpected ] If the given element id is not found or the element is not disabled
element_id
element_id HTML `id` attribute of the element that should be disabled
element_id HTML ` id ` attribute of the element that should be disabled