Skip to content

Commit 63169c2

Browse files
authored
Merge branch 'trunk' into js-bidi-permissions-module
2 parents 3f0bcae + 2af239f commit 63169c2

File tree

7 files changed

+46
-45
lines changed

7 files changed

+46
-45
lines changed

.github/workflows/pre-release.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,17 +97,19 @@ jobs:
9797
**Warning: Manually update the changelogs before merging**
9898
9999
This PR:
100-
* Updates Rust version for Selenium Manager release
101100
* Updates Pinned browser version to coincide with new CDP release
102101
* Adds support for new CDP version and removes old CDP version
103102
* Selenium Manager references the new Selenium Manager release
104103
* Updates Maven Dependencies
105104
* Adds new authors to authors file
106105
* Updates all versions for all bindings
107106
* Generates *rough* change logs for each bindings (please tidy them up before merging this)
107+
* Not all commits need to be in the change log — users do not need to see anything about building or testing Selenium
108+
* Remove references to updating versions including nightly
109+
* The code now outputs the complete body of the commit message; make sure the changelog message is complete and correct
108110
109-
- Auto-generated by [create-pull-request][1]
111+
- This PR was auto-generated by workflow run: [release-preparation][1]
110112
111-
[1]: https://github.com/peter-evans/create-pull-request
113+
[1]: https://github.com/SeleniumHQ/selenium/actions/runs/${{ github.run_id }}
112114
labels: C-build
113115
draft: true

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ for Maven to use locally by deploying to your local maven repository (`~/.m2/rep
201201

202202
#### Updating Dependencies
203203

204-
Dependencies are defined in the file [maven_deps.bzl](https://github.com/SeleniumHQ/selenium/blob/trunk/java/maven_deps.bzl).
204+
Dependencies are defined in the file [MODULE.bazel](https://github.com/SeleniumHQ/selenium/blob/trunk/MODULE.bazel).
205205
To automatically update and pin new dependencies, run:
206206

207207
```shell

Rakefile

Lines changed: 33 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ def verify_java_release_targets
129129
current_targets = []
130130

131131
Bazel.execute('query', [], query) do |output|
132-
current_targets = output.lines.map(&:strip).reject(&:empty?)
132+
current_targets = output.lines.map(&:strip).reject(&:empty?).select { |line| line.start_with?('//') }
133133
end
134134

135135
missing_targets = current_targets - JAVA_RELEASE_TARGETS
@@ -1110,34 +1110,38 @@ namespace :all do
11101110
commit!('Update selenium manager version', ['common/selenium_manager.bzl'])
11111111

11121112
Rake::Task['java:update'].invoke
1113-
commit!('Update Maven Dependencies', ['java/maven_deps.bzl', 'java/maven_install.json'])
1113+
commit!('Update Maven Dependencies', ['MODULE.bazel', 'java/maven_install.json'])
11141114

11151115
Rake::Task['authors'].invoke
11161116
commit!('Update authors file', ['AUTHORS'])
11171117

11181118
# Note that this does not include Rust version changes that are handled in separate rake:version task
11191119
# TODO: These files are all defined in other tasks; remove duplication
11201120
Rake::Task['all:version'].invoke(version)
1121-
commit!("FIX CHANGELOGS BEFORE MERGING!\n\nUpdate versions and change logs to release Selenium #{java_version}",
1122-
['dotnet/CHANGELOG',
1123-
'dotnet/selenium-dotnet-version.bzl',
1124-
'java/CHANGELOG',
1121+
commit!("Update Version in all bindings to #{java_version}",
1122+
['dotnet/selenium-dotnet-version.bzl',
11251123
'java/version.bzl',
1126-
'javascript/node/selenium-webdriver/CHANGES.md',
1124+
'javascript/node/selenium-webdriver/BUILD.bazel',
11271125
'javascript/node/selenium-webdriver/package.json',
11281126
'py/docs/source/conf.py',
1127+
'py/pyproject.toml',
11291128
'py/selenium/__init__.py',
11301129
'py/selenium/webdriver/__init__.py',
11311130
'py/BUILD.bazel',
1132-
'py/CHANGES',
11331131
'rb/lib/selenium/webdriver/version.rb',
1134-
'rb/CHANGES',
11351132
'rb/Gemfile.lock',
1136-
'rust/CHANGELOG.md',
11371133
'rust/BUILD.bazel',
11381134
'rust/Cargo.Bazel.lock',
11391135
'rust/Cargo.toml',
11401136
'rust/Cargo.lock'])
1137+
1138+
commit!("FIX CHANGELOGS BEFORE MERGING! #{java_version}",
1139+
['dotnet/CHANGELOG',
1140+
'java/CHANGELOG',
1141+
'javascript/node/selenium-webdriver/CHANGES.md',
1142+
'py/CHANGES',
1143+
'rb/CHANGES',
1144+
'rust/CHANGELOG.md'])
11411145
end
11421146

11431147
desc 'Update all versions'
@@ -1214,16 +1218,25 @@ end
12141218

12151219
def update_changelog(version, language, path, changelog, header)
12161220
tag = previous_tag(version, language)
1217-
log = if language == 'javascript'
1218-
`git --no-pager log #{tag}...HEAD --pretty=format:"- %s" --reverse #{path}`
1219-
else
1220-
`git --no-pager log #{tag}...HEAD --pretty=format:"* %s" --reverse #{path}`
1221-
end
1222-
commits = log.split('>>>').map { |entry|
1223-
lines = entry.split("\n")
1224-
lines.reject! { |line| line.match?(/^(----|Co-authored|Signed-off)/) || line.empty? }
1225-
lines.join("\n")
1226-
}.join("\n>>>")
1221+
bullet = language == 'javascript' ? '- ' : '* '
1222+
commit_delimiter = '===DELIM==='
1223+
tags_to_remove = /\[(dotnet|rb|py|java|js|rust)\]:?\s?/
1224+
1225+
command = "git --no-pager log #{tag}...HEAD --pretty=format:\"%s%n%b#{commit_delimiter}\" --reverse #{path}"
1226+
puts "Executing git command: #{command}"
1227+
1228+
log = `#{command}`
1229+
1230+
commits = log.split(commit_delimiter).map { |commit|
1231+
lines = commit.gsub(tags_to_remove, '').strip.lines.map(&:chomp)
1232+
subject = "#{bullet}#{lines[0]}"
1233+
1234+
body = lines[1..]
1235+
.reject { |line| line.match?(/^(----|Co-authored|Signed-off)/) || line.empty? }
1236+
.map { |line| " > #{line}" }
1237+
.join("\n")
1238+
body.empty? ? subject : "#{subject}\n#{body}"
1239+
}.join("\n")
12271240

12281241
File.open(changelog, 'r+') do |file|
12291242
new_content = "#{header}\n#{commits}\n\n#{file.read}"

java/test/org/openqa/selenium/bidi/BiDiSessionCleanUpTest.java

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
import static org.assertj.core.api.AssertionsForClassTypes.assertThat;
2121
import static org.assertj.core.api.AssertionsForClassTypes.assertThatExceptionOfType;
2222

23-
import java.util.Collections;
2423
import org.junit.jupiter.api.Test;
2524
import org.openqa.selenium.WebDriverException;
2625
import org.openqa.selenium.WindowType;
@@ -42,8 +41,7 @@ void shouldNotCloseBiDiSessionIfOneWindowIsClosed() {
4241

4342
BiDi biDi = driver.getBiDi();
4443

45-
BiDiSessionStatus status =
46-
biDi.send(new Command<>("session.status", Collections.emptyMap(), BiDiSessionStatus.class));
44+
BiDiSessionStatus status = biDi.getBidiSessionStatus();
4745
assertThat(status).isNotNull();
4846
assertThat(status.getMessage()).isEqualTo("Session already started");
4947

@@ -53,8 +51,7 @@ void shouldNotCloseBiDiSessionIfOneWindowIsClosed() {
5351

5452
driver.close();
5553

56-
BiDiSessionStatus statusAfterClosing =
57-
biDi.send(new Command<>("session.status", Collections.emptyMap(), BiDiSessionStatus.class));
54+
BiDiSessionStatus statusAfterClosing = biDi.getBidiSessionStatus();
5855
assertThat(statusAfterClosing).isNotNull();
5956
assertThat(status.getMessage()).isEqualTo("Session already started");
6057
driver.quit();
@@ -70,19 +67,14 @@ void shouldCloseBiDiSessionIfLastWindowIsClosed() {
7067

7168
BiDi biDi = driver.getBiDi();
7269

73-
BiDiSessionStatus status =
74-
biDi.send(new Command<>("session.status", Collections.emptyMap(), BiDiSessionStatus.class));
70+
BiDiSessionStatus status = biDi.getBidiSessionStatus();
7571
assertThat(status).isNotNull();
7672
assertThat(status.getMessage()).isEqualTo("Session already started");
7773

7874
driver.close();
7975

8076
// Closing the last top-level browsing context, closes the WebDriver and BiDi session
8177
assertThatExceptionOfType(WebDriverException.class)
82-
.isThrownBy(
83-
() ->
84-
biDi.send(
85-
new Command<>(
86-
"session.status", Collections.emptyMap(), BiDiSessionStatus.class)));
78+
.isThrownBy(() -> biDi.getBidiSessionStatus());
8779
}
8880
}

java/test/org/openqa/selenium/bidi/BiDiSessionTest.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919

2020
import static org.assertj.core.api.AssertionsForClassTypes.assertThat;
2121

22-
import java.util.Collections;
2322
import org.junit.jupiter.api.Test;
2423
import org.openqa.selenium.testing.JupiterTestBase;
2524

@@ -29,8 +28,7 @@ class BiDiSessionTest extends JupiterTestBase {
2928
void shouldBeAbleToCreateABiDiSession() {
3029
BiDi biDi = ((HasBiDi) driver).getBiDi();
3130

32-
BiDiSessionStatus status =
33-
biDi.send(new Command<>("session.status", Collections.emptyMap(), BiDiSessionStatus.class));
31+
BiDiSessionStatus status = biDi.getBidiSessionStatus();
3432
assertThat(status).isNotNull();
3533
assertThat(status.getMessage()).isNotEmpty();
3634
}

java/test/org/openqa/selenium/grid/router/RemoteWebDriverBiDiTest.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
import static org.openqa.selenium.testing.drivers.Browser.*;
2222

2323
import java.io.StringReader;
24-
import java.util.Collections;
2524
import java.util.Objects;
2625
import java.util.concurrent.CompletableFuture;
2726
import java.util.concurrent.ExecutionException;
@@ -37,7 +36,6 @@
3736
import org.openqa.selenium.WindowType;
3837
import org.openqa.selenium.bidi.BiDi;
3938
import org.openqa.selenium.bidi.BiDiSessionStatus;
40-
import org.openqa.selenium.bidi.Command;
4139
import org.openqa.selenium.bidi.HasBiDi;
4240
import org.openqa.selenium.bidi.browsingcontext.BrowsingContext;
4341
import org.openqa.selenium.bidi.browsingcontext.NavigationResult;
@@ -89,9 +87,7 @@ void setup() {
8987
@NotYetImplemented(EDGE)
9088
void ensureBiDiSessionCreation() {
9189
try (BiDi biDi = ((HasBiDi) driver).getBiDi()) {
92-
BiDiSessionStatus status =
93-
biDi.send(
94-
new Command<>("session.status", Collections.emptyMap(), BiDiSessionStatus.class));
90+
BiDiSessionStatus status = biDi.getBidiSessionStatus();
9591
assertThat(status).isNotNull();
9692
assertThat(status.getMessage()).isNotEmpty();
9793
}

py/selenium/webdriver/common/log.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ async def mutation_events(self) -> AsyncGenerator[Dict[str, Any], None]:
9090
yield event
9191

9292
payload = json.loads(evnt.value.payload)
93-
elements: list = self.driver.find_elements(By.CSS_SELECTOR, f"*[data-__webdriver_id={payload['target']}]")
93+
elements: list = self.driver.find_elements(By.CSS_SELECTOR, f"*[data-__webdriver_id=\"{payload['target']}\"]")
9494
if not elements:
9595
elements.append(None)
9696
event["element"] = elements[0]

0 commit comments

Comments
 (0)