Module: Selenium::WebDriver::DriverExtensions::Rotatable Private
- Defined in:
- rb/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
- 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]
Instance Method Summary (collapse)
-
- (:landscape, :portrait) orientation
Get the current screen orientation.
-
- (Object) rotation=(orientation)
(also: #rotate)
Change the screen orientation.
Instance Method Details
- (:landscape, :portrait) orientation
Get the current screen orientation
38 39 40 |
# File 'rb/lib/selenium/webdriver/common/driver_extensions/rotatable.rb', line 38 def orientation bridge.getScreenOrientation.to_sym.downcase end |
- (Object) rotation=(orientation) Also known as: rotate
Change the screen orientation
21 22 23 24 25 26 27 |
# File 'rb/lib/selenium/webdriver/common/driver_extensions/rotatable.rb', line 21 def rotation=(orientation) unless ORIENTATIONS.include?(orientation) raise ArgumentError, "expected #{ORIENTATIONS.inspect}, got #{orientation.inspect}" end bridge.setScreenOrientation(orientation.to_s.upcase) end |