Sha256: b29e6800e12b9e9980dfcab6844f12d8e945946498f1c117c64795d64ecae8c9
Contents?: true
Size: 829 Bytes
Versions: 17
Compression:
Stored size: 829 Bytes
Contents
# encoding: utf-8 module Watir # # Represents an option in a select list. # class Option < HTMLElement # # Select this option # def select assert_exists @element.click end # # Toggle the selected state of this option # def toggle assert_exists @element.click end # # Is this option selected? # def selected? assert_exists @element.selected? end def text assert_exists # A little unintuitive - we'll return the 'label' or 'text' attribute if # they exist, otherwise the inner text of the element attribute = [:label, :text].find { |a| attribute? a } if attribute @element.attribute(attribute) else @element.text end end end # Option end # Watir
Version data entries
17 entries across 17 versions & 1 rubygems