Sha256: 1f1674386c475bc8f921acd7aac5ee954793bdd0a088de04a63b099e3f7ec5fb

Contents?: true

Size: 798 Bytes

Versions: 4

Compression:

Stored size: 798 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

4 entries across 4 versions & 1 rubygems

Version Path
page-object-0.5.3 lib/page-object/elements/form.rb
page-object-0.5.2 lib/page-object/elements/form.rb
page-object-0.5.1 lib/page-object/elements/form.rb
page-object-0.5.0 lib/page-object/elements/form.rb