Skip to content

Commit 35dfe0b

Browse files
authored
Merge branch 'trunk' into webkit_service
2 parents 6ae3bd4 + 6ea5651 commit 35dfe0b

File tree

14 files changed

+141
-22
lines changed

14 files changed

+141
-22
lines changed

.github/workflows/ci-java.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ jobs:
2222
# https://github.com/bazelbuild/rules_jvm_external/issues/1046
2323
java-version: 17
2424
run: |
25+
fsutil 8dot3name set 0
2526
bazel test --flaky_test_attempts 3 //java/test/org/openqa/selenium/chrome:ChromeDriverFunctionalTest `
2627
//java/test/org/openqa/selenium/federatedcredentialmanagement:FederatedCredentialManagementTest `
2728
//java/test/org/openqa/selenium/firefox:FirefoxDriverBuilderTest `
89 Bytes
Binary file not shown.

common/extensions/webextensions-selenium-example/manifest.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,14 @@
1414
]
1515
}
1616
],
17+
"permissions": [
18+
"storage",
19+
"scripting"
20+
],
21+
"host_permissions": [
22+
"https://*/*",
23+
"http://*/*"
24+
],
1725
"browser_specific_settings": {
1826
"gecko": {
1927

dotnet/src/webdriver/WebDriver.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@
106106
</Target>
107107

108108
<Target Name="GenerateCdp" BeforeTargets="CoreCompile">
109-
<Exec Command="bazel build //dotnet/src/webdriver/cdp:generate-v85 //dotnet/src/webdriver/cdp:generate-v127 //dotnet/src/webdriver/cdp:generate-v128 //dotnet/src/webdriver/cdp:generate-v129" WorkingDirectory="../../.." />
109+
<Exec Command="bazel build //dotnet/src/webdriver/cdp/..." WorkingDirectory="../../.." />
110110

111111
<ItemGroup>
112112
<Compile Include="..\..\..\bazel-bin\dotnet\src\webdriver\cdp\**\*.cs" LinkBase="DevTools\generated" />

dotnet/src/webdriver/cdp/README.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,4 @@ perform the following steps, where `<N>` is the major version of the protocol:
5252
remove the entry for version `<N>` from the `SupportedDevToolsVersions` dictionary initialization.
5353
3. Remove the version string (`v<N>`) from the `SUPPORTED_DEVTOOLS_VERSIONS` list in
5454
[`//dotnet:selenium-dotnet-version.bzl`](https://github.com/SeleniumHQ/selenium/blob/trunk/dotnet/selenium-dotnet-version.bzl).
55-
4. In [`//dotnet/src/webdriver:WebDriver.csproj.prebuild.cmd`](https://github.com/SeleniumHQ/selenium/blob/trunk/dotnet/src/webdriver/WebDriver.csproj.prebuild.cmd),
56-
remove the `if not exist` block for version `<N>`.
57-
5. In [`//dotnet/src/webdriver:WebDriver.csproj.prebuild.sh`](https://github.com/SeleniumHQ/selenium/blob/trunk/dotnet/src/webdriver/WebDriver.csproj.prebuild.sh),
58-
remove the `if-fi` block for version `<N>`.
59-
6. Commit the changes.
60-
55+
4. Commit the changes.

javascript/grid-ui/src/screens/Overview/Overview.tsx

Lines changed: 39 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,39 @@ function Overview (): JSX.Element {
4848
fetchPolicy: 'network-only'
4949
})
5050

51-
const [sortOption, setSortOption] = useState('osInfo.name')
51+
function compareSlotStereotypes(a: NodeInfo, b: NodeInfo, attribute: string): number {
52+
const joinA = a.slotStereotypes.length === 1
53+
? a.slotStereotypes[0][attribute]
54+
: a.slotStereotypes.slice().map(st => st[attribute]).reverse().join(',')
55+
const joinB = b.slotStereotypes.length === 1
56+
? b.slotStereotypes[0][attribute]
57+
: b.slotStereotypes.slice().map(st => st[attribute]).reverse().join(',')
58+
return joinA.localeCompare(joinB)
59+
}
60+
61+
const sortProperties = {
62+
'platformName': (a, b) => compareSlotStereotypes(a, b, 'platformName'),
63+
'status': (a, b) => a.status.localeCompare(b.status),
64+
'browserName': (a, b) => compareSlotStereotypes(a, b, 'browserName'),
65+
'browserVersion': (a, b) => compareSlotStereotypes(a, b, 'browserVersion'),
66+
'slotCount': (a, b) => {
67+
const valueA = a.slotStereotypes.reduce((sum, st) => sum + st.slotCount, 0)
68+
const valueB = b.slotStereotypes.reduce((sum, st) => sum + st.slotCount, 0)
69+
return valueA < valueB ? -1 : 1
70+
},
71+
'id': (a, b) => (a.id < b.id ? -1 : 1)
72+
}
73+
74+
const sortPropertiesLabel = {
75+
'platformName': 'Platform Name',
76+
'status': 'Status',
77+
'browserName': 'Browser Name',
78+
'browserVersion': 'Browser Version',
79+
'slotCount': 'Slot Count',
80+
'id': 'ID'
81+
}
82+
83+
const [sortOption, setSortOption] = useState(Object.keys(sortProperties)[0])
5284
const [sortOrder, setSortOrder] = useState(1)
5385
const [sortedNodes, setSortedNodes] = useState<NodeInfo[]>([])
5486
const [isDescending, setIsDescending] = useState(false)
@@ -62,12 +94,6 @@ function Overview (): JSX.Element {
6294
setSortOrder(event.target.checked ? -1 : 1)
6395
}
6496

65-
const sortProperties = {
66-
'osInfo.name': (a, b) => a.osInfo.name.localeCompare(b.osInfo.name),
67-
'status': (a, b) => a.status.localeCompare(b.status),
68-
'id': (a, b) => (a.id < b.id ? -1 : 1)
69-
}
70-
7197
const sortNodes = useMemo(() => {
7298
return (nodes: NodeInfo[], option: string, order: number) => {
7399
const sortFn = sortProperties[option] || (() => 0)
@@ -156,10 +182,12 @@ function Overview (): JSX.Element {
156182
<InputLabel>Sort By</InputLabel>
157183
<Box display="flex" alignItems="center">
158184
<Select value={sortOption} onChange={handleSortChange}
159-
label="Sort By" style={{ minWidth: '150px' }}>
160-
<MenuItem value="osInfo.name">Platform</MenuItem>
161-
<MenuItem value="status">Status</MenuItem>
162-
<MenuItem value="id">ID</MenuItem>
185+
label="Sort By" style={{ minWidth: '170px' }}>
186+
{Object.keys(sortProperties).map((key) => (
187+
<MenuItem value={key}>
188+
{sortPropertiesLabel[key]}
189+
</MenuItem>
190+
))}
163191
</Select>
164192
<FormControlLabel
165193
control={<Checkbox checked={isDescending}

py/selenium/webdriver/remote/remote_connection.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ def execute(self, command, params):
305305
LOGGER.debug("%s %s %s", command_info[0], url, str(trimmed))
306306
return self._request(command_info[0], url, body=data)
307307

308-
def _request(self, method, url, body=None):
308+
def _request(self, method, url, body=None, timeout=120):
309309
"""Send an HTTP request to the remote server.
310310
311311
:Args:
@@ -323,12 +323,12 @@ def _request(self, method, url, body=None):
323323
body = None
324324

325325
if self.keep_alive:
326-
response = self._conn.request(method, url, body=body, headers=headers)
326+
response = self._conn.request(method, url, body=body, headers=headers, timeout=timeout)
327327
statuscode = response.status
328328
else:
329329
conn = self._get_connection_manager()
330330
with conn as http:
331-
response = http.request(method, url, body=body, headers=headers)
331+
response = http.request(method, url, body=body, headers=headers, timeout=timeout)
332332
statuscode = response.status
333333
data = response.data.decode("UTF-8")
334334
LOGGER.debug("Remote response: status=%s | data=%s | headers=%s", response.status, data, response.headers)

rb/sig/lib/selenium/webdriver/bidi.rbs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,17 @@ module Selenium
77

88
def initialize: (url: String) -> void
99

10+
def add_callback: -> Integer
11+
1012
def close: () -> nil
1113

1214
def callbacks: () -> Hash[untyped, untyped]
1315

16+
def remove_callback: -> Array[Integer]
17+
1418
def session: () -> Session
1519

16-
def send_cmd: (untyped method, **untyped params) -> untyped
20+
def send_cmd: (String method, **untyped params) -> untyped
1721

1822
def error_message: (Hash[String,String] message) -> String
1923
end
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
module Selenium
2+
module WebDriver
3+
class BiDi
4+
class LogHandler
5+
@bidi: BiDi
6+
7+
@log_entry_subscribed: bool
8+
9+
ConsoleLogEntry: Struct
10+
11+
JavaScriptLogEntry: Struct
12+
13+
def initialize: (BiDi bidi) -> void
14+
15+
def add_message_handler: (String type) { (untyped) -> untyped } -> Integer
16+
17+
def remove_message_handler: (Integer id) -> false
18+
19+
private
20+
21+
def subscribe_log_entry: () -> false
22+
23+
def unsubscribe_log_entry: () -> false
24+
end
25+
end
26+
end
27+
end
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
module Selenium
2+
module WebDriver
3+
class BiDi
4+
class Struct < ::Struct
5+
def self.new: (*untyped args) { (?) -> untyped } -> void
6+
7+
def self.camel_to_snake: (String camel_str) -> String
8+
end
9+
end
10+
end
11+
end

0 commit comments

Comments
 (0)