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)
| 146 | |
| 147 | |
| 148 | def _create_caps(caps) -> dict: |
| 149 | """Makes a W3C alwaysMatch capabilities object. |
| 150 | |
| 151 | Filters out capability names that are not in the W3C spec. Spec-compliant |
| 152 | drivers will reject requests containing unknown capability names. |
| 153 | |
| 154 | Moves the Firefox profile, if present, from the old location to the new Firefox |
| 155 | options object. |
| 156 | |
| 157 | Args: |
| 158 | caps: A dictionary of capabilities requested by the caller. |
| 159 | """ |
| 160 | caps = copy.deepcopy(caps) |
| 161 | always_match = {} |
| 162 | for k, v in caps.items(): |
| 163 | always_match[k] = v |
| 164 | return {"capabilities": {"firstMatch": [{}], "alwaysMatch": always_match}} |
| 165 | |
| 166 | |
| 167 | def get_remote_connection( |