Skip to content

Commit 9491f5a

Browse files
Merge branch 'trunk' into bidi-AOT
2 parents 87cfb98 + 044097e commit 9491f5a

File tree

18 files changed

+382
-385
lines changed

18 files changed

+382
-385
lines changed

common/mirror/selenium

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
"tag_name": "nightly",
44
"assets": [
55
{
6-
"browser_download_url": "https://github.com/SeleniumHQ/selenium/releases/download/nightly/selenium-java-4.30.0-SNAPSHOT.zip"
6+
"browser_download_url": "https://github.com/SeleniumHQ/selenium/releases/download/nightly/selenium-java-4.30.0.zip"
77
},
88
{
9-
"browser_download_url": "https://github.com/SeleniumHQ/selenium/releases/download/nightly/selenium-server-4.30.0-SNAPSHOT.jar"
9+
"browser_download_url": "https://github.com/SeleniumHQ/selenium/releases/download/nightly/selenium-server-4.30.0.jar"
1010
},
1111
{
12-
"browser_download_url": "https://github.com/SeleniumHQ/selenium/releases/download/nightly/selenium-server-4.30.0-SNAPSHOT.zip"
12+
"browser_download_url": "https://github.com/SeleniumHQ/selenium/releases/download/nightly/selenium-server-4.30.0.zip"
1313
}
1414
]
1515
},

java/src/org/openqa/selenium/remote/RemoteWebDriver.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -869,6 +869,9 @@ public void addCookie(Cookie cookie) {
869869

870870
@Override
871871
public void deleteCookieNamed(String name) {
872+
if (name == null || name.isBlank()) {
873+
throw new IllegalArgumentException("Cookie name cannot be empty");
874+
}
872875
execute(DriverCommand.DELETE_COOKIE(name));
873876
}
874877

@@ -927,6 +930,9 @@ public Set<Cookie> getCookies() {
927930

928931
@Override
929932
public Cookie getCookieNamed(String name) {
933+
if (name == null || name.isBlank()) {
934+
throw new IllegalArgumentException("Cookie name cannot be empty");
935+
}
930936
Set<Cookie> allCookies = getCookies();
931937
for (Cookie cookie : allCookies) {
932938
if (cookie.getName().equals(name)) {

java/test/org/openqa/selenium/CookieImplementationTest.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
package org.openqa.selenium;
1919

2020
import static org.assertj.core.api.Assertions.assertThat;
21+
import static org.junit.jupiter.api.Assertions.assertThrows;
2122
import static org.junit.jupiter.api.Assumptions.assumeTrue;
2223
import static org.openqa.selenium.testing.drivers.Browser.ALL;
2324
import static org.openqa.selenium.testing.drivers.Browser.CHROME;
@@ -503,6 +504,18 @@ public void testDeleteNotExistedCookie() {
503504
driver.manage().deleteCookieNamed(key);
504505
}
505506

507+
@Test
508+
public void testDeleteEmptyNamedCookie() {
509+
assertThrows(IllegalArgumentException.class, () -> driver.manage().deleteCookieNamed(""));
510+
assertThrows(IllegalArgumentException.class, () -> driver.manage().deleteCookieNamed(" "));
511+
}
512+
513+
@Test
514+
public void testGetEmptyNamedCookie() {
515+
assertThrows(IllegalArgumentException.class, () -> driver.manage().getCookieNamed(""));
516+
assertThrows(IllegalArgumentException.class, () -> driver.manage().getCookieNamed(" "));
517+
}
518+
506519
@Test
507520
@Ignore(value = ALL, reason = "Non W3C conformant")
508521
public void testShouldDeleteOneOfTheCookiesWithTheSameName() {

py/docs/source/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ The `selenium` package is used to automate web browser interaction from Python.
1414
+-----------------+--------------------------------------------------------------------------------------+
1515
| **GitHub**: | https://github.com/SeleniumHQ/Selenium |
1616
+-----------------+--------------------------------------------------------------------------------------+
17-
| **PyPI**: | https://pypi.org/project/selenium |
17+
| **PyPI**: | https://pypi.org/project/selenium |
1818
+-----------------+--------------------------------------------------------------------------------------+
1919
| **API Docs**: | https://selenium.dev/selenium/docs/api/py/api.html |
2020
+-----------------+--------------------------------------------------------------------------------------+

py/selenium/webdriver/common/actions/action_builder.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def get_device_with(self, name: str) -> Optional[Union["WheelInput", "PointerInp
5252
"""Get the device with the given name.
5353
5454
Parameters:
55-
----------
55+
-----------
5656
name : str
5757
The name of the device to get.
5858
@@ -86,7 +86,7 @@ def add_key_input(self, name: str) -> KeyInput:
8686
"""Add a new key input device to the action builder.
8787
8888
Parameters:
89-
----------
89+
-----------
9090
name : str
9191
The name of the key input device.
9292
@@ -107,7 +107,7 @@ def add_pointer_input(self, kind: str, name: str) -> PointerInput:
107107
"""Add a new pointer input device to the action builder.
108108
109109
Parameters:
110-
----------
110+
-----------
111111
kind : str
112112
The kind of pointer input device.
113113
- "mouse"
@@ -134,7 +134,7 @@ def add_wheel_input(self, name: str) -> WheelInput:
134134
"""Add a new wheel input device to the action builder.
135135
136136
Parameters:
137-
----------
137+
-----------
138138
name : str
139139
The name of the wheel input device.
140140
@@ -186,7 +186,7 @@ def _add_input(self, new_input: Union[KeyInput, PointerInput, WheelInput]) -> No
186186
"""Add a new input device to the action builder.
187187
188188
Parameters:
189-
----------
189+
-----------
190190
new_input : Union[KeyInput, PointerInput, WheelInput]
191191
The new input device to add.
192192
"""

py/selenium/webdriver/common/by.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ class By:
6363
>>> element = driver.find_element(By.TAG_NAME, 'div')
6464
6565
CLASS_NAME:
66-
----------
66+
-----------
6767
Select the element by its class name.
6868
6969
>>> element = driver.find_element(By.CLASS_NAME, 'myElement')

0 commit comments

Comments
 (0)