Skip to content

Commit eec6879

Browse files
authored
Merge branch 'trunk' into java_bidi_history_updated
2 parents e0738dd + 6f4ce7e commit eec6879

File tree

34 files changed

+804
-255
lines changed

34 files changed

+804
-255
lines changed

.github/workflows/ci-python.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
run: |
2929
python -m pip install --upgrade pip
3030
pip install tox==4.25.0
31-
- name: Test with tox
31+
- name: Generate docs
3232
run: tox -c py/tox.ini
3333
env:
3434
TOXENV: docs
@@ -48,10 +48,9 @@ jobs:
4848
run: |
4949
python -m pip install --upgrade pip
5050
pip install tox==4.25.0
51-
- name: Test with tox
51+
- name: Run type checking
5252
run: |
53-
tox -c py/tox.ini -- --cobertura-xml-report ci || true
54-
bash <(curl -s https://codecov.io/bash) -f py/ci/cobertura.xml
53+
tox -c py/tox.ini || true
5554
env:
5655
TOXENV: mypy
5756

MODULE.bazel

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,13 +370,17 @@ use_repo(
370370
pin_browsers_extension = use_extension("//common:repositories.bzl", "pin_browsers_extension")
371371
use_repo(
372372
pin_browsers_extension,
373+
"linux_beta_chrome",
374+
"linux_beta_chromedriver",
373375
"linux_beta_firefox",
374376
"linux_chrome",
375377
"linux_chromedriver",
376378
"linux_edge",
377379
"linux_edgedriver",
378380
"linux_firefox",
379381
"linux_geckodriver",
382+
"mac_beta_chrome",
383+
"mac_beta_chromedriver",
380384
"mac_beta_firefox",
381385
"mac_chrome",
382386
"mac_chromedriver",

common/browsers.bzl

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,3 +83,25 @@ firefox_beta_data = select({
8383
],
8484
"//conditions:default": [],
8585
}) + geckodriver_data
86+
87+
chromedriver_beta_data = select({
88+
"@selenium//common:use_pinned_linux_chrome": [
89+
"@linux_beta_chromedriver//:chromedriver",
90+
],
91+
"@selenium//common:use_pinned_macos_chrome": [
92+
"@mac_beta_chromedriver//:chromedriver",
93+
],
94+
"@selenium//common:use_local_chromedriver": ["@selenium//common:chromedriver"],
95+
"//conditions:default": [],
96+
})
97+
98+
chrome_beta_data = select({
99+
"@selenium//common:use_pinned_linux_chrome": [
100+
"@linux_beta_chrome//:files",
101+
"@linux_beta_chrome//:chrome-linux64/chrome",
102+
],
103+
"@selenium//common:use_pinned_macos_chrome": [
104+
"@mac_beta_chrome//:Chrome.app",
105+
],
106+
"//conditions:default": [],
107+
}) + chromedriver_beta_data

common/repositories.bzl

Lines changed: 94 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ def pin_browsers():
1111

1212
http_archive(
1313
name = "linux_firefox",
14-
url = "https://ftp.mozilla.org/pub/firefox/releases/139.0.1/linux-x86_64/en-US/firefox-139.0.1.tar.xz",
15-
sha256 = "f1a264f61d41700e8fcfa2310478d0c909655399a413072664fddaf612b53c07",
14+
url = "https://ftp.mozilla.org/pub/firefox/releases/139.0.4/linux-x86_64/en-US/firefox-139.0.4.tar.xz",
15+
sha256 = "fe22686f09a0c46390fea430b26cccc323d92af26869699f394f25b5e71527a3",
1616
build_file_content = """
1717
load("@aspect_rules_js//js:defs.bzl", "js_library")
1818
package(default_visibility = ["//visibility:public"])
@@ -33,8 +33,8 @@ js_library(
3333

3434
dmg_archive(
3535
name = "mac_firefox",
36-
url = "https://ftp.mozilla.org/pub/firefox/releases/139.0.1/mac/en-US/Firefox%20139.0.1.dmg",
37-
sha256 = "243478e2a2fd5d9dd0cc261c812b0146e433d703fec960c27c7284b2de7e65bc",
36+
url = "https://ftp.mozilla.org/pub/firefox/releases/139.0.4/mac/en-US/Firefox%20139.0.4.dmg",
37+
sha256 = "fc058bf34094828c0919ad81672d697cf01dfa291ba9b11e0b1c119588878405",
3838
build_file_content = """
3939
load("@aspect_rules_js//js:defs.bzl", "js_library")
4040
package(default_visibility = ["//visibility:public"])
@@ -50,8 +50,8 @@ js_library(
5050

5151
http_archive(
5252
name = "linux_beta_firefox",
53-
url = "https://ftp.mozilla.org/pub/firefox/releases/140.0b6/linux-x86_64/en-US/firefox-140.0b6.tar.xz",
54-
sha256 = "ae3fc88078ea41f85a24ab6c4f865b476ceebef4c3a2117e02607c7afdc191a8",
53+
url = "https://ftp.mozilla.org/pub/firefox/releases/140.0b8/linux-x86_64/en-US/firefox-140.0b8.tar.xz",
54+
sha256 = "1fa8bcb1e242ffbad091b3ee7067ece582d34508db394e656832ab07b058e96e",
5555
build_file_content = """
5656
load("@aspect_rules_js//js:defs.bzl", "js_library")
5757
package(default_visibility = ["//visibility:public"])
@@ -72,8 +72,8 @@ js_library(
7272

7373
dmg_archive(
7474
name = "mac_beta_firefox",
75-
url = "https://ftp.mozilla.org/pub/firefox/releases/140.0b6/mac/en-US/Firefox%20140.0b6.dmg",
76-
sha256 = "cd0326af92ca17e5121c916edfe10e913ec39d8ccd16c079207effa7d4aaab75",
75+
url = "https://ftp.mozilla.org/pub/firefox/releases/140.0b8/mac/en-US/Firefox%20140.0b8.dmg",
76+
sha256 = "7e648f5e0305a6abedb698ea5b29971cd1eb58225b998baa85a82d94bcf75342",
7777
build_file_content = """
7878
load("@aspect_rules_js//js:defs.bzl", "js_library")
7979
package(default_visibility = ["//visibility:public"])
@@ -199,8 +199,8 @@ js_library(
199199

200200
http_archive(
201201
name = "linux_chrome",
202-
url = "https://storage.googleapis.com/chrome-for-testing-public/137.0.7151.68/linux64/chrome-linux64.zip",
203-
sha256 = "5e92980724bb8577964d6914a6faa8021ff9b640944673e9b5fcb6eccfc16c8e",
202+
url = "https://storage.googleapis.com/chrome-for-testing-public/137.0.7151.70/linux64/chrome-linux64.zip",
203+
sha256 = "da1424d975dbe963b0a7f7f8e8c2e477bfed6b3430a2bc0b287f1c247ec62ee3",
204204
build_file_content = """
205205
load("@aspect_rules_js//js:defs.bzl", "js_library")
206206
package(default_visibility = ["//visibility:public"])
@@ -218,11 +218,10 @@ js_library(
218218
)
219219
""",
220220
)
221-
222221
http_archive(
223222
name = "mac_chrome",
224-
url = "https://storage.googleapis.com/chrome-for-testing-public/137.0.7151.68/mac-x64/chrome-mac-x64.zip",
225-
sha256 = "d15327182bee2493286f5f0c526ab6efb7888944d6714ffba5b67997e6c1af93",
223+
url = "https://storage.googleapis.com/chrome-for-testing-public/137.0.7151.70/mac-x64/chrome-mac-x64.zip",
224+
sha256 = "2ea79a9457dbaffae6fbdf592c93776ac859dca98b448f7513cdd68234454a07",
226225
strip_prefix = "chrome-mac-x64",
227226
patch_cmds = [
228227
"mv 'Google Chrome for Testing.app' Chrome.app",
@@ -240,11 +239,10 @@ js_library(
240239
)
241240
""",
242241
)
243-
244242
http_archive(
245243
name = "linux_chromedriver",
246-
url = "https://storage.googleapis.com/chrome-for-testing-public/137.0.7151.68/linux64/chromedriver-linux64.zip",
247-
sha256 = "05e356b3dd497a26f5e3412c67b59976853458f1b3aa5b2b9f606cecdf922586",
244+
url = "https://storage.googleapis.com/chrome-for-testing-public/137.0.7151.70/linux64/chromedriver-linux64.zip",
245+
sha256 = "cade69e8d67f4951049e56d796111755e0bf9240d26378975a95c8423bb3f55a",
248246
strip_prefix = "chromedriver-linux64",
249247
build_file_content = """
250248
load("@aspect_rules_js//js:defs.bzl", "js_library")
@@ -261,8 +259,86 @@ js_library(
261259

262260
http_archive(
263261
name = "mac_chromedriver",
264-
url = "https://storage.googleapis.com/chrome-for-testing-public/137.0.7151.68/mac-x64/chromedriver-mac-x64.zip",
265-
sha256 = "f369406a48ca98edfc1845e3900be039ab4c93deabe941288514bb402631a5c1",
262+
url = "https://storage.googleapis.com/chrome-for-testing-public/137.0.7151.70/mac-x64/chromedriver-mac-x64.zip",
263+
sha256 = "d80825e87543d99ad7a8b9356fb236ddb7df3ba087f8f314991195da27a7ccc3",
264+
strip_prefix = "chromedriver-mac-x64",
265+
build_file_content = """
266+
load("@aspect_rules_js//js:defs.bzl", "js_library")
267+
package(default_visibility = ["//visibility:public"])
268+
269+
exports_files(["chromedriver"])
270+
271+
js_library(
272+
name = "chromedriver-js",
273+
data = ["chromedriver"],
274+
)
275+
""",
276+
)
277+
278+
http_archive(
279+
name = "linux_beta_chrome",
280+
url = "https://storage.googleapis.com/chrome-for-testing-public/138.0.7204.15/linux64/chrome-linux64.zip",
281+
sha256 = "e4bb8769b613eacd7cc40e48f3f63d96de9e9ee642360b4a79bedd502291c544",
282+
build_file_content = """
283+
load("@aspect_rules_js//js:defs.bzl", "js_library")
284+
package(default_visibility = ["//visibility:public"])
285+
286+
filegroup(
287+
name = "files",
288+
srcs = glob(["**/*"]),
289+
)
290+
291+
exports_files(["chrome-linux64/chrome"])
292+
293+
js_library(
294+
name = "chrome-js",
295+
data = [":files"],
296+
)
297+
""",
298+
)
299+
http_archive(
300+
name = "mac_beta_chrome",
301+
url = "https://storage.googleapis.com/chrome-for-testing-public/138.0.7204.15/mac-x64/chrome-mac-x64.zip",
302+
sha256 = "46dbfe39930cd3a2a45bc85a70bb49c291c258fde5be4d3d4deecc8e3181ae2f",
303+
strip_prefix = "chrome-mac-x64",
304+
patch_cmds = [
305+
"mv 'Google Chrome for Testing.app' Chrome.app",
306+
"mv 'Chrome.app/Contents/MacOS/Google Chrome for Testing' Chrome.app/Contents/MacOS/Chrome",
307+
],
308+
build_file_content = """
309+
load("@aspect_rules_js//js:defs.bzl", "js_library")
310+
package(default_visibility = ["//visibility:public"])
311+
312+
exports_files(["Chrome.app"])
313+
314+
js_library(
315+
name = "chrome-js",
316+
data = glob(["Chrome.app/**/*"]),
317+
)
318+
""",
319+
)
320+
http_archive(
321+
name = "linux_beta_chromedriver",
322+
url = "https://storage.googleapis.com/chrome-for-testing-public/138.0.7204.15/linux64/chromedriver-linux64.zip",
323+
sha256 = "b180e7569aa10a10e5b112b2b6cc21d126499122eaba0e90d264713285cc9104",
324+
strip_prefix = "chromedriver-linux64",
325+
build_file_content = """
326+
load("@aspect_rules_js//js:defs.bzl", "js_library")
327+
package(default_visibility = ["//visibility:public"])
328+
329+
exports_files(["chromedriver"])
330+
331+
js_library(
332+
name = "chromedriver-js",
333+
data = ["chromedriver"],
334+
)
335+
""",
336+
)
337+
338+
http_archive(
339+
name = "mac_beta_chromedriver",
340+
url = "https://storage.googleapis.com/chrome-for-testing-public/138.0.7204.15/mac-x64/chromedriver-mac-x64.zip",
341+
sha256 = "fda50dbab46115e2185cae0f3eeb8526c3f95175b0d4f7f7871aaf1e63590d5c",
266342
strip_prefix = "chromedriver-mac-x64",
267343
build_file_content = """
268344
load("@aspect_rules_js//js:defs.bzl", "js_library")

java/src/org/openqa/selenium/bidi/browsingcontext/BrowsingContext.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,12 @@ public List<BrowsingContextInfo> getTree() {
148148
"browsingContext.getTree", Map.of("root", id), browsingContextInfoListMapper));
149149
}
150150

151+
public List<BrowsingContextInfo> getTree(String root) {
152+
return this.bidi.send(
153+
new Command<>(
154+
"browsingContext.getTree", Map.of("root", root), browsingContextInfoListMapper));
155+
}
156+
151157
public List<BrowsingContextInfo> getTree(int maxDepth) {
152158
return this.bidi.send(
153159
new Command<>(
@@ -158,6 +164,16 @@ public List<BrowsingContextInfo> getTree(int maxDepth) {
158164
browsingContextInfoListMapper));
159165
}
160166

167+
public List<BrowsingContextInfo> getTree(String root, int maxDepth) {
168+
return this.bidi.send(
169+
new Command<>(
170+
"browsingContext.getTree",
171+
Map.of(
172+
"root", root,
173+
"maxDepth", maxDepth),
174+
browsingContextInfoListMapper));
175+
}
176+
161177
public List<BrowsingContextInfo> getTopLevelContexts() {
162178
return this.bidi.send(
163179
new Command<>("browsingContext.getTree", new HashMap<>(), browsingContextInfoListMapper));

java/src/org/openqa/selenium/bidi/browsingcontext/BrowsingContextInfo.java

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@ public class BrowsingContextInfo {
3030

3131
private final List<BrowsingContextInfo> children;
3232

33+
private final String clientWindow;
34+
35+
private final String originalOpener;
36+
37+
private final String userContext;
38+
3339
private final String parentBrowsingContext;
3440

3541
public String getId() {
@@ -44,22 +50,40 @@ public List<BrowsingContextInfo> getChildren() {
4450
return children;
4551
}
4652

53+
public String getClientWindow() {
54+
return clientWindow;
55+
}
56+
57+
public String getOriginalOpener() {
58+
return originalOpener;
59+
}
60+
61+
public String getUserContext() {
62+
return userContext;
63+
}
64+
4765
public String getParentBrowsingContext() {
4866
return parentBrowsingContext;
4967
}
5068

5169
public BrowsingContextInfo(
52-
String id, String url, List<BrowsingContextInfo> children, String parentBrowsingContext) {
70+
String id, String url, List<BrowsingContextInfo> children, String clientWindow, String originalOpener, String userContext, String parentBrowsingContext) {
5371
this.id = id;
5472
this.url = url;
5573
this.children = children;
74+
this.clientWindow = clientWindow;
75+
this.originalOpener = originalOpener;
76+
this.userContext = userContext;
5677
this.parentBrowsingContext = parentBrowsingContext;
5778
}
5879

5980
public static BrowsingContextInfo fromJson(JsonInput input) {
6081
String id = null;
6182
String url = null;
6283
List<BrowsingContextInfo> children = null;
84+
String clientWindow = null;
85+
String originalOpener = null;
86+
String userContext = null;
6387
String parentBrowsingContext = null;
6488

6589
input.beginObject();
@@ -81,6 +105,18 @@ public static BrowsingContextInfo fromJson(JsonInput input) {
81105
parentBrowsingContext = input.read(String.class);
82106
break;
83107

108+
case "clientWindow":
109+
clientWindow = input.read(String.class);
110+
break;
111+
112+
case "originalOpener":
113+
originalOpener = input.read(String.class);
114+
break;
115+
116+
case "userContext":
117+
userContext = input.read(String.class);
118+
break;
119+
84120
default:
85121
input.skipValue();
86122
break;
@@ -89,6 +125,6 @@ public static BrowsingContextInfo fromJson(JsonInput input) {
89125

90126
input.endObject();
91127

92-
return new BrowsingContextInfo(id, url, children, parentBrowsingContext);
128+
return new BrowsingContextInfo(id, url, children, clientWindow, originalOpener, userContext, parentBrowsingContext);
93129
}
94130
}

0 commit comments

Comments
 (0)