Sha256: c262c3c4f6efd6d41973e661ae17932e01ecd64c861518b495c1200cc20290ab
Contents?: true
Size: 1.2 KB
Versions: 1
Compression:
Stored size: 1.2 KB
Contents
require 'domkey/view/option_selectable' module Domkey module View class SelectList < PageObject include OptionSelectable def set_by_string value element.select value end def set_by_regexp value element.select value end def set_by_index value case value when Fixnum element.options[value].select when Array value.each do |i| element.options[i].select end end end def set_by_value value case value when String element.select_value value when Array value.each { |v| element.select_value v } end end def value_by_options opts element.selected_options.map do |o| Hash[opts.map { |opt| [opt, o.send(opt)] }] end end def value_by_default element.selected_options.map { |e| e.text } end # iffy def options element.options.map do |o| {text: o.text, value: o.value, index: o.index} end end private def before_set element.clear if element.multiple? end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
domkey-0.3.0 | lib/domkey/view/select_list.rb |