Skip to content

Commit 9bbfb38

Browse files
authored
Merge branch 'trunk' into rb_add_support_for_chrome_beta
2 parents bec99e1 + 35dadd7 commit 9bbfb38

File tree

22 files changed

+118
-112
lines changed

22 files changed

+118
-112
lines changed

.github/label-commenter-config.yml

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Configuration for Label Commenter - https://github.com/peaceiris/actions-label-commenter
22
labels:
3-
- name: needs-triaging
3+
- name: A-needs-triaging
44
labeled:
55
issue:
66
body: |
@@ -15,7 +15,7 @@ labels:
1515
Triage this issue by using labels.
1616
</p>
1717
<p>
18-
If information is missing, add a helpful comment and then <code>I-issue-template</code> label.
18+
If information is missing, add a helpful comment and then <code>J-issue-template</code> label.
1919
</p>
2020
<p>
2121
If the issue is a question, add the <code>I-question</code> label.
@@ -101,18 +101,18 @@ labels:
101101
102102
Feel free to comment the issues that you raise back in this issue. Thank you.
103103
action: close
104-
- name: I-issue-template
104+
- name: J-issue-template
105105
labeled:
106106
issue:
107107
body: |
108108
Hi, @{{ issue.user.login }}.
109-
Please follow the issue template, we need more information to reproduce the issue.
109+
Please follow the issue template; we need more information to reproduce the issue.
110110
111111
Either a complete code snippet and URL/HTML (if more than one file is needed, provide a GitHub repo and instructions to run the code), the specific versions used, or a more detailed description to help us understand the issue.
112112
113113
Note: If you cannot share your code and URL/HTML, any complete code snippet and URL/HTML that reproduces the issue is good enough.
114114
115-
Reply to this issue when all information is provided, thank you.
115+
Reply to this issue when all information is provided. Thank you.
116116
- name: I-question
117117
labeled:
118118
issue:
@@ -137,3 +137,17 @@ labels:
137137
138138
Please turn on logging and re-run your code. Information on how to adjust logs for your language can be found in our
139139
[Troubleshooting documentation](https://www.selenium.dev/documentation/webdriver/troubleshooting/logging/).
140+
- name: B-support
141+
labeled:
142+
issue:
143+
body: |
144+
Hi, @{{ issue.user.login }}.
145+
146+
This is related to code in the Support packages. The support packages contain example code that
147+
many users find helpful, but they do not necessarily represent the best practices for using Selenium,
148+
and the Selenium team is not prioritizing work on them right now.
149+
This doesn't mean that we won't ever work on them, but it is not on our roadmap as we push to release Selenium 5.
150+
151+
We actively encourage people to create their own wrapper and helper code that makes sense for them.
152+
If you have any questions, please [contact us](https://www.selenium.dev/support)
153+

.github/renovate.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"labels": ["B-dependencies"]
3+
}

.github/workflows/bazel.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,9 @@ jobs:
139139
uses: bazel-contrib/[email protected]
140140
with:
141141
bazelrc: common --color=yes
142+
- name: Setup curl for Ubuntu
143+
if: inputs.os == 'ubuntu'
144+
run: sudo apt-get update && sudo apt-get install -y libcurl4-openssl-dev
142145
- name: Setup Fluxbox and Xvfb
143146
if: inputs.os == 'ubuntu' && inputs.browser != ''
144147
run: |
@@ -152,9 +155,6 @@ jobs:
152155
- name: Setup Safari
153156
if: inputs.browser == 'safari'
154157
run: sudo safaridriver --enable
155-
- name: Setup curl for Ubuntu
156-
if: inputs.os == 'ubuntu'
157-
run: sudo apt-get update && sudo apt-get install -y libcurl4-openssl-dev
158158
- name: Run Bazel
159159
run: ${{ inputs.run }}
160160
- name: Start SSH session

.github/workflows/stale.yml

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,29 @@ jobs:
2020
with:
2121
stale-issue-message: 'This issue is stale because it has been open 280 days with no activity. Remove stale label or comment or this will be closed in 14 days.'
2222
close-issue-message: 'This issue was closed because it has been stalled for 14 days with no activity.'
23-
stale-issue-label: 'I-stale'
23+
stale-issue-label: 'J-stale'
24+
stale-pr-label: 'J-stale'
2425
days-before-stale: 180
2526
days-before-close: 14
2627
exempt-all-milestones: true
2728
- uses: actions/stale@v9
2829
with:
2930
close-issue-message: 'This issue was closed because we did not receive any additional information after 14 days.'
30-
stale-issue-label: 'R-awaiting answer'
31+
stale-issue-label: 'J-awaiting answer'
3132
days-before-stale: -1
3233
days-before-close: 14
33-
labels-to-add-when-unstale: 'needs-triaging'
34-
34+
labels-to-add-when-unstale: 'A-needs-triaging'
35+
- uses: actions/stale@v9
36+
with:
37+
close-issue-message: 'This issue was closed because we did not receive any additional information after 14 days.'
38+
stale-issue-label: 'J-logging'
39+
days-before-stale: -1
40+
days-before-close: 14
41+
labels-to-add-when-unstale: 'A-needs-triaging'
42+
- uses: actions/stale@v9
43+
with:
44+
close-issue-message: 'This issue was closed because we did not receive any additional information after 14 days.'
45+
stale-issue-label: 'J-issue-template'
46+
days-before-stale: -1
47+
days-before-close: 14
48+
labels-to-add-when-unstale: 'A-needs-triaging'

Rakefile

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -509,19 +509,21 @@ namespace :node do
509509
task deploy: :release
510510

511511
desc 'Generate Node documentation'
512-
task :docs, [:skip_update] do |_task, arguments|
512+
task :docs do |_task, arguments|
513513
abort('Aborting documentation update: nightly versions should not update docs.') if node_version.include?('nightly')
514514

515515
puts 'Generating Node documentation'
516516
FileUtils.rm_rf('build/docs/api/javascript/')
517517
begin
518-
sh 'npm install --prefix javascript/selenium-webdriver', verbose: true
519-
sh 'npm run generate-docs --prefix javascript/selenium-webdriver', verbose: true
518+
Dir.chdir('javascript/selenium-webdriver') do
519+
sh 'pnpm install', verbose: true
520+
sh 'pnpm run generate-docs', verbose: true
521+
end
520522
rescue StandardError => e
521523
puts "Node documentation generation contains errors; continuing... #{e.message}"
522524
end
523525

524-
update_gh_pages unless arguments[:skip_update]
526+
update_gh_pages unless arguments.to_a.include?('skip_update')
525527
end
526528

527529
desc 'Update JavaScript changelog'
@@ -544,9 +546,7 @@ namespace :node do
544546
end
545547

546548
# Update package-lock.json
547-
Dir.chdir('javascript/selenium-webdriver') do
548-
sh 'npm install --prefix javascript/selenium-webdriver', verbose: true
549-
end
549+
sh 'pnpm install --dir javascript/selenium-webdriver', verbose: true
550550
@git.add('javascript/selenium-webdriver/package-lock.json')
551551
end
552552
end
@@ -611,7 +611,7 @@ namespace :py do
611611
end
612612

613613
desc 'Generate Python documentation'
614-
task :docs, [:skip_update] do |_task, arguments|
614+
task :docs do |_task, arguments|
615615
if python_version.match?(/^\d+\.\d+\.\d+\.\d+$/)
616616
abort('Aborting documentation update: nightly versions should not update docs.')
617617
end
@@ -626,7 +626,7 @@ namespace :py do
626626
raise
627627
end
628628

629-
update_gh_pages unless arguments[:skip_update]
629+
update_gh_pages unless arguments.to_a.include?('skip_update')
630630
end
631631

632632
desc 'Install Python wheel locally'
@@ -779,7 +779,7 @@ namespace :rb do
779779
end
780780

781781
desc 'Generate Ruby documentation'
782-
task :docs, [:skip_update] do |_task, arguments|
782+
task :docs do |_task, arguments|
783783
abort('Aborting documentation update: nightly versions should not update docs.') if ruby_version.include?('nightly')
784784
puts 'Generating Ruby documentation'
785785

@@ -788,7 +788,7 @@ namespace :rb do
788788
FileUtils.mkdir_p('build/docs/api')
789789
FileUtils.cp_r('bazel-bin/rb/docs.sh.runfiles/_main/docs/api/rb/.', 'build/docs/api/rb')
790790

791-
update_gh_pages unless arguments[:skip_update]
791+
update_gh_pages unless arguments.to_a.include?('skip_update')
792792
end
793793

794794
desc 'Update Ruby changelog'
@@ -875,7 +875,7 @@ namespace :dotnet do
875875
end
876876

877877
desc 'Generate .NET documentation'
878-
task :docs, [:skip_update] do |_task, arguments|
878+
task :docs do |_task, arguments|
879879
if dotnet_version.include?('nightly')
880880
abort('Aborting documentation update: nightly versions should not update docs.')
881881
end
@@ -905,7 +905,7 @@ namespace :dotnet do
905905
end
906906
end
907907

908-
update_gh_pages unless arguments[:skip_update]
908+
update_gh_pages unless arguments.to_a.include?('skip_update')
909909
end
910910

911911
desc 'Update .NET changelog'
@@ -990,15 +990,15 @@ namespace :java do
990990
task install: :'maven-install'
991991

992992
desc 'Generate Java documentation'
993-
task :docs, [:skip_update] do |_task, arguments|
993+
task :docs do |_task, arguments|
994994
if java_version.include?('SNAPSHOT')
995995
abort('Aborting documentation update: snapshot versions should not update docs.')
996996
end
997997

998998
puts 'Generating Java documentation'
999999
Rake::Task['javadocs'].invoke
10001000

1001-
update_gh_pages unless arguments[:skip_update]
1001+
update_gh_pages unless arguments.to_a.include?('skip_update')
10021002
end
10031003

10041004
desc 'Update Maven dependencies'
@@ -1248,8 +1248,8 @@ def update_gh_pages(force: true)
12481248
@git.fetch('https://github.com/seleniumhq/selenium.git', {ref: 'gh-pages'})
12491249

12501250
unless force
1251-
puts 'Stashing current changes before checkout...'
1252-
Git::Stash.new(@git, 'stash wip')
1251+
puts 'Stash changes that are not docs...'
1252+
@git.lib.send(:command, 'stash', ['push', '-m', 'stash wip', '--', ':(exclude)build/docs/api/'])
12531253
end
12541254

12551255
@git.checkout('gh-pages', force: force)

dotnet/src/webdriver/Alert.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public string? Text
4545
{
4646
get
4747
{
48-
Response commandResponse = this.driver.InternalExecute(DriverCommand.GetAlertText, null);
48+
Response commandResponse = this.driver.Execute(DriverCommand.GetAlertText, null);
4949
return (string?)commandResponse.Value;
5050
}
5151
}
@@ -55,15 +55,15 @@ public string? Text
5555
/// </summary>
5656
public void Dismiss()
5757
{
58-
this.driver.InternalExecute(DriverCommand.DismissAlert, null);
58+
this.driver.Execute(DriverCommand.DismissAlert, null);
5959
}
6060

6161
/// <summary>
6262
/// Accepts the alert.
6363
/// </summary>
6464
public void Accept()
6565
{
66-
this.driver.InternalExecute(DriverCommand.AcceptAlert, null);
66+
this.driver.Execute(DriverCommand.AcceptAlert, null);
6767
}
6868

6969
/// <summary>
@@ -81,7 +81,7 @@ public void SendKeys(string keysToSend)
8181
Dictionary<string, object> parameters = new Dictionary<string, object>();
8282
parameters.Add("text", keysToSend);
8383

84-
this.driver.InternalExecute(DriverCommand.SetAlertValue, parameters);
84+
this.driver.Execute(DriverCommand.SetAlertValue, parameters);
8585
}
8686
}
8787
}

dotnet/src/webdriver/Chromium/ChromiumDriver.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,8 @@ public DevToolsSession GetDevToolsSession(int devToolsProtocolVersion)
361361
/// <summary>
362362
/// Closes a DevTools session.
363363
/// </summary>
364+
[RequiresUnreferencedCode(DevToolsSession.CDP_AOTIncompatibilityMessage)]
365+
[RequiresDynamicCode(DevToolsSession.CDP_AOTIncompatibilityMessage)]
364366
public void CloseDevToolsSession()
365367
{
366368
if (this.devToolsSession != null)

dotnet/src/webdriver/Command.cs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,11 @@ public class Command
3333
{
3434
private readonly static JsonSerializerOptions s_jsonSerializerOptions = new()
3535
{
36-
TypeInfoResolver = JsonTypeInfoResolver.Combine(CommandJsonSerializerContext.Default, new DefaultJsonTypeInfoResolver()),
36+
TypeInfoResolverChain =
37+
{
38+
CommandJsonSerializerContext.Default,
39+
new DefaultJsonTypeInfoResolver()
40+
},
3741
Converters = { new ResponseValueJsonConverter() }
3842
};
3943

@@ -86,17 +90,14 @@ public string ParametersAsJsonString
8690
{
8791
get
8892
{
89-
string parametersString;
9093
if (this.Parameters != null && this.Parameters.Count > 0)
9194
{
92-
parametersString = JsonSerializer.Serialize(this.Parameters, s_jsonSerializerOptions);
95+
return JsonSerializer.Serialize(this.Parameters, s_jsonSerializerOptions);
9396
}
9497
else
9598
{
96-
parametersString = "{}";
99+
return "{}";
97100
}
98-
99-
return parametersString;
100101
}
101102
}
102103

@@ -118,7 +119,7 @@ public override string ToString()
118119
/// <exception cref="ArgumentNullException">If <paramref name="value"/> is <see langword="null"/>.</exception>
119120
private static Dictionary<string, object?>? ConvertParametersFromJson(string value)
120121
{
121-
Dictionary<string, object?>? parameters = JsonSerializer.Deserialize<Dictionary<string, object?>>(value, s_jsonSerializerOptions);
122+
Dictionary<string, object?>? parameters = JsonSerializer.Deserialize<Dictionary<string, object?>>(value, CommandJsonSerializerContext.Default.DictionaryStringObject!);
122123
return parameters;
123124
}
124125
}
@@ -167,5 +168,6 @@ public override string ToString()
167168
[JsonSerializable(typeof(Dictionary<string, short>))]
168169
[JsonSerializable(typeof(Dictionary<string, ushort>))]
169170
[JsonSerializable(typeof(Dictionary<string, string>))]
171+
[JsonSourceGenerationOptions(Converters = [typeof(ResponseValueJsonConverter)])]
170172
internal partial class CommandJsonSerializerContext : JsonSerializerContext;
171173
}

dotnet/src/webdriver/CookieJar.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public ReadOnlyCollection<Cookie> AllCookies
3232
{
3333
get
3434
{
35-
Response response = driver.InternalExecute(DriverCommand.GetAllCookies, new Dictionary<string, object>());
35+
Response response = driver.Execute(DriverCommand.GetAllCookies, new Dictionary<string, object>());
3636

3737
List<Cookie> toReturn = new List<Cookie>();
3838
if (response.Value is object?[] cookies)
@@ -65,7 +65,7 @@ public void AddCookie(Cookie cookie)
6565

6666
Dictionary<string, object> parameters = new Dictionary<string, object>();
6767
parameters.Add("cookie", cookie);
68-
driver.InternalExecute(DriverCommand.AddCookie, parameters);
68+
driver.Execute(DriverCommand.AddCookie, parameters);
6969
}
7070

7171
/// <summary>
@@ -82,7 +82,7 @@ public void DeleteCookieNamed(string name)
8282

8383
Dictionary<string, object> parameters = new() { { "name", name } };
8484

85-
driver.InternalExecute(DriverCommand.DeleteCookie, parameters);
85+
driver.Execute(DriverCommand.DeleteCookie, parameters);
8686
}
8787

8888
/// <summary>
@@ -105,7 +105,7 @@ public void DeleteCookie(Cookie cookie)
105105
/// </summary>
106106
public void DeleteAllCookies()
107107
{
108-
driver.InternalExecute(DriverCommand.DeleteAllCookies, null);
108+
driver.Execute(DriverCommand.DeleteAllCookies, null);
109109
}
110110

111111
/// <summary>
@@ -123,7 +123,7 @@ public void DeleteAllCookies()
123123

124124
try
125125
{
126-
var rawCookie = driver.InternalExecute(DriverCommand.GetCookie, new() { { "name", name } }).Value;
126+
var rawCookie = driver.Execute(DriverCommand.GetCookie, new() { { "name", name } }).Value;
127127

128128
return Cookie.FromDictionary((Dictionary<string, object?>)rawCookie!);
129129
}

dotnet/src/webdriver/HttpCommandInfo.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,11 @@ public class HttpCommandInfo : CommandInfo
4949
/// </summary>
5050
/// <param name="method">Method of the Command</param>
5151
/// <param name="resourcePath">Relative URL path to the resource used to execute the command</param>
52+
/// <exception cref="ArgumentNullException">If <paramref name="method"/> or <paramref name="resourcePath"/> are <see langword="null"/>.</exception>
5253
public HttpCommandInfo(string method, string resourcePath)
5354
{
54-
this.ResourcePath = resourcePath;
55-
this.Method = method;
55+
this.ResourcePath = resourcePath ?? throw new ArgumentNullException(nameof(resourcePath));
56+
this.Method = method ?? throw new ArgumentNullException(nameof(method));
5657
}
5758

5859
/// <summary>

0 commit comments

Comments
 (0)