From aa4f9c6d4d53784f2ee9e68f4a16a42b831c0af0 Mon Sep 17 00:00:00 2001 From: Kazuaki Matsuo Date: Wed, 14 Dec 2022 12:05:00 -0800 Subject: [PATCH] add note --- lib/appium_lib_core/common/base/bridge.rb | 3 +++ lib/appium_lib_core/common/base/capabilities.rb | 12 ++++++++++++ 2 files changed, 15 insertions(+) diff --git a/lib/appium_lib_core/common/base/bridge.rb b/lib/appium_lib_core/common/base/bridge.rb index b6354ec0..b087f0a1 100644 --- a/lib/appium_lib_core/common/base/bridge.rb +++ b/lib/appium_lib_core/common/base/bridge.rb @@ -112,6 +112,9 @@ def create_session(capabilities) @capabilities = json_create(response['capabilities']) end + # TODO: move the adding prefix into ::Appium::Core::Base::Capabilities so that + # so that this bridge class does not change from the selenium client + # # Append +appium:+ prefix for Appium following W3C spec # https://www.w3.org/TR/webdriver/#dfn-validate-capabilities # diff --git a/lib/appium_lib_core/common/base/capabilities.rb b/lib/appium_lib_core/common/base/capabilities.rb index caaf5c74..93bd1170 100644 --- a/lib/appium_lib_core/common/base/capabilities.rb +++ b/lib/appium_lib_core/common/base/capabilities.rb @@ -23,6 +23,18 @@ class Capabilities < ::Selenium::WebDriver::Remote::Capabilities # Appium's capabilities could change by depending on Appium versions. So it does not have # standard options like chrome and firefox etc. So, the implementation should differ from # other browsers. But here should inherit `Options` to follow Selenium. + + def json_create(value) + super + # do adding 'appium:' here + add_appium_prefix(value) + end + + private + + def add_appium_prefix(value) + # do 'add_appium_prefix' for the + end end end end