Sha256: 2cf46ef4b4e097b808fd0aa424d3c5b09ceb9a2eeb750ffc5d9b4e28970262f6

Contents?: true

Size: 1008 Bytes

Versions: 3

Compression:

Stored size: 1008 Bytes

Contents

module Cello
  module PageObjects
    module SelectHelper
      def define_extras_for_select(name)
        include LogHelper

        define_method "#{name}_get_options" do
          logger(name, __method__, :select) {
            options = Array.new
            send(name).options.each do |option|
              options.push option.text
            end
            options
          }
        end
        define_method "#{name}_select" do |option|
          logger(name, __method__, :select) {
            send(name).select option
          }
        end
        define_method "#{name}_is" do |option|
          logger(name, __method__, :select) {
            send(name).selected_options.last.text == option
          }
        end
        define_method "#{name}_selected" do
          logger(name, __method__, :select) {
            send(name).selected_options.last.text
          }
        end
      #  define_method "#{name}_clear" do
      #    send(name).clear
      #  end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
cello-0.0.25 lib/cello/pageobjects/html_elements/select_helper.rb
cello-0.0.23 lib/cello/pageobjects/html_elements/select_helper.rb
cello-0.0.21 lib/cello/pageobjects/html_elements/select_helper.rb