Sha256: 5231bf4791a1be0d0def8fa4d0822ddf10007e5c1191700818399d89f963430c

Contents?: true

Size: 723 Bytes

Versions: 5

Compression:

Stored size: 723 Bytes

Contents

module PageObject
  module Elements
    class Image < 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/image'
          self.class.send :include, PageObject::Platforms::Watir::Image
        elsif platform[:platform] == :selenium
          require 'page-object/platforms/selenium/image'
          self.class.send :include, PageObject::Platforms::Selenium::Image
        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.5 lib/page-object/elements/image.rb
page-object-0.2.4 lib/page-object/elements/image.rb
page-object-0.2.3 lib/page-object/elements/image.rb
page-object-0.2.2 lib/page-object/elements/image.rb
page-object-0.2.1 lib/page-object/elements/image.rb