Sha256: 39c43b1c4c125975b04ba0926819867815eeedf3c05da908f458e56da8faebeb

Contents?: true

Size: 930 Bytes

Versions: 23

Compression:

Stored size: 930 Bytes

Contents

module Selenium
  module WebDriver

    #
    # @api private
    #

    module DriverExtensions
      module Rotatable

        ORIENTATIONS = [:landscape, :portrait]

        #
        # Change the screen orientation
        #
        # @param [:landscape, :portrait] Orientation
        #
        # @api public
        #

        def rotate(orientation)
          unless ORIENTATIONS.include?(orientation)
            raise ArgumentError, "expected #{ORIENTATIONS.inspect}, got #{orientation.inspect}"
          end

          bridge.setScreenOrientation(orientation.to_s.upcase)
        end

        #
        # Get the current screen orientation
        #
        # @return [:landscape, :portrait] orientation
        #
        # @api public
        #

        def orientation
          bridge.getScreenOrientation.to_sym.downcase
        end

      end # Rotatable
    end # DriverExtensions
  end # WebDriver
end # Selenium

Version data entries

23 entries across 23 versions & 2 rubygems

Version Path
selenium-webdriver-2.4.0 lib/selenium/webdriver/common/driver_extensions/rotatable.rb
selenium-webdriver-2.3.2 lib/selenium/webdriver/common/driver_extensions/rotatable.rb
selenium-webdriver-2.3.0 lib/selenium/webdriver/common/driver_extensions/rotatable.rb