Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion appium/options/common/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def process_key(k: str) -> str:
return key
return key if ':' in key else f'{APPIUM_PREFIX}{key}'

processed_caps = {process_key(k): v for k, v in copy.deepcopy(capabilities).items()}
processed_caps = {process_key(k): v for k, v in capabilities.items()}
return {'capabilities': {'firstMatch': [{}], 'alwaysMatch': processed_caps}}

def to_w3c(self) -> dict:
Expand Down
27 changes: 27 additions & 0 deletions test/unit/options/options_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
from appium.options.common.base import AppiumOptions


def test_as_w3c():
caps = {
'platformName': 'Android',
'platformVersion': '11.0',
'deviceName': 'Android Emulator',
'automationName': 'UiAutomator2',
'app': '/path/to/app.apk',
'customCap': 'customValue',
}
res = AppiumOptions.as_w3c(caps)
expected = {
'capabilities': {
'firstMatch': [{}],
'alwaysMatch': {
'platformName': 'Android',
'appium:platformVersion': '11.0',
'appium:deviceName': 'Android Emulator',
'appium:automationName': 'UiAutomator2',
'appium:app': '/path/to/app.apk',
'appium:customCap': 'customValue',
},
}
}
assert res == expected
Loading