Sha256: f2c8f2b42b6183f6f56d0d16a1a404a57ae4efa3a202439df7b632953fce436d

Contents?: true

Size: 801 Bytes

Versions: 3

Compression:

Stored size: 801 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_webdriver
          require 'page-object/platforms/watir_webdriver/image'
          self.class.send :include, PageObject::Platforms::WatirWebDriver::Image
        elsif platform[:platform] == :selenium_webdriver
          require 'page-object/platforms/selenium_webdriver/image'
          self.class.send :include, PageObject::Platforms::SeleniumWebDriver::Image
        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/image.rb
page-object-0.3.1 lib/page-object/elements/image.rb
page-object-0.3.0 lib/page-object/elements/image.rb