Sha256: 20d35770c2b63c29a10f792af452905e3aa6f6b324db9358432439e304e595aa

Contents?: true

Size: 824 Bytes

Versions: 3

Compression:

Stored size: 824 Bytes

Contents

module PageObject
  module Elements
    class CheckBox < 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/check_box'
          self.class.send :include, PageObject::Platforms::WatirWebDriver::CheckBox
        elsif platform[:platform] == :selenium_webdriver
          require 'page-object/platforms/selenium_webdriver/check_box'
          self.class.send :include, PageObject::Platforms::SeleniumWebDriver::CheckBox
        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/check_box.rb
page-object-0.3.1 lib/page-object/elements/check_box.rb
page-object-0.3.0 lib/page-object/elements/check_box.rb