Skip to content

Commit 4241b70

Browse files
Integrate TypeScript atoms-ts into Python WebDriver build
- Replace 3 JavaScript atoms with TypeScript versions: * getAttribute: //javascript/webdriver/atoms → //javascript/webdriver-atoms-ts/src:attribute * isDisplayed: //javascript/atoms/fragments → //javascript/webdriver-atoms-ts/src:dom * findElements: //javascript/atoms/fragments → //javascript/webdriver-atoms-ts/src:find_element - Add select_file rules to extract specific .js outputs from multi-output ts_project targets - Update visibility in webdriver-atoms-ts to public for cross-package access - Build verified: bazel build //py:selenium completes successfully This integrates the new type-safe TypeScript atoms into the Python WebDriver, replacing old JavaScript atom implementations with the new atoms-ts versions.
1 parent fd62011 commit 4241b70

2 files changed

Lines changed: 48 additions & 21 deletions

File tree

javascript/webdriver-atoms-ts/src/BUILD.bazel

Lines changed: 27 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ ts_project(
1313
"//javascript/atoms-ts/src:json",
1414
"//javascript/atoms-ts/src:response",
1515
],
16-
visibility = ["//javascript/webdriver-atoms-ts:__subpackages__"],
16+
visibility = ["//visibility:public"],
1717
)
1818

1919
ts_project(
@@ -24,7 +24,7 @@ ts_project(
2424
resolve_json_module = True,
2525
source_map = True,
2626
tsconfig = "tsconfig.json",
27-
visibility = ["//javascript/webdriver-atoms-ts:__subpackages__"],
27+
visibility = ["//visibility:public"],
2828
)
2929

3030
ts_project(
@@ -35,7 +35,7 @@ ts_project(
3535
resolve_json_module = True,
3636
source_map = True,
3737
tsconfig = "tsconfig.json",
38-
visibility = ["//javascript/webdriver-atoms-ts:__subpackages__"],
38+
visibility = ["//visibility:public"],
3939
)
4040

4141
ts_project(
@@ -46,7 +46,7 @@ ts_project(
4646
resolve_json_module = True,
4747
source_map = True,
4848
tsconfig = "tsconfig.json",
49-
visibility = ["//javascript/webdriver-atoms-ts:__subpackages__"],
49+
visibility = ["//visibility:public"],
5050
)
5151

5252
ts_project(
@@ -60,7 +60,16 @@ ts_project(
6060
deps = [
6161
"//javascript/atoms-ts/src:dom",
6262
],
63-
visibility = ["//javascript/webdriver-atoms-ts:__subpackages__"],
63+
visibility = [
64+
"//javascript/webdriver-atoms-ts:__subpackages__",
65+
"//dotnet/src/webdriver:__pkg__",
66+
"//java/src/org/openqa/selenium/remote:__pkg__",
67+
"//javascript/chrome-driver:__pkg__",
68+
"//javascript/ie-driver:__pkg__",
69+
"//javascript/selenium-webdriver/lib/atoms:__pkg__",
70+
"//py:__pkg__",
71+
"//rb/lib/selenium/webdriver/atoms:__pkg__",
72+
],
6473
)
6574

6675
ts_project(
@@ -78,7 +87,7 @@ ts_project(
7887
"//javascript/atoms-ts/src:dom",
7988
"//javascript/atoms-ts/src:keyboard",
8089
],
81-
visibility = ["//javascript/webdriver-atoms-ts:__subpackages__"],
90+
visibility = ["//visibility:public"],
8291
)
8392

8493
ts_project(
@@ -97,7 +106,7 @@ ts_project(
97106
"//javascript/atoms-ts/src:keyboard",
98107
"//javascript/atoms-ts/src:mouse",
99108
],
100-
visibility = ["//javascript/webdriver-atoms-ts:__subpackages__"],
109+
visibility = ["//visibility:public"],
101110
)
102111

103112
ts_project(
@@ -111,7 +120,7 @@ ts_project(
111120
deps = [
112121
":inject",
113122
],
114-
visibility = ["//javascript/webdriver-atoms-ts:__subpackages__"],
123+
visibility = ["//visibility:public"],
115124
)
116125

117126
ts_project(
@@ -125,7 +134,7 @@ ts_project(
125134
deps = [
126135
":execute_script",
127136
],
128-
visibility = ["//javascript/webdriver-atoms-ts:__subpackages__"],
137+
visibility = ["//visibility:public"],
129138
)
130139

131140
ts_project(
@@ -139,7 +148,7 @@ ts_project(
139148
deps = [
140149
":execute_script",
141150
],
142-
visibility = ["//javascript/webdriver-atoms-ts:__subpackages__"],
151+
visibility = ["//visibility:public"],
143152
)
144153

145154
ts_project(
@@ -153,7 +162,7 @@ ts_project(
153162
deps = [
154163
":execute_script",
155164
],
156-
visibility = ["//javascript/webdriver-atoms-ts:__subpackages__"],
165+
visibility = ["//visibility:public"],
157166
)
158167

159168
ts_project(
@@ -167,7 +176,7 @@ ts_project(
167176
deps = [
168177
":execute_script",
169178
],
170-
visibility = ["//javascript/webdriver-atoms-ts:__subpackages__"],
179+
visibility = ["//visibility:public"],
171180
)
172181

173182
ts_project(
@@ -181,7 +190,7 @@ ts_project(
181190
deps = [
182191
":local_storage",
183192
],
184-
visibility = ["//javascript/webdriver-atoms-ts:__subpackages__"],
193+
visibility = ["//visibility:public"],
185194
)
186195

187196
ts_project(
@@ -195,7 +204,7 @@ ts_project(
195204
deps = [
196205
":session_storage",
197206
],
198-
visibility = ["//javascript/webdriver-atoms-ts:__subpackages__"],
207+
visibility = ["//visibility:public"],
199208
)
200209

201210
ts_project(
@@ -206,7 +215,7 @@ ts_project(
206215
resolve_json_module = True,
207216
source_map = True,
208217
tsconfig = "tsconfig.json",
209-
visibility = ["//javascript/webdriver-atoms-ts:__subpackages__"],
218+
visibility = ["//visibility:public"],
210219
)
211220

212221
ts_project(
@@ -220,7 +229,7 @@ ts_project(
220229
deps = [
221230
":appcache",
222231
],
223-
visibility = ["//javascript/webdriver-atoms-ts:__subpackages__"],
232+
visibility = ["//visibility:public"],
224233
)
225234

226235
ts_project(
@@ -249,7 +258,7 @@ ts_project(
249258
":sql_database",
250259
":inject_appcache",
251260
],
252-
visibility = ["//javascript/webdriver-atoms-ts:__subpackages__"],
261+
visibility = ["//visibility:public"],
253262
)
254263

255264
# Aggregated targets for Phase 1, Phase 2, Phase 3, Phase 4, and Phase 5
@@ -274,5 +283,5 @@ filegroup(
274283
":inject_appcache",
275284
":exports",
276285
],
277-
visibility = ["//javascript/webdriver-atoms-ts:__subpackages__"],
286+
visibility = ["//visibility:public"],
278287
)

py/BUILD.bazel

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,21 +114,39 @@ copy_file(
114114
out = "selenium/webdriver/common/windows/selenium-manager.exe",
115115
)
116116

117+
select_file(
118+
name = "attribute-js",
119+
srcs = "//javascript/webdriver-atoms-ts/src:attribute",
120+
subpath = "attribute.js",
121+
)
122+
117123
copy_file(
118124
name = "get-attribute",
119-
src = "//javascript/webdriver/atoms:get-attribute.js",
125+
src = ":attribute-js",
120126
out = "selenium/webdriver/remote/getAttribute.js",
121127
)
122128

129+
select_file(
130+
name = "dom-js",
131+
srcs = "//javascript/webdriver-atoms-ts/src:dom",
132+
subpath = "dom.js",
133+
)
134+
123135
copy_file(
124136
name = "is-displayed",
125-
src = "//javascript/atoms/fragments:is-displayed.js",
137+
src = ":dom-js",
126138
out = "selenium/webdriver/remote/isDisplayed.js",
127139
)
128140

141+
select_file(
142+
name = "find-element-js",
143+
srcs = "//javascript/webdriver-atoms-ts/src:find_element",
144+
subpath = "find_element.js",
145+
)
146+
129147
copy_file(
130148
name = "find-elements",
131-
src = "//javascript/atoms/fragments:find-elements.js",
149+
src = ":find-element-js",
132150
out = "selenium/webdriver/remote/findElements.js",
133151
)
134152

0 commit comments

Comments
 (0)