Makes a W3C alwaysMatch capabilities object. Filters out capability names that are not in the W3C spec. Spec-compliant drivers will reject requests containing unknown capability names. Moves the Firefox profile, if present, from the old location to the new Firefox options object.
(caps)
| 84 | |
| 85 | |
| 86 | def _create_caps(caps) -> dict: |
| 87 | """Makes a W3C alwaysMatch capabilities object. |
| 88 | |
| 89 | Filters out capability names that are not in the W3C spec. Spec-compliant |
| 90 | drivers will reject requests containing unknown capability names. |
| 91 | |
| 92 | Moves the Firefox profile, if present, from the old location to the new Firefox |
| 93 | options object. |
| 94 | |
| 95 | Args: |
| 96 | caps: A dictionary of capabilities requested by the caller. |
| 97 | """ |
| 98 | caps = copy.deepcopy(caps) |
| 99 | always_match = {} |
| 100 | for k, v in caps.items(): |
| 101 | always_match[k] = v |
| 102 | return {"capabilities": {"firstMatch": [{}], "alwaysMatch": always_match}} |
| 103 | |
| 104 | |
| 105 | def get_remote_connection( |