Skip to content

Commit

Permalink
Add backwards compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
khanhdodang committed Mar 6, 2019
1 parent f044bea commit 5ef3b38
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
5 changes: 4 additions & 1 deletion lib/appium_lib_core/android/device/emulator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,10 @@ def gsm_call(phone_number:, action:)
def gsm_signal(signal_strength)
raise "#{signal_strength} should be member of #{GSM_SIGNALS} " if GSM_SIGNALS[signal_strength.to_sym].nil?

execute(:gsm_signal, {}, { signalStrength: GSM_SIGNALS[signal_strength], signalStrengh: GSM_SIGNALS[signal_strength] })
execute(:gsm_signal, {}, {
signalStrength: GSM_SIGNALS[signal_strength],
signalStrengh: GSM_SIGNALS[signal_strength]
})
end
end

Expand Down
5 changes: 4 additions & 1 deletion test/unit/android/device/mjsonwp/commands_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,10 @@ def test_gsm_call

def test_gsm_signal
stub_request(:post, "#{SESSION}/appium/device/gsm_signal")
.with(body: { signalStrength: ::Appium::Core::Android::Device::Emulator::GSM_SIGNALS[:good] }.to_json)
.with(body: {
signalStrength: ::Appium::Core::Android::Device::Emulator::GSM_SIGNALS[:good],
signalStrengh: ::Appium::Core::Android::Device::Emulator::GSM_SIGNALS[:good]
}.to_json)
.to_return(headers: HEADER, status: 200, body: { value: '' }.to_json)

@driver.gsm_signal :good
Expand Down
5 changes: 4 additions & 1 deletion test/unit/android/device/w3c/commands_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,10 @@ def test_gsm_call

def test_gsm_signal
stub_request(:post, "#{SESSION}/appium/device/gsm_signal")
.with(body: { signalStrength: ::Appium::Core::Android::Device::Emulator::GSM_SIGNALS[:good] }.to_json)
.with(body: {
signalStrength: ::Appium::Core::Android::Device::Emulator::GSM_SIGNALS[:good],
signalStrengh: ::Appium::Core::Android::Device::Emulator::GSM_SIGNALS[:good]
}.to_json)
.to_return(headers: HEADER, status: 200, body: { value: '' }.to_json)

@driver.gsm_signal :good
Expand Down

0 comments on commit 5ef3b38

Please sign in to comment.