Skip to content

Commit a64c4d5

Browse files
authored
Merge branch 'trunk' into java-select-refactor-duplicated-code
2 parents 92a5664 + d808465 commit a64c4d5

File tree

4 files changed

+19
-20
lines changed

4 files changed

+19
-20
lines changed

common/repositories.bzl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -123,10 +123,10 @@ js_library(
123123

124124
pkg_archive(
125125
name = "mac_edge",
126-
url = "https://msedge.sf.dl.delivery.mp.microsoft.com/filestreamingservice/files/017e25fc-2906-45b2-958c-1c71c4667dc1/MicrosoftEdge-139.0.3405.111.pkg",
127-
sha256 = "1aa42cbaaf38b035e17d43fbbe0a293ceb286c5fd298d463b1a369ed900a03ac",
126+
url = "https://msedge.sf.dl.delivery.mp.microsoft.com/filestreamingservice/files/95344cbf-d116-4494-8485-b96014e98901/MicrosoftEdge-139.0.3405.119.pkg",
127+
sha256 = "31b3ddce353180a706179d64086ed01b53cfd20a7daea45597a7e9e405fc553f",
128128
move = {
129-
"MicrosoftEdge-139.0.3405.111.pkg/Payload/Microsoft Edge.app": "Edge.app",
129+
"MicrosoftEdge-139.0.3405.119.pkg/Payload/Microsoft Edge.app": "Edge.app",
130130
},
131131
build_file_content = """
132132
load("@aspect_rules_js//js:defs.bzl", "js_library")
@@ -143,8 +143,8 @@ js_library(
143143

144144
deb_archive(
145145
name = "linux_edge",
146-
url = "https://packages.microsoft.com/repos/edge/pool/main/m/microsoft-edge-stable/microsoft-edge-stable_139.0.3405.111-1_amd64.deb",
147-
sha256 = "d61b2fcef695083496184a6a323b2bcfb57d45af8fb6867ffe54974a5992dc52",
146+
url = "https://packages.microsoft.com/repos/edge/pool/main/m/microsoft-edge-stable/microsoft-edge-stable_139.0.3405.119-1_amd64.deb",
147+
sha256 = "e51e4e36cde5e7be2031fd9145ac9bf26444f734a88ff43858e05c7782e60c7b",
148148
build_file_content = """
149149
load("@aspect_rules_js//js:defs.bzl", "js_library")
150150
package(default_visibility = ["//visibility:public"])

java/src/org/openqa/selenium/grid/node/Node.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,9 +199,7 @@ protected Node(
199199
.to(() -> new Drain(this, json))
200200
.with(spanDecorator("node.drain").andThen(requiresSecret)),
201201
get("/se/grid/node/status")
202-
.to(
203-
() ->
204-
req -> new HttpResponse().setContent(asJson(Map.of("value", getStatus()))))
202+
.to(() -> req -> new HttpResponse().setContent(asJson(getStatus())))
205203
.with(spanDecorator("node.node_status")),
206204
get("/status").to(() -> new StatusHandler(this)).with(spanDecorator("node.status")));
207205
}

java/src/org/openqa/selenium/grid/router/HandleSession.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import static org.openqa.selenium.remote.RemoteTags.SESSION_ID;
2222
import static org.openqa.selenium.remote.RemoteTags.SESSION_ID_EVENT;
2323
import static org.openqa.selenium.remote.http.Contents.asJson;
24+
import static org.openqa.selenium.remote.http.Contents.string;
2425
import static org.openqa.selenium.remote.http.HttpMethod.GET;
2526
import static org.openqa.selenium.remote.tracing.Tags.EXCEPTION;
2627
import static org.openqa.selenium.remote.tracing.Tags.HTTP_REQUEST;
@@ -48,8 +49,8 @@
4849
import org.openqa.selenium.grid.data.NodeStatus;
4950
import org.openqa.selenium.grid.sessionmap.SessionMap;
5051
import org.openqa.selenium.grid.web.ReverseProxyHandler;
51-
import org.openqa.selenium.grid.web.Values;
5252
import org.openqa.selenium.internal.Require;
53+
import org.openqa.selenium.json.Json;
5354
import org.openqa.selenium.remote.ErrorCodec;
5455
import org.openqa.selenium.remote.SessionId;
5556
import org.openqa.selenium.remote.http.ClientConfig;
@@ -256,10 +257,13 @@ private ClientConfig fetchNodeSessionTimeout(URI uri) {
256257
try (HttpClient httpClient = httpClientFactory.createClient(config)) {
257258
HttpRequest statusRequest = new HttpRequest(GET, "/se/grid/node/status");
258259
HttpResponse res = httpClient.execute(statusRequest);
259-
NodeStatus nodeStatus = Values.get(res, NodeStatus.class);
260+
Json json = new Json();
261+
NodeStatus nodeStatus = json.toType(string(res), NodeStatus.class);
260262
if (nodeStatus != null) {
261263
sessionTimeout = nodeStatus.getSessionTimeout();
262264
}
265+
} catch (Exception e) {
266+
LOG.fine("Unable to fetch status for " + uri);
263267
}
264268
LOG.fine("Set read timeout: " + sessionTimeout.toSeconds() + " seconds for " + uri);
265269
config = config.readTimeout(sessionTimeout);

py/test/selenium/webdriver/common/bidi_network_tests.py

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
# specific language governing permissions and limitations
1616
# under the License.
1717

18-
import pytest
1918

19+
from selenium.webdriver.common.bidi.browsing_context import ReadinessState
2020
from selenium.webdriver.common.bidi.network import Request
2121
from selenium.webdriver.common.by import By
2222

@@ -68,29 +68,26 @@ def callback(request: Request):
6868
assert driver.find_element(By.NAME, "login").is_displayed(), "Request not continued"
6969

7070

71-
@pytest.mark.xfail_chrome
72-
@pytest.mark.xfail_edge
7371
def test_continue_request(driver, pages):
7472
def callback(request: Request):
7573
request.continue_request()
7674

7775
callback_id = driver.network.add_request_handler("before_request", callback)
7876
assert callback_id is not None, "Request handler not added"
79-
pages.load("formPage.html")
77+
url = pages.url("formPage.html")
78+
driver.browsing_context.navigate(context=driver.current_window_handle, url=url, wait=ReadinessState.COMPLETE)
8079
assert driver.find_element(By.NAME, "login").is_displayed(), "Request not continued"
8180

8281

83-
@pytest.mark.xfail_chrome
84-
@pytest.mark.xfail_edge
8582
def test_continue_with_auth(driver):
86-
callback_id = driver.network.add_auth_handler("user", "passwd")
83+
callback_id = driver.network.add_auth_handler("postman", "password")
8784
assert callback_id is not None, "Request handler not added"
88-
driver.get("https://httpbin.org/basic-auth/user/passwd")
85+
driver.browsing_context.navigate(
86+
context=driver.current_window_handle, url="https://postman-echo.com/basic-auth", wait=ReadinessState.COMPLETE
87+
)
8988
assert "authenticated" in driver.page_source, "Authorization failed"
9089

9190

92-
@pytest.mark.xfail_chrome
93-
@pytest.mark.xfail_edge
9491
def test_remove_auth_handler(driver):
9592
callback_id = driver.network.add_auth_handler("user", "passwd")
9693
assert callback_id is not None, "Request handler not added"

0 commit comments

Comments
 (0)