Sha256: d603b7b146838550ffa7cd54249195500ff04b96b84a96402a063e60bd001b3d

Contents?: true

Size: 962 Bytes

Versions: 455

Compression:

Stored size: 962 Bytes

Contents

# encoding: utf-8
module PageObject
  module Accessors
      def select_list(name, identifier={:index => 0}, &block)
	      define_method(name) do
	        return platform.select_list_value_for identifier.clone unless block_given?
	        self.send("#{name}_element").value
	      end
	      define_method("#{name}=") do |value|
	        return platform.select_list_value_set(identifier.clone, value) unless block_given?
	        self.send("#{name}_element").select(value)
	      end
		  define_method("#{name}_value=") do |value|
	        return platform.select_list_value_set(identifier.clone, value) unless block_given?
	        self.send("#{name}_element").select_value(value)
	      end
	      define_method("#{name}_options") do
	        element = self.send("#{name}_element")
	        (element && element.options) ? element.options.collect(&:text) : []
	      end

	      standard_methods(name, identifier, 'select_list_for', &block)

      end
  end
end

Version data entries

455 entries across 455 versions & 1 rubygems

Version Path
flights_gui_tests-2.4.98 features/support/modules/accessor.rb
flights_gui_tests-2.4.97 features/support/modules/accessor.rb
flights_gui_tests-2.4.96 features/support/modules/accessor.rb
flights_gui_tests-2.4.95 features/support/modules/accessor.rb
flights_gui_tests-2.4.94 features/support/modules/accessor.rb
flights_gui_tests-2.4.93 features/support/modules/accessor.rb
flights_gui_tests-2.4.92 features/support/modules/accessor.rb
flights_gui_tests-2.4.91 features/support/modules/accessor.rb
flights_gui_tests-2.4.89 features/support/modules/accessor.rb
flights_gui_tests-2.4.88 features/support/modules/accessor.rb
flights_gui_tests-2.4.87 features/support/modules/accessor.rb
flights_gui_tests-2.4.86 features/support/modules/accessor.rb
flights_gui_tests-2.4.85 features/support/modules/accessor.rb
flights_gui_tests-2.4.84 features/support/modules/accessor.rb
flights_gui_tests-2.4.83 features/support/modules/accessor.rb
flights_gui_tests-2.4.82 features/support/modules/accessor.rb
flights_gui_tests-2.4.81 features/support/modules/accessor.rb
flights_gui_tests-2.4.80 features/support/modules/accessor.rb
flights_gui_tests-2.4.79 features/support/modules/accessor.rb
flights_gui_tests-2.4.78 features/support/modules/accessor.rb