Sha256: 75b6464022637ac3f982df9d966d4b5b4604f0d40f34a0a92fdd1f60add29ada

Contents?: true

Size: 802 Bytes

Versions: 4

Compression:

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

4 entries across 4 versions & 1 rubygems

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