Sha256: 2b839a1ff5fccb7d01fff7eb8fb12927821c26324837545c9f786caff0ba53bd
Contents?: true
Size: 553 Bytes
Versions: 23
Compression:
Stored size: 553 Bytes
Contents
require "webrat/core/elements/element" module Webrat class Label < Element #:nodoc: attr_reader :element def self.xpath_search ".//label" end def for_id Webrat::XML.attribute(@element, "for") end def field Field.load(@session, field_element) end protected def field_element if for_id.blank? Webrat::XML.xpath_at(@element, *Field.xpath_search) else Webrat::XML.css_search(@session.current_dom, "#" + for_id).first end end end end
Version data entries
23 entries across 23 versions & 4 rubygems