Sha256: f8cd04380c9f1642b071771f734e6936774b5693d9f7c55dcbe8ec8345113fd2

Contents?: true

Size: 933 Bytes

Versions: 1

Compression:

Stored size: 933 Bytes

Contents

module PageObject
  module Elements
    class Form < Element
      def initialize(element, platform)
        @element = element
        include_platform_for platform
      end

      protected

      def self.watir_finders
        super + [:action]
      end

      def self.selenium_finders
        super + [:action]
      end

      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

1 entries across 1 versions & 1 rubygems

Version Path
page-object-0.5.4 lib/page-object/elements/form.rb