Skip to content

Commit

Permalink
Merge branch 'trunk' into input-device
Browse files Browse the repository at this point in the history
  • Loading branch information
RenderMichael authored Dec 2, 2024
2 parents 2432a51 + dd8c914 commit 56d3e03
Show file tree
Hide file tree
Showing 46 changed files with 581 additions and 444 deletions.
56 changes: 31 additions & 25 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ bazel_dep(name = "rules_cc", version = "0.0.9", dev_dependency = True)

bazel_dep(name = "rules_dotnet", version = "0.16.1")
bazel_dep(name = "rules_java", version = "7.11.1")
bazel_dep(name = "rules_jvm_external", version = "6.3")
bazel_dep(name = "rules_jvm_external", version = "6.6")
bazel_dep(name = "rules_nodejs", version = "6.3.0")
bazel_dep(name = "rules_oci", version = "1.7.6")
bazel_dep(name = "rules_pkg", version = "0.10.1")
Expand Down Expand Up @@ -182,23 +182,23 @@ maven.install(
"dev.failsafe:failsafe:3.3.2",
"io.grpc:grpc-context:1.68.1",
"io.lettuce:lettuce-core:6.5.0.RELEASE",
"io.netty:netty-buffer:4.1.115.Final",
"io.netty:netty-codec-http:4.1.115.Final",
"io.netty:netty-codec-http2:4.1.115.Final",
"io.netty:netty-common:4.1.115.Final",
"io.netty:netty-handler:4.1.115.Final",
"io.netty:netty-handler-proxy:4.1.115.Final",
"io.netty:netty-transport:4.1.115.Final",
"io.opentelemetry:opentelemetry-api:1.44.1",
"io.opentelemetry:opentelemetry-context:1.44.1",
"io.opentelemetry:opentelemetry-exporter-logging:1.44.1",
"io.opentelemetry:opentelemetry-sdk:1.44.1",
"io.opentelemetry:opentelemetry-sdk-common:1.44.1",
"io.opentelemetry:opentelemetry-sdk-extension-autoconfigure:1.44.1",
"io.opentelemetry:opentelemetry-sdk-extension-autoconfigure-spi:1.44.1",
"io.opentelemetry:opentelemetry-sdk-testing:1.44.1",
"io.opentelemetry:opentelemetry-sdk-trace:1.44.1",
"io.opentelemetry.semconv:opentelemetry-semconv:1.25.0-alpha",
"io.netty:netty-buffer",
"io.netty:netty-codec-http",
"io.netty:netty-codec-http2",
"io.netty:netty-common",
"io.netty:netty-handler",
"io.netty:netty-handler-proxy",
"io.netty:netty-transport",
"io.opentelemetry:opentelemetry-api",
"io.opentelemetry:opentelemetry-context",
"io.opentelemetry:opentelemetry-exporter-logging",
"io.opentelemetry:opentelemetry-sdk",
"io.opentelemetry:opentelemetry-sdk-common",
"io.opentelemetry:opentelemetry-sdk-extension-autoconfigure",
"io.opentelemetry:opentelemetry-sdk-extension-autoconfigure-spi",
"io.opentelemetry:opentelemetry-sdk-testing",
"io.opentelemetry:opentelemetry-sdk-trace",
"io.opentelemetry.semconv:opentelemetry-semconv:1.28.0-alpha",
"it.ozimov:embedded-redis:0.7.3",
"net.bytebuddy:byte-buddy:1.15.10",
"org.htmlunit:htmlunit-core-js:4.6.0",
Expand All @@ -209,20 +209,25 @@ maven.install(
"org.eclipse.mylyn.github:org.eclipse.egit.github.core:2.1.5",
"org.hsqldb:hsqldb:2.7.4",
"org.jspecify:jspecify:1.0.0",
"org.junit.jupiter:junit-jupiter-api:5.11.3",
"org.junit.jupiter:junit-jupiter-engine:5.11.3",
"org.junit.jupiter:junit-jupiter-params:5.11.3",
"org.junit.platform:junit-platform-launcher:1.11.3",
"org.junit.platform:junit-platform-reporting:1.11.3",
"org.junit.platform:junit-platform-commons:1.11.3",
"org.junit.platform:junit-platform-engine:1.11.3",
"org.junit.jupiter:junit-jupiter-api",
"org.junit.jupiter:junit-jupiter-engine",
"org.junit.jupiter:junit-jupiter-params",
"org.junit.platform:junit-platform-launcher",
"org.junit.platform:junit-platform-reporting",
"org.junit.platform:junit-platform-commons",
"org.junit.platform:junit-platform-engine",
"org.mockito:mockito-core:5.14.2",
"org.redisson:redisson:3.39.0",
"org.slf4j:slf4j-api:2.0.16",
"org.slf4j:slf4j-jdk14:2.0.16",
"org.tomlj:tomlj:1.1.1",
"org.zeromq:jeromq:0.6.0",
],
boms = [
"io.opentelemetry:opentelemetry-bom:1.44.1",
"io.netty:netty-bom:4.1.115.Final",
"org.junit:junit-bom:5.11.3",
],
excluded_artifacts = [
"org.hamcrest:hamcrest-all", # Replaced by hamcrest 2
"org.hamcrest:hamcrest-core",
Expand All @@ -235,6 +240,7 @@ maven.install(
repositories = [
"https://repo1.maven.org/maven2",
],
resolver = "maven",
strict_visibility = True,
)
use_repo(maven, "maven", "unpinned_maven")
Expand Down
28 changes: 14 additions & 14 deletions common/mirror/selenium
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
[
{
"tag_name": "selenium-4.27.0",
"tag_name": "nightly",
"assets": [
{
"browser_download_url": "https://github.com/SeleniumHQ/selenium/releases/download/selenium-4.27.0/selenium-dotnet-4.27.0.zip"
},
{
"browser_download_url": "https://github.com/SeleniumHQ/selenium/releases/download/selenium-4.27.0/selenium-dotnet-strongnamed-4.27.0.zip"
},
{
"browser_download_url": "https://github.com/SeleniumHQ/selenium/releases/download/selenium-4.27.0/selenium-java-4.27.0.zip"
"browser_download_url": "https://github.com/SeleniumHQ/selenium/releases/download/nightly/selenium-java-4.28.0-SNAPSHOT.zip"
},
{
"browser_download_url": "https://github.com/SeleniumHQ/selenium/releases/download/selenium-4.27.0/selenium-server-4.27.0.jar"
"browser_download_url": "https://github.com/SeleniumHQ/selenium/releases/download/nightly/selenium-server-4.28.0-SNAPSHOT.jar"
},
{
"browser_download_url": "https://github.com/SeleniumHQ/selenium/releases/download/selenium-4.27.0/selenium-server-4.27.0.zip"
"browser_download_url": "https://github.com/SeleniumHQ/selenium/releases/download/nightly/selenium-server-4.28.0-SNAPSHOT.zip"
}
]
},
{
"tag_name": "nightly",
"tag_name": "selenium-4.27.0",
"assets": [
{
"browser_download_url": "https://github.com/SeleniumHQ/selenium/releases/download/nightly/selenium-java-4.28.0-SNAPSHOT.zip"
"browser_download_url": "https://github.com/SeleniumHQ/selenium/releases/download/selenium-4.27.0/selenium-dotnet-4.27.0.zip"
},
{
"browser_download_url": "https://github.com/SeleniumHQ/selenium/releases/download/nightly/selenium-server-4.28.0-SNAPSHOT.jar"
"browser_download_url": "https://github.com/SeleniumHQ/selenium/releases/download/selenium-4.27.0/selenium-dotnet-strongnamed-4.27.0.zip"
},
{
"browser_download_url": "https://github.com/SeleniumHQ/selenium/releases/download/nightly/selenium-server-4.28.0-SNAPSHOT.zip"
"browser_download_url": "https://github.com/SeleniumHQ/selenium/releases/download/selenium-4.27.0/selenium-java-4.27.0.zip"
},
{
"browser_download_url": "https://github.com/SeleniumHQ/selenium/releases/download/selenium-4.27.0/selenium-server-4.27.0.jar"
},
{
"browser_download_url": "https://github.com/SeleniumHQ/selenium/releases/download/selenium-4.27.0/selenium-server-4.27.0.zip"
}
]
},
Expand Down
9 changes: 3 additions & 6 deletions dotnet/src/webdriver/Chromium/ChromiumDriverService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ protected static string ChromiumDriverServiceFileName(string fileName = DefaultC
// straightforward as you might hope.
// See: http://mono.wikia.com/wiki/Detecting_the_execution_platform
// and https://msdn.microsoft.com/en-us/library/3a8hyw88(v=vs.110).aspx
const int PlatformMonoUnixValue = 128;
const PlatformID PlatformIDMonoUnix = (PlatformID)128;

switch (Environment.OSVersion.Platform)
{
Expand All @@ -221,17 +221,14 @@ protected static string ChromiumDriverServiceFileName(string fileName = DefaultC

case PlatformID.MacOSX:
case PlatformID.Unix:
case PlatformIDMonoUnix:
break;

// Don't handle the Xbox case. Let default handle it.
// case PlatformID.Xbox:
// break;
default:
if ((int)Environment.OSVersion.Platform == PlatformMonoUnixValue)
{
break;
}

default:
throw new WebDriverException("Unsupported platform: " + Environment.OSVersion.Platform);
}

Expand Down
8 changes: 2 additions & 6 deletions dotnet/src/webdriver/Firefox/FirefoxDriverService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ private static string FirefoxDriverServiceFileName()
// straightforward as you might hope.
// See: http://mono.wikia.com/wiki/Detecting_the_execution_platform
// and https://msdn.microsoft.com/en-us/library/3a8hyw88(v=vs.110).aspx
const int PlatformMonoUnixValue = 128;
const PlatformID PlatformIDMonoUnix = (PlatformID)128;

switch (Environment.OSVersion.Platform)
{
Expand All @@ -276,17 +276,13 @@ private static string FirefoxDriverServiceFileName()

case PlatformID.MacOSX:
case PlatformID.Unix:
case PlatformIDMonoUnix:
break;

// Don't handle the Xbox case. Let default handle it.
// case PlatformID.Xbox:
// break;
default:
if ((int)Environment.OSVersion.Platform == PlatformMonoUnixValue)
{
break;
}

throw new WebDriverException("Unsupported platform: " + Environment.OSVersion.Platform);
}

Expand Down
4 changes: 3 additions & 1 deletion dotnet/src/webdriver/ICapabilities.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@

using System;

#nullable enable

namespace OpenQA.Selenium
{
/// <summary>
Expand Down Expand Up @@ -49,6 +51,6 @@ public interface ICapabilities
/// <param name="capability">The capability to get.</param>
/// <returns>An object associated with the capability, or <see langword="null"/>
/// if the capability is not set on the browser.</returns>
object GetCapability(string capability);
object? GetCapability(string capability);
}
}
2 changes: 2 additions & 0 deletions dotnet/src/webdriver/ISearchContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
using System;
using System.Collections.ObjectModel;

#nullable enable

namespace OpenQA.Selenium
{
/// <summary>
Expand Down
2 changes: 2 additions & 0 deletions dotnet/src/webdriver/IWrapsDriver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
// under the License.
// </copyright>

#nullable enable

namespace OpenQA.Selenium
{
/// <summary>
Expand Down
26 changes: 7 additions & 19 deletions dotnet/src/webdriver/Internal/AndroidOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,55 +19,43 @@

using System;

#nullable enable

namespace OpenQA.Selenium.Internal
{
/// <summary>
/// Provides a base class for options for browsers to be automated on Android.
/// </summary>
public class AndroidOptions
{
private string androidPackage;
private string androidDeviceSerial;
private string androidActivity;

/// <summary>
/// Initializes a new instance of the <see cref="AndroidOptions"/> class.
/// </summary>
/// <param name="androidPackage"></param>
/// <exception cref="ArgumentException">If <paramref name="androidPackage"/> is <see langword="null"/> or <see cref="string.Empty"/>.</exception>
protected AndroidOptions(string androidPackage)
{
if (string.IsNullOrEmpty(androidPackage))
{
throw new ArgumentException("The Android package cannot be null or the empty string", nameof(androidPackage));
}

this.androidPackage = androidPackage;
this.AndroidPackage = androidPackage;
}

/// <summary>
/// The package name of the application to automate.
/// </summary>
public string AndroidPackage
{
get { return this.androidPackage; }
}
public string AndroidPackage { get; }

/// <summary>
/// The serial number of the device on which to launch the application.
/// </summary>
public string AndroidDeviceSerial
{
get { return this.androidDeviceSerial; }
set { this.androidDeviceSerial = value; }
}
public string? AndroidDeviceSerial { get; set; }

/// <summary>
/// Gets or sets the name of the Activity hosting the app.
/// </summary>
public string AndroidActivity
{
get { return this.androidActivity; }
set { this.androidActivity = value; }
}
public string? AndroidActivity { get; set; }
}
}
13 changes: 9 additions & 4 deletions dotnet/src/webdriver/Internal/Base64UrlEncoder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,17 @@

using System;

#nullable enable

namespace OpenQA.Selenium.Internal
{
/*
* Based on: https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/blob/6.19.0/src/Microsoft.IdentityModel.Tokens/Base64UrlEncoder.cs
*
* Now it is a part of .NET 9+ as System.Buffers.Text.Base64Url
* https://github.com/SeleniumHQ/selenium/issues/14813
*/

/// <summary>
/// Encodes and Decodes strings as Base64Url encoding.
/// </summary>
Expand All @@ -45,8 +54,6 @@ public static class Base64UrlEncoder
base64UrlCharacter63
};

// https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/blob/6.19.0/src/Microsoft.IdentityModel.Tokens/Base64UrlEncoder.cs#L85

/// <summary>
/// Converts a subset of an array of 8-bit unsigned integers to its equivalent string representation which is encoded with base-64-url digits.
/// </summary>
Expand Down Expand Up @@ -115,8 +122,6 @@ public static string Encode(byte[] inArray)
return new string(output, 0, j);
}

// https://github.com/AzureAD/azure-activedirectory-identitymodel-extensions-for-dotnet/blob/6.19.0/src/Microsoft.IdentityModel.Tokens/Base64UrlEncoder.cs#L179

/// <summary>
/// Converts the specified string, which encodes binary data as base-64-url digits, to an equivalent 8-bit unsigned integer array.</summary>
/// <param name="str">base64Url encoded string.</param>
Expand Down
12 changes: 7 additions & 5 deletions dotnet/src/webdriver/Internal/FileUtilities.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
using System.IO;
using System.Reflection;

#nullable enable

namespace OpenQA.Selenium.Internal
{
/// <summary>
Expand All @@ -40,7 +42,7 @@ internal static class FileUtilities
/// <returns><see langword="true"/> if the copy is completed; otherwise <see langword="false"/>.</returns>
public static bool CopyDirectory(string sourceDirectory, string destinationDirectory)
{
bool copyComplete = false;
bool copyComplete;
DirectoryInfo sourceDirectoryInfo = new DirectoryInfo(sourceDirectory);
DirectoryInfo destinationDirectoryInfo = new DirectoryInfo(destinationDirectory);

Expand Down Expand Up @@ -132,7 +134,7 @@ public static string FindFile(string fileName)

// If it's not in the same directory as the executing assembly,
// try looking in the system path.
string systemPath = Environment.GetEnvironmentVariable("PATH");
string? systemPath = Environment.GetEnvironmentVariable("PATH");
if (!string.IsNullOrEmpty(systemPath))
{
string expandedPath = Environment.ExpandEnvironmentVariables(systemPath);
Expand Down Expand Up @@ -165,7 +167,7 @@ public static string FindFile(string fileName)
public static string GetCurrentDirectory()
{
Assembly executingAssembly = typeof(FileUtilities).Assembly;
string location = null;
string? location = null;

// Make sure not to call Path.GetDirectoryName if assembly location is null or empty
if (!string.IsNullOrEmpty(executingAssembly.Location))
Expand All @@ -184,13 +186,13 @@ public static string GetCurrentDirectory()
location = Directory.GetCurrentDirectory();
}

string currentDirectory = location;
string currentDirectory = location!;

// If we're shadow copying, get the directory from the codebase instead
if (AppDomain.CurrentDomain.ShadowCopyFiles)
{
Uri uri = new Uri(executingAssembly.CodeBase);
currentDirectory = Path.GetDirectoryName(uri.LocalPath);
currentDirectory = Path.GetDirectoryName(uri.LocalPath)!;
}

return currentDirectory;
Expand Down
2 changes: 2 additions & 0 deletions dotnet/src/webdriver/Internal/IFindsElement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@

using System.Collections.ObjectModel;

#nullable enable

namespace OpenQA.Selenium.Internal
{
/// <summary>
Expand Down
Loading

0 comments on commit 56d3e03

Please sign in to comment.