Fetch Edge browser and EdgeDriver, ensuring versions are compatible.
()
| 333 | |
| 334 | |
| 335 | def edge_and_edgedriver(): |
| 336 | """Fetch Edge browser and EdgeDriver, ensuring versions are compatible.""" |
| 337 | matches = {} |
| 338 | |
| 339 | for platform in ["mac", "linux"]: |
| 340 | print(f"Finding matching Edge version for {platform}...", file=sys.stderr) |
| 341 | match = find_matching_edge_version(platform) |
| 342 | if match: |
| 343 | matches[platform] = match |
| 344 | else: |
| 345 | print( |
| 346 | f"Warning: No matching Edge browser/driver found for {platform}", |
| 347 | file=sys.stderr, |
| 348 | ) |
| 349 | |
| 350 | content = "" |
| 351 | |
| 352 | # Output browsers first: mac, then linux |
| 353 | if "mac" in matches: |
| 354 | browser = matches["mac"]["browser"] |
| 355 | content += mac_edge_browser_content(browser["url"], browser["hash"], browser["version"]) |
| 356 | |
| 357 | if "linux" in matches: |
| 358 | browser = matches["linux"]["browser"] |
| 359 | content += linux_edge_browser_content(browser["url"], browser["hash"]) |
| 360 | |
| 361 | # Output drivers: linux, then mac |
| 362 | if "linux" in matches: |
| 363 | content += edgedriver_content("linux_edgedriver", matches["linux"]["driver_url"]) |
| 364 | |
| 365 | if "mac" in matches: |
| 366 | content += edgedriver_content("mac_edgedriver", matches["mac"]["driver_url"]) |
| 367 | |
| 368 | return content |
| 369 | |
| 370 | |
| 371 | def edgedriver_content(name, driver_url): |
no test coverage detected