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.18.0 lib/selenium/webdriver/common/driver_extensions/rotatable.rb
selenium-webdriver-2.18.0.rc3 lib/selenium/webdriver/common/driver_extensions/rotatable.rb
selenium-webdriver-2.18.0.rc2 lib/selenium/webdriver/common/driver_extensions/rotatable.rb
selenium-webdriver-2.18.0.rc1 lib/selenium/webdriver/common/driver_extensions/rotatable.rb
bbc-selenium-webdriver-1.17.0 lib/selenium/webdriver/common/driver_extensions/rotatable.rb
selenium-webdriver-2.17.0 lib/selenium/webdriver/common/driver_extensions/rotatable.rb
selenium-webdriver-2.16.0 lib/selenium/webdriver/common/driver_extensions/rotatable.rb
selenium-webdriver-2.15.0 lib/selenium/webdriver/common/driver_extensions/rotatable.rb
selenium-webdriver-2.14.0 lib/selenium/webdriver/common/driver_extensions/rotatable.rb
selenium-webdriver-2.13.0 lib/selenium/webdriver/common/driver_extensions/rotatable.rb
selenium-webdriver-2.12.2 lib/selenium/webdriver/common/driver_extensions/rotatable.rb
selenium-webdriver-2.12.1 lib/selenium/webdriver/common/driver_extensions/rotatable.rb
selenium-webdriver-2.12.0 lib/selenium/webdriver/common/driver_extensions/rotatable.rb
selenium-webdriver-2.10.0 lib/selenium/webdriver/common/driver_extensions/rotatable.rb
selenium-webdriver-2.9.1 lib/selenium/webdriver/common/driver_extensions/rotatable.rb
selenium-webdriver-2.9.0 lib/selenium/webdriver/common/driver_extensions/rotatable.rb
selenium-webdriver-2.8.0 lib/selenium/webdriver/common/driver_extensions/rotatable.rb
selenium-webdriver-2.7.0 lib/selenium/webdriver/common/driver_extensions/rotatable.rb
selenium-webdriver-2.6.0 lib/selenium/webdriver/common/driver_extensions/rotatable.rb
selenium-webdriver-2.5.0 lib/selenium/webdriver/common/driver_extensions/rotatable.rb