Skip to content

Commit 7c5cf1e

Browse files
authored
Merge branch 'trunk' into pinned-browser-updates
2 parents ec87469 + 55301ee commit 7c5cf1e

File tree

6 files changed

+377
-374
lines changed

6 files changed

+377
-374
lines changed

Rakefile

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -544,10 +544,6 @@ namespace :node do
544544
File.open(file, 'w') { |f| f.puts text }
545545
@git.add(file)
546546
end
547-
548-
# Update package-lock.json
549-
sh 'pnpm install --dir javascript/selenium-webdriver', verbose: true
550-
@git.add('javascript/selenium-webdriver/package-lock.json')
551547
end
552548
end
553549

common/src/web/bidi/logEntryAdded.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<body>
44

5-
<h1>Long entry added events</h1>
5+
<h1>Log entry added events</h1>
66

77
<button id="consoleLog" onclick="helloWorld()">Click me for console logs</button>
88

common/src/web/logEntryAdded.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<body>
44

5-
<h1>Long entry added events</h1>
5+
<h1>Log entry added events</h1>
66

77
<button id="consoleLog" onclick="helloWorld()">Click me for console logs</button>
88

dotnet/src/support/UI/PopupWindowFinder.cs

Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
// </copyright>
1919

2020
using System;
21-
using System.Collections.Generic;
2221
using System.Collections.ObjectModel;
2322
using System.Linq;
2423

@@ -132,35 +131,13 @@ public string Invoke(Action popupMethod)
132131
ReadOnlyCollection<string> existingHandles = this.driver.WindowHandles;
133132
popupMethod();
134133
WebDriverWait wait = new WebDriverWait(SystemClock.Instance, this.driver, this.timeout, this.sleepInterval);
135-
string popupHandle = wait.Until<string>((d) =>
134+
string popupHandle = wait.Until(driver =>
136135
{
137-
string? foundHandle = null;
138-
List<string> differentHandles = GetDifference(existingHandles, this.driver.WindowHandles);
139-
if (differentHandles.Count > 0)
140-
{
141-
foundHandle = differentHandles[0];
142-
}
143-
144-
return foundHandle;
136+
ReadOnlyCollection<string> newHandles = driver.WindowHandles;
137+
return newHandles.Except(existingHandles, StringComparer.Ordinal).FirstOrDefault();
145138
});
146139

147140
return popupHandle;
148141
}
149-
150-
private static List<string> GetDifference(ReadOnlyCollection<string> existingHandles, ReadOnlyCollection<string> currentHandles)
151-
{
152-
// We are using LINQ to get the difference between the two lists.
153-
// The non-LINQ version looks like the following:
154-
// List<string> differentHandles = new List<string>();
155-
// foreach (string handle in currentHandles)
156-
// {
157-
// if (!existingHandles.Contains(handle))
158-
// {
159-
// currentHandles.Add(handle);
160-
// }
161-
// }
162-
// return differentHandles;
163-
return currentHandles.Except(existingHandles).ToList();
164-
}
165142
}
166143
}

java/test/org/openqa/selenium/WebNetworkTest.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ void canAddRequestHandler() {
189189

190190
driver.get(page);
191191

192-
assertThat(driver.findElement(By.tagName("h1")).getText()).isEqualTo("Long entry added events");
192+
assertThat(driver.findElement(By.tagName("h1")).getText()).isEqualTo("Log entry added events");
193193
}
194194

195195
@Test
@@ -321,7 +321,7 @@ void canAddMultipleRequestHandlers() {
321321

322322
driver.get(page);
323323

324-
assertThat(driver.findElement(By.tagName("h1")).getText()).isEqualTo("Long entry added events");
324+
assertThat(driver.findElement(By.tagName("h1")).getText()).isEqualTo("Log entry added events");
325325
}
326326

327327
@Test
@@ -341,7 +341,7 @@ void canAddMultipleRequestHandlersWithTheSameFilter() {
341341

342342
driver.get(page);
343343

344-
assertThat(driver.findElement(By.tagName("h1")).getText()).isEqualTo("Long entry added events");
344+
assertThat(driver.findElement(By.tagName("h1")).getText()).isEqualTo("Log entry added events");
345345
}
346346

347347
@Test
@@ -409,11 +409,11 @@ void canRemoveRequestHandler() throws InterruptedException {
409409
@Ignore(Browser.CHROME)
410410
@Ignore(Browser.EDGE)
411411
void canRemoveRequestHandlerThatDoesNotExist() {
412-
((RemoteWebDriver) driver).network().removeAuthenticationHandler(5);
412+
((RemoteWebDriver) driver).network().removeRequestHandler(5);
413413
page = appServer.whereIs("/bidi/logEntryAdded.html");
414414
driver.get(page);
415415

416-
assertThat(driver.findElement(By.tagName("h1")).getText()).isEqualTo("Long entry added events");
416+
assertThat(driver.findElement(By.tagName("h1")).getText()).isEqualTo("Log entry added events");
417417
}
418418

419419
@Test
@@ -439,6 +439,6 @@ void canClearRequestHandlers() {
439439

440440
driver.get(page);
441441

442-
assertThat(driver.findElement(By.tagName("h1")).getText()).isEqualTo("Long entry added events");
442+
assertThat(driver.findElement(By.tagName("h1")).getText()).isEqualTo("Log entry added events");
443443
}
444444
}

0 commit comments

Comments
 (0)