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

Function chromedriver

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

Source from the content-addressed store, hash-verified

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

Callers 1

pinned_browsers.pyFile · 0.85

Calls 1

calculate_hashFunction · 0.85

Tested by

no test coverage detected