Sha256: 866c0081a51681a355db0ebca2702d9a7aeda36ec66b33ab8f32741d61301e68

Contents?: true

Size: 840 Bytes

Versions: 3

Compression:

Stored size: 840 Bytes

Contents

module PageObject
  module Elements
    class RadioButton < Element

      def initialize(element, platform)
        @element = element
        include_platform_for platform
      end

      protected
      
      def include_platform_for platform
        super
        if platform[:platform] == :watir_webdriver
          require 'page-object/platforms/watir_webdriver/radio_button'
          self.class.send :include, PageObject::Platforms::WatirWebDriver::RadioButton
        elsif platform[:platform] == :selenium_webdriver
          require 'page-object/platforms/selenium_webdriver/radio_button'
          self.class.send :include, PageObject::Platforms::SeleniumWebDriver::RadioButton
        else
          raise ArgumentError, "expect platform to be :watir_webdriver or :selenium_webdriver"
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
page-object-0.3.2 lib/page-object/elements/radio_button.rb
page-object-0.3.1 lib/page-object/elements/radio_button.rb
page-object-0.3.0 lib/page-object/elements/radio_button.rb