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

Function chromedriver

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

Source from the content-addressed store, hash-verified

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

Callers 1

pinned_browsers.pyFile · 0.85

Calls 1

calculate_hashFunction · 0.85

Tested by

no test coverage detected