From f0f885aa1ca75b64da797409831b8f057b6d2422 Mon Sep 17 00:00:00 2001 From: Khanh Do Date: Tue, 5 Mar 2019 16:28:36 +0700 Subject: [PATCH 1/6] Fixed typo signalStrengh --- test/unit/android/device/mjsonwp/commands_test.rb | 2 +- test/unit/android/device/w3c/commands_test.rb | 2 +- test/unit/script/test_routes.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/unit/android/device/mjsonwp/commands_test.rb b/test/unit/android/device/mjsonwp/commands_test.rb index d8bb39b9..4741168d 100644 --- a/test/unit/android/device/mjsonwp/commands_test.rb +++ b/test/unit/android/device/mjsonwp/commands_test.rb @@ -339,7 +339,7 @@ def test_gsm_call def test_gsm_signal stub_request(:post, "#{SESSION}/appium/device/gsm_signal") - .with(body: { signalStrengh: ::Appium::Core::Android::Device::Emulator::GSM_SIGNALS[:good] }.to_json) + .with(body: { signalStrength: ::Appium::Core::Android::Device::Emulator::GSM_SIGNALS[:good] }.to_json) .to_return(headers: HEADER, status: 200, body: { value: '' }.to_json) @driver.gsm_signal :good diff --git a/test/unit/android/device/w3c/commands_test.rb b/test/unit/android/device/w3c/commands_test.rb index 29509caa..9a048f81 100644 --- a/test/unit/android/device/w3c/commands_test.rb +++ b/test/unit/android/device/w3c/commands_test.rb @@ -340,7 +340,7 @@ def test_gsm_call def test_gsm_signal stub_request(:post, "#{SESSION}/appium/device/gsm_signal") - .with(body: { signalStrengh: ::Appium::Core::Android::Device::Emulator::GSM_SIGNALS[:good] }.to_json) + .with(body: { signalStrength: ::Appium::Core::Android::Device::Emulator::GSM_SIGNALS[:good] }.to_json) .to_return(headers: HEADER, status: 200, body: { value: '' }.to_json) @driver.gsm_signal :good diff --git a/test/unit/script/test_routes.js b/test/unit/script/test_routes.js index 19dc3f59..da09e069 100644 --- a/test/unit/script/test_routes.js +++ b/test/unit/script/test_routes.js @@ -341,7 +341,7 @@ const METHOD_MAP = { POST: {command: 'gsmCall', payloadParams: {required: ['phoneNumber', 'action']}} }, '/wd/hub/session/:sessionId/appium/device/gsm_signal': { - POST: {command: 'gsmSignal', payloadParams: {required: ['signalStrengh']}} + POST: {command: 'gsmSignal', payloadParams: {required: ['signalStrength']}} }, '/wd/hub/session/:sessionId/appium/device/gsm_voice': { POST: {command: 'gsmVoice', payloadParams: {required: ['state']}} From b75cf33d45cfcf8a74682bfddbf0d8f26aef8b70 Mon Sep 17 00:00:00 2001 From: Khanh Do Date: Tue, 5 Mar 2019 16:55:43 +0700 Subject: [PATCH 2/6] Update signalStrengh --- lib/appium_lib_core/android/device/emulator.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/appium_lib_core/android/device/emulator.rb b/lib/appium_lib_core/android/device/emulator.rb index 1473a7a0..67532af7 100644 --- a/lib/appium_lib_core/android/device/emulator.rb +++ b/lib/appium_lib_core/android/device/emulator.rb @@ -119,7 +119,7 @@ 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, {}, { signalStrengh: GSM_SIGNALS[signal_strength] }) + execute(:gsm_signal, {}, { signalStrength: GSM_SIGNALS[signal_strength] }) end end From f044beada44e0edc17591b3ef3d9d93db207d338 Mon Sep 17 00:00:00 2001 From: Khanh Do Date: Wed, 6 Mar 2019 21:58:26 +0700 Subject: [PATCH 3/6] Added backwards compatible --- lib/appium_lib_core/android/device/emulator.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/appium_lib_core/android/device/emulator.rb b/lib/appium_lib_core/android/device/emulator.rb index 67532af7..47903053 100644 --- a/lib/appium_lib_core/android/device/emulator.rb +++ b/lib/appium_lib_core/android/device/emulator.rb @@ -119,7 +119,7 @@ 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] }) + execute(:gsm_signal, {}, { signalStrength: GSM_SIGNALS[signal_strength], signalStrengh: GSM_SIGNALS[signal_strength] }) end end From 5064421d8e8b388d7b2ff8bf0620e2bad9b984e0 Mon Sep 17 00:00:00 2001 From: Khanh Do Date: Wed, 6 Mar 2019 22:17:55 +0700 Subject: [PATCH 4/6] Fixed "Indent the right brace the same as the first position after the preceding left parenthesis." --- lib/appium_lib_core/android/device/emulator.rb | 2 +- test/unit/android/device/mjsonwp/commands_test.rb | 2 +- test/unit/android/device/w3c/commands_test.rb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/appium_lib_core/android/device/emulator.rb b/lib/appium_lib_core/android/device/emulator.rb index 47903053..166f1568 100644 --- a/lib/appium_lib_core/android/device/emulator.rb +++ b/lib/appium_lib_core/android/device/emulator.rb @@ -118,7 +118,7 @@ def gsm_call(phone_number:, action:) ::Appium::Core::Device.add_endpoint_method(:gsm_signal) do 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] }) end end diff --git a/test/unit/android/device/mjsonwp/commands_test.rb b/test/unit/android/device/mjsonwp/commands_test.rb index 4741168d..f678fec6 100644 --- a/test/unit/android/device/mjsonwp/commands_test.rb +++ b/test/unit/android/device/mjsonwp/commands_test.rb @@ -339,7 +339,7 @@ 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 diff --git a/test/unit/android/device/w3c/commands_test.rb b/test/unit/android/device/w3c/commands_test.rb index 9a048f81..cc7d87f2 100644 --- a/test/unit/android/device/w3c/commands_test.rb +++ b/test/unit/android/device/w3c/commands_test.rb @@ -340,7 +340,7 @@ 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 From 3a50b5c452f2e7c6033a27dbe774d9501353bc21 Mon Sep 17 00:00:00 2001 From: Khanh Do Date: Wed, 6 Mar 2019 22:45:08 +0700 Subject: [PATCH 5/6] Fixed long line --- lib/appium_lib_core/android/device/emulator.rb | 3 ++- test/unit/android/device/mjsonwp/commands_test.rb | 3 ++- test/unit/android/device/w3c/commands_test.rb | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/appium_lib_core/android/device/emulator.rb b/lib/appium_lib_core/android/device/emulator.rb index 166f1568..f454c743 100644 --- a/lib/appium_lib_core/android/device/emulator.rb +++ b/lib/appium_lib_core/android/device/emulator.rb @@ -119,7 +119,8 @@ 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 diff --git a/test/unit/android/device/mjsonwp/commands_test.rb b/test/unit/android/device/mjsonwp/commands_test.rb index f678fec6..f3c70b7d 100644 --- a/test/unit/android/device/mjsonwp/commands_test.rb +++ b/test/unit/android/device/mjsonwp/commands_test.rb @@ -339,7 +339,8 @@ 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], signalStrengh: ::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 diff --git a/test/unit/android/device/w3c/commands_test.rb b/test/unit/android/device/w3c/commands_test.rb index cc7d87f2..0ab08a5d 100644 --- a/test/unit/android/device/w3c/commands_test.rb +++ b/test/unit/android/device/w3c/commands_test.rb @@ -340,7 +340,8 @@ 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], signalStrengh: ::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 From 6451baf3b8b4172e2e5b1500f9ed9c46092e718b Mon Sep 17 00:00:00 2001 From: Khanh Do Date: Wed, 6 Mar 2019 23:19:22 +0700 Subject: [PATCH 6/6] Fixed unittest --- lib/appium_lib_core/android/device/emulator.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/appium_lib_core/android/device/emulator.rb b/lib/appium_lib_core/android/device/emulator.rb index f454c743..e8b1e82a 100644 --- a/lib/appium_lib_core/android/device/emulator.rb +++ b/lib/appium_lib_core/android/device/emulator.rb @@ -118,7 +118,7 @@ def gsm_call(phone_number:, action:) ::Appium::Core::Device.add_endpoint_method(:gsm_signal) do 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] }) end