Skip to content

Commit c118709

Browse files
authored
Merge branch 'trunk' into jspecify-interactions
2 parents 25993b9 + 015ad63 commit c118709

28 files changed

+85
-37
lines changed

dotnet/src/support/Extensions/WebDriverExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ public static void ExecuteJavaScript(this IWebDriver driver, string script, para
115115
}
116116
}
117117

118-
private static object ExecuteJavaScriptInternal(IWebDriver driver, string script, object?[] args)
118+
private static object? ExecuteJavaScriptInternal(IWebDriver driver, string script, object?[] args)
119119
{
120120
IJavaScriptExecutor? executor = GetDriverAs<IJavaScriptExecutor>(driver)
121121
?? throw new WebDriverException("Driver does not implement IJavaScriptExecutor");

dotnet/src/support/UI/SelectElement.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public SelectElement(IWebElement element)
5353
this.WrappedElement = element;
5454

5555
// let check if it's a multiple
56-
string attribute = element.GetAttribute("multiple");
56+
string? attribute = element.GetAttribute("multiple");
5757
this.IsMultiple = attribute != null && !attribute.Equals("false", StringComparison.OrdinalIgnoreCase);
5858
}
5959

dotnet/src/webdriver/RelativeBy.cs

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,13 @@ namespace OpenQA.Selenium
2929
/// <summary>
3030
/// Provides a mechanism for finding elements spatially relative to other elements.
3131
/// </summary>
32-
public class RelativeBy : By
32+
public sealed class RelativeBy : By
3333
{
3434
private readonly string wrappedAtom;
3535
private readonly object root;
3636
private readonly List<object> filters = new List<object>();
3737

38-
/// <summary>
39-
/// Prevents a default instance of the <see cref="RelativeBy"/> class.
40-
/// </summary>
41-
protected RelativeBy() : base()
38+
private static string GetWrappedAtom()
4239
{
4340
string atom;
4441
using (Stream atomStream = ResourceUtilities.GetResourceStream("find-elements.js", "find-elements.js"))
@@ -49,13 +46,13 @@ protected RelativeBy() : base()
4946
}
5047
}
5148

52-
wrappedAtom = string.Format(CultureInfo.InvariantCulture, "/* findElements */return ({0}).apply(null, arguments);", atom);
49+
return string.Format(CultureInfo.InvariantCulture, "/* findElements */return ({0}).apply(null, arguments);", atom);
5350
}
5451

55-
private RelativeBy(object root, List<object>? filters = null) : this()
52+
private RelativeBy(object root, List<object>? filters = null)
5653
{
54+
this.wrappedAtom = GetWrappedAtom();
5755
this.root = GetSerializableRoot(root);
58-
5956
if (filters != null)
6057
{
6158
this.filters.AddRange(filters);
@@ -73,7 +70,6 @@ public static RelativeBy WithLocator(By by)
7370
return new RelativeBy(by);
7471
}
7572

76-
7773
/// <summary>
7874
/// Finds the first element matching the criteria.
7975
/// </summary>

java/src/org/openqa/selenium/bidi/browsingcontext/BoxClipRectangle.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,6 @@ public BoxClipRectangle(double x, double y, double width, double height) {
3333
public Map<String, Object> toMap() {
3434
map.put("type", super.getType().toString());
3535

36-
return map;
36+
return Map.copyOf(map);
3737
}
3838
}

java/src/org/openqa/selenium/bidi/browsingcontext/CaptureScreenshotParameters.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,6 @@ public CaptureScreenshotParameters clipRectangle(ClipRectangle clipRectangle) {
6161
}
6262

6363
public Map<String, Object> toMap() {
64-
return map;
64+
return Map.copyOf(map);
6565
}
6666
}

java/src/org/openqa/selenium/bidi/browsingcontext/CreateContextParameters.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,6 @@ public CreateContextParameters userContext(String userContext) {
4646

4747
public Map<String, Object> toMap() {
4848
map.put("type", windowType.toString());
49-
return map;
49+
return Map.copyOf(map);
5050
}
5151
}

java/src/org/openqa/selenium/bidi/browsingcontext/ElementClipRectangle.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,6 @@ public ElementClipRectangle(String sharedId, String handle) {
3636
public Map<String, Object> toMap() {
3737
map.put("type", super.getType().toString());
3838

39-
return map;
39+
return Map.copyOf(map);
4040
}
4141
}

java/src/org/openqa/selenium/bidi/browsingcontext/LocateNodeParameters.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,6 @@ public Map<String, Object> toMap() {
7171
map.put("startNodes", startNodesJson);
7272
});
7373

74-
return map;
74+
return Map.copyOf(map);
7575
}
7676
}

java/src/org/openqa/selenium/bidi/browsingcontext/Locator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,6 @@ public static Locator xpath(String value) {
8080
}
8181

8282
public Map<String, Object> toMap() {
83-
return map;
83+
return Map.copyOf(map);
8484
}
8585
}

java/src/org/openqa/selenium/bidi/network/AddInterceptParameters.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,6 @@ public Map<String, Object> toMap() {
6262
if (!urlPatterns.isEmpty()) {
6363
map.put("urlPatterns", urlPatterns);
6464
}
65-
return map;
65+
return Map.copyOf(map);
6666
}
6767
}

0 commit comments

Comments
 (0)