Skip to content

Commit d47152f

Browse files
Merge branch 'trunk' into 15697Fix
2 parents 3f2d534 + fc5d766 commit d47152f

File tree

9 files changed

+371
-301
lines changed

9 files changed

+371
-301
lines changed

.idea/misc.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

MODULE.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ bazel_dep(name = "platforms", version = "0.0.11")
1515
bazel_dep(name = "protobuf", version = "29.2", dev_dependency = True, repo_name = "com_google_protobuf")
1616

1717
# Required for rules_rust to import the crates properly
18-
bazel_dep(name = "rules_cc", version = "0.1.1", dev_dependency = True)
18+
bazel_dep(name = "rules_cc", version = "0.2.0", dev_dependency = True)
1919

2020
bazel_dep(name = "rules_dotnet", version = "0.17.5")
2121
bazel_dep(name = "rules_java", version = "8.7.1")

dotnet/src/webdriver/Selenium.WebDriver.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
</ItemGroup>
5858

5959
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0'">
60-
<PackageReference Include="System.Text.Json" Version="8.0.5" />
60+
<PackageReference Include="System.Text.Json" Version="8.0.6" />
6161
</ItemGroup>
6262

6363
<ItemGroup>

java/src/org/openqa/selenium/support/ui/Select.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,13 +123,16 @@ public WebElement getFirstSelectedOption() {
123123
@Override
124124
public void selectByVisibleText(String text) {
125125
assertSelectIsEnabled();
126+
assertSelectIsVisible();
126127

127128
// try to find the option via XPATH ...
128129
List<WebElement> options =
129130
element.findElements(
130131
By.xpath(".//option[normalize-space(.) = " + Quotes.escape(text) + "]"));
131132

132133
for (WebElement option : options) {
134+
if (!hasCssPropertyAndVisible(option))
135+
throw new NoSuchElementException("Invisible option with text: " + text);
133136
setSelected(option, true);
134137
if (!isMultiple()) {
135138
return;
@@ -154,6 +157,8 @@ public void selectByVisibleText(String text) {
154157

155158
for (WebElement option : candidates) {
156159
if (trimmed.equals(option.getText().trim())) {
160+
if (!hasCssPropertyAndVisible(option))
161+
throw new NoSuchElementException("Invisible option with text: " + text);
157162
setSelected(option, true);
158163
if (!isMultiple()) {
159164
return;

java/test/org/openqa/selenium/support/ui/SelectElementTest.java

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
2222
import static org.openqa.selenium.testing.drivers.Browser.ALL;
2323

24+
import java.util.Arrays;
25+
import java.util.List;
2426
import org.junit.jupiter.api.BeforeEach;
2527
import org.junit.jupiter.api.Test;
2628
import org.openqa.selenium.By;
@@ -176,8 +178,11 @@ void shouldNotAllowInvisibleOptionsToBeSelectedByContainsVisibleText() {
176178
WebElement selectElement = driver.findElement(By.id("invisible_multi_select"));
177179
Select select = new Select(selectElement);
178180

179-
assertThatExceptionOfType(NoSuchElementException.class)
180-
.isThrownBy(() -> select.selectByContainsVisibleText("Apples"));
181+
List<String> options = Arrays.asList("Apples", "Pears", "Oranges", "Lemons");
182+
options.forEach(
183+
option ->
184+
assertThatExceptionOfType(NoSuchElementException.class)
185+
.isThrownBy(() -> select.selectByVisibleText(option)));
181186
}
182187

183188
@Test
@@ -198,6 +203,18 @@ void shouldThrowExceptionOnSelectByVisibleTextIfOptionDisabled() {
198203
.isThrownBy(() -> select.selectByVisibleText("Disabled"));
199204
}
200205

206+
@Test
207+
void shouldThrowExceptionOnSelectByVisibleTextIfOptionHidden() {
208+
WebElement selectElement = driver.findElement(By.id("invisible_multi_select"));
209+
Select select = new Select(selectElement);
210+
211+
List<String> options = Arrays.asList("Apples", "Pears", "Oranges", "Lemons");
212+
options.forEach(
213+
option ->
214+
assertThatExceptionOfType(NoSuchElementException.class)
215+
.isThrownBy(() -> select.selectByVisibleText(option)));
216+
}
217+
201218
@Test
202219
void shouldAllowOptionsToBeSelectedByIndex() {
203220
WebElement selectElement = driver.findElement(By.name("select_empty_multiple"));

javascript/grid-ui/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"react": "18.3.1",
2424
"react-dom": "18.3.1",
2525
"react-modal": "3.16.3",
26-
"react-router-dom": "6.27.0",
26+
"react-router-dom": "6.30.1",
2727
"source-map-explorer": "2.5.3"
2828
},
2929
"scripts": {
@@ -48,9 +48,9 @@
4848
]
4949
},
5050
"devDependencies": {
51-
"@testing-library/jest-dom": "6.6.3",
51+
"@testing-library/jest-dom": "6.8.0",
5252
"@testing-library/react": "14.3.1",
53-
"@testing-library/user-event": "14.5.2",
53+
"@testing-library/user-event": "14.6.1",
5454
"esbuild": "0.24.2",
5555
"jest": "^29.7.0",
5656
"jest-environment-jsdom": "^29.7.0",

javascript/selenium-webdriver/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"dependencies": {
2626
"@bazel/runfiles": "^6.3.1",
2727
"jszip": "^3.10.1",
28-
"tmp": "^0.2.3",
28+
"tmp": "^0.2.5",
2929
"ws": "^8.18.2"
3030
},
3131
"devDependencies": {

0 commit comments

Comments
 (0)