Sha256: e0621458ab8973398d74c4debc8eaddf6b54bf5b54160d24cf911b237d044795

Contents?: true

Size: 735 Bytes

Versions: 5

Compression:

Stored size: 735 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
          require 'page-object/platforms/watir_form'
          self.class.send :include, PageObject::Platforms::WatirForm
        elsif platform[:platform] == :selenium
          require 'page-object/platforms/selenium_form'
          self.class.send :include, PageObject::Platforms::SeleniumForm
        else
          raise ArgumentError, "expect platform to be :watir or :selenium"          
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
page-object-0.2 lib/page-object/elements/form.rb
page-object-0.1.1 lib/page-object/elements/form.rb
page-object-0.1 lib/page-object/elements/form.rb
page-object-0.0.5 lib/page-object/elements/form.rb
page-object-0.0.4 lib/page-object/elements/form.rb