MCPcopy Create free account
hub / github.com/SeleniumHQ/selenium / chromedriver

Function chromedriver

scripts/pinned_browsers.py:48–102  ·  view source on GitHub ↗
(selected_version, workspace_prefix="")

Source from the content-addressed store, hash-verified

46
47
48def chromedriver(selected_version, workspace_prefix=""):
49 content = ""
50
51 drivers = selected_version["downloads"]["chromedriver"]
52
53 url = next((d["url"] for d in drivers if d["platform"] == "linux64"), None)
54 if url is None:
55 raise ValueError("No chromedriver download found for platform 'linux64'")
56 sha = calculate_hash(url)
57
58 content += f""" http_archive(
59 name = "linux_{workspace_prefix}chromedriver",
60 url = "{url}",
61 sha256 = "{sha}",
62 strip_prefix = "chromedriver-linux64",
63 build_file_content = \"\"\"
64load("@aspect_rules_js//js:defs.bzl", "js_library")
65package(default_visibility = ["//visibility:public"])
66
67exports_files(["chromedriver"])
68
69js_library(
70 name = "chromedriver-js",
71 data = ["chromedriver"],
72)
73\"\"\",
74 )
75"""
76
77 url = next((d["url"] for d in drivers if d["platform"] == "mac-arm64"), None)
78 if url is None:
79 raise ValueError("No chromedriver download found for platform 'mac-arm64'")
80 sha = calculate_hash(url)
81
82 content += f"""
83 http_archive(
84 name = "mac_{workspace_prefix}chromedriver",
85 url = "{url}",
86 sha256 = "{sha}",
87 strip_prefix = "chromedriver-mac-arm64",
88 build_file_content = \"\"\"
89load("@aspect_rules_js//js:defs.bzl", "js_library")
90package(default_visibility = ["//visibility:public"])
91
92exports_files(["chromedriver"])
93
94js_library(
95 name = "chromedriver-js",
96 data = ["chromedriver"],
97)
98\"\"\",
99 )
100"""
101
102 return content
103
104
105def chrome(selected_version, workspace_prefix=""):

Callers 1

pinned_browsers.pyFile · 0.85

Calls 1

calculate_hashFunction · 0.85

Tested by

no test coverage detected