Sha256: 44b23fa135188dfe28551e4ac44c6643d37ddfa88639d552db56674bc3dd5b2f

Contents?: true

Size: 795 Bytes

Versions: 3

Compression:

Stored size: 795 Bytes

Contents

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