Skip to content

Commit 560ecf3

Browse files
committed
chore: add orientation as a syntax sugar
1 parent dd2f87a commit 560ecf3

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

lib/appium_lib_core/common/base/rotable.rb

+1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ def rotation=(orientation)
4242
bridge.screen_orientation = orientation.to_s.upcase
4343
end
4444
alias rotate rotation=
45+
alias orientation= rotation=
4546

4647
#
4748
# Get the current screen orientation

lib/appium_lib_core/version.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
module Appium
1616
module Core
17-
VERSION = '6.2.0' unless defined? ::Appium::Core::VERSION
18-
DATE = '2023-01-26' unless defined? ::Appium::Core::DATE
17+
VERSION = '6.2.1' unless defined? ::Appium::Core::VERSION
18+
DATE = '2023-03-09' unless defined? ::Appium::Core::DATE
1919
end
2020
end

test/unit/android/webdriver/w3c/commands_test.rb

+9
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,15 @@ def test_rotate
227227
assert_requested(:post, "#{SESSION}/orientation", times: 1)
228228
end
229229

230+
def test_orientation
231+
stub_request(:post, "#{SESSION}/orientation")
232+
.to_return(headers: HEADER, status: 200, body: { value: 'xxxx' }.to_json)
233+
234+
@driver.orientation = :landscape
235+
236+
assert_requested(:post, "#{SESSION}/orientation", times: 1)
237+
end
238+
230239
def test_active_element
231240
stub_request(:get, "#{SESSION}/element/active")
232241
.to_return(headers: HEADER, status: 200, body: { value: 'xxxx' }.to_json)

0 commit comments

Comments
 (0)