Module: Selenium::WebDriver::DriverExtensions::Rotatable Private
- Included in:
- Remote::Driver
- Defined in:
- lib/selenium/webdriver/common/driver_extensions/rotatable.rb
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
Constant Summary collapse
- ORIENTATIONS =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
[:landscape, :portrait].freeze
Instance Method Summary collapse
-
#orientation ⇒ :landscape, :portrait
Get the current screen orientation.
-
#rotation=(orientation) ⇒ Object
(also: #rotate)
Change the screen orientation.
Instance Method Details
#orientation ⇒ :landscape, :portrait
Get the current screen orientation
53 54 55 |
# File 'lib/selenium/webdriver/common/driver_extensions/rotatable.rb', line 53 def orientation bridge.screen_orientation.to_sym.downcase end |
#rotation=(orientation) ⇒ Object Also known as: rotate
Change the screen orientation
36 37 38 39 40 41 42 |
# File 'lib/selenium/webdriver/common/driver_extensions/rotatable.rb', line 36 def rotation=(orientation) unless ORIENTATIONS.include?(orientation) raise ArgumentError, "expected #{ORIENTATIONS.inspect}, got #{orientation.inspect}" end bridge.screen_orientation = orientation.to_s.upcase end |