Skip to content

Commit

Permalink
[dotnet] update everything required for .NET 6
Browse files Browse the repository at this point in the history
  • Loading branch information
titusfortner committed Nov 29, 2022
1 parent 471e245 commit d2838e1
Show file tree
Hide file tree
Showing 17 changed files with 33 additions and 24 deletions.
3 changes: 3 additions & 0 deletions dotnet/src/support/WebDriver.Support.StrongNamed.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@
<group targetFramework="net5.0">
<dependency id="Selenium.WebDriver.StrongNamed" version="$version$" exclude="Build,Analyzers" />
</group>
<group targetFramework="net6.0">
<dependency id="Selenium.WebDriver.StrongNamed" version="$version$" exclude="Build,Analyzers" />
</group>
</dependencies>
<frameworkAssemblies>
<frameworkAssembly assemblyName="System.Drawing" />
Expand Down
2 changes: 1 addition & 1 deletion dotnet/src/support/WebDriver.Support.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net5.0;net48;net47;net46;net45;netstandard2.1;netstandard2.0</TargetFrameworks>
<TargetFrameworks>net6.0;net5.0;net48;net47;net46;net45;netstandard2.1;netstandard2.0</TargetFrameworks>
<AssemblyName>WebDriver.Support</AssemblyName>
<RootNamespace>OpenQA.Selenium.Support</RootNamespace>
<BuildSystem>visual-studio</BuildSystem>
Expand Down
2 changes: 1 addition & 1 deletion dotnet/src/webdriver/Screenshot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public override void SaveAsFile(string fileName)
/// to save the image to.</param>
public void SaveAsFile(string fileName, ScreenshotImageFormat format)
{
#if NETCOREAPP2_0 || NETSTANDARD2_0 || NETCOREAPP2_1 || NETSTANDARD2_1
#if NETCOREAPP2_0 || NETSTANDARD2_0 || NETCOREAPP2_1 || NETSTANDARD2_1 || NET5_0 || NET6_0
if (format != ScreenshotImageFormat.Png)
{
throw new WebDriverException(".NET Core does not support image manipulation, so only Portable Network Graphics (PNG) format is supported");
Expand Down
3 changes: 3 additions & 0 deletions dotnet/src/webdriver/WebDriver.StrongNamed.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@
<group targetFramework="net5.0">
<dependency id="Newtonsoft.Json" version="13.0.1" exclude="Build,Analyzers" />
</group>
<group targetFramework="net6.0">
<dependency id="Newtonsoft.Json" version="13.0.1" exclude="Build,Analyzers" />
</group>
</dependencies>
<frameworkAssemblies>
<frameworkAssembly assemblyName="System.Drawing" />
Expand Down
4 changes: 2 additions & 2 deletions dotnet/src/webdriver/WebDriver.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net5.0;net48;net47;net46;net45;netstandard2.1;netstandard2.0</TargetFrameworks>
<TargetFrameworks>net6.0;net5.0;net48;net47;net46;net45;netstandard2.1;netstandard2.0</TargetFrameworks>
<AssemblyName>WebDriver</AssemblyName>
<RootNamespace>OpenQA.Selenium</RootNamespace>
</PropertyGroup>
Expand Down Expand Up @@ -158,7 +158,7 @@
</EmbeddedResource>
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)'!='net5.0' And '$(TargetFramework)'!='netstandard2.0' And '$(TargetFramework)'!='netstandard2.1'">
<ItemGroup Condition="'$(TargetFramework)'!='net6.0' And '$(TargetFramework)'!='net5.0' And '$(TargetFramework)'!='netstandard2.0' And '$(TargetFramework)'!='netstandard2.1'">
<Reference Include="System.Net.Http" />
<Reference Include="System.IO.Compression" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@
<group targetFramework="net5.0">
<dependency id="Selenium.WebDriver.StrongNamed" version="$version$" exclude="Build,Analyzers" />
</group>
<group targetFramework="net6.0">
<dependency id="Selenium.WebDriver.StrongNamed" version="$version$" exclude="Build,Analyzers" />
</group>
</dependencies>
<frameworkAssemblies>
<frameworkAssembly assemblyName="System.Drawing" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net5.0;net48;net47;net46;net45;netstandard2.1;netstandard2.0</TargetFrameworks>
<TargetFrameworks>net6.0;net5.0;net48;net47;net46;net45;netstandard2.1;netstandard2.0</TargetFrameworks>
<AssemblyName>Selenium.WebDriverBackedSelenium</AssemblyName>
<RootNamespace>Selenium</RootNamespace>
<BuildSystem>visual-studio</BuildSystem>
Expand Down
2 changes: 1 addition & 1 deletion dotnet/test/chrome/WebDriver.Chrome.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net5.0;net48;netcoreapp3.1</TargetFrameworks>
<TargetFrameworks>net6.0;net48;netcoreapp3.1</TargetFrameworks>
<AssemblyName>WebDriver.Chrome.Tests</AssemblyName>
</PropertyGroup>

Expand Down
16 changes: 8 additions & 8 deletions dotnet/test/common/TakesScreenshotTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public void GetScreenshotAsBinary()
[Test]
public void ShouldCaptureScreenshotOfCurrentViewport()
{
#if NETCOREAPP3_1 || NETSTANDARD2_1 || NET5_0
#if NETCOREAPP3_1 || NET6_0
Assert.Ignore("Skipping test: this framework can not process colors.");
#endif

Expand Down Expand Up @@ -96,7 +96,7 @@ public void ShouldCaptureScreenshotOfCurrentViewport()
[Test]
public void ShouldTakeScreenshotsOfAnElement()
{
#if NETCOREAPP3_1 || NETSTANDARD2_1 || NET5_0
#if NETCOREAPP3_1 || NET6_0
Assert.Ignore("Skipping test: this framework can not process colors.");
#endif

Expand All @@ -122,7 +122,7 @@ public void ShouldTakeScreenshotsOfAnElement()
[Test]
public void ShouldCaptureScreenshotAtFramePage()
{
#if NETCOREAPP3_1 || NETSTANDARD2_1 || NET5_0
#if NETCOREAPP3_1 || NET6_0
Assert.Ignore("Skipping test: this framework can not process colors.");
#endif

Expand Down Expand Up @@ -164,7 +164,7 @@ public void ShouldCaptureScreenshotAtFramePage()
[Test]
public void ShouldCaptureScreenshotAtIFramePage()
{
#if NETCOREAPP3_1 || NETSTANDARD2_1 || NET5_0
#if NETCOREAPP3_1 || NET6_0
Assert.Ignore("Skipping test: this framework can not process colors.");
#endif

Expand Down Expand Up @@ -204,7 +204,7 @@ public void ShouldCaptureScreenshotAtIFramePage()
[IgnoreBrowser(Browser.Firefox, "Color comparisons fail on Firefox")]
public void ShouldCaptureScreenshotAtFramePageAfterSwitching()
{
#if NETCOREAPP3_1 || NETSTANDARD2_1 || NET5_0
#if NETCOREAPP3_1 || NET6_0
Assert.Ignore("Skipping test: this framework can not process colors.");
#endif

Expand Down Expand Up @@ -242,7 +242,7 @@ public void ShouldCaptureScreenshotAtFramePageAfterSwitching()
[IgnoreBrowser(Browser.Firefox, "Color comparisons fail on Firefox")]
public void ShouldCaptureScreenshotAtIFramePageAfterSwitching()
{
#if NETCOREAPP3_1 || NETSTANDARD2_1 || NET5_0
#if NETCOREAPP3_1 || NET6_0
Assert.Ignore("Skipping test: this framework can not process colors.");
#endif

Expand Down Expand Up @@ -318,7 +318,7 @@ private HashSet<string> ScanActualColors(Screenshot screenshot, int stepX, int s
{
HashSet<string> colors = new HashSet<string>();

#if !NETCOREAPP3_1 && !NETSTANDARD2_1 && !NET5_0
#if !NETCOREAPP3_1 && !NET6_0
try
{
Image image = Image.FromStream(new MemoryStream(screenshot.AsByteArray));
Expand Down Expand Up @@ -352,7 +352,7 @@ private Color GetPixelColor(Screenshot screenshot, int x, int y)
{
Color pixelColor = Color.Black;

#if !NETCOREAPP3_1 && !NETSTANDARD2_1 && !NET5_0
#if !NETCOREAPP3_1 && !NET6_0
Image image = Image.FromStream(new MemoryStream(screenshot.AsByteArray));
Bitmap bitmap = new Bitmap(image);
pixelColor = bitmap.GetPixel(1, 1);
Expand Down
2 changes: 1 addition & 1 deletion dotnet/test/common/WebDriver.Common.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net5.0;net48;netcoreapp3.1</TargetFrameworks>
<TargetFrameworks>net6.0;net48;netcoreapp3.1</TargetFrameworks>
<AssemblyName>WebDriver.Common.Tests</AssemblyName>
<RootNamespace>OpenQA.Selenium</RootNamespace>
</PropertyGroup>
Expand Down
4 changes: 2 additions & 2 deletions dotnet/test/edge/WebDriver.Edge.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net5.0;net48;netcoreapp3.1</TargetFrameworks>
<TargetFrameworks>net6.0;net48;netcoreapp3.1</TargetFrameworks>
<AssemblyName>WebDriver.Edge.Tests</AssemblyName>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<OutputPath>..\..\..\build\cli\Debug\</OutputPath>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion dotnet/test/firefox/WebDriver.Firefox.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net5.0;net48;netcoreapp3.1</TargetFrameworks>
<TargetFrameworks>net6.0;net48;netcoreapp3.1</TargetFrameworks>
<AssemblyName>WebDriver.Firefox.Tests</AssemblyName>
</PropertyGroup>

Expand Down
2 changes: 1 addition & 1 deletion dotnet/test/ie/WebDriver.IE.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net5.0;net48;netcoreapp3.1</TargetFrameworks>
<TargetFrameworks>net6.0;net48;netcoreapp3.1</TargetFrameworks>
<AssemblyName>WebDriver.IE.Tests</AssemblyName>
<RootNamespace>OpenQA.Selenium.IE</RootNamespace>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion dotnet/test/remote/WebDriver.Remote.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net5.0;net48;netcoreapp3.1</TargetFrameworks>
<TargetFrameworks>net6.0;net48;netcoreapp3.1</TargetFrameworks>
<AssemblyName>WebDriver.Remote.Tests</AssemblyName>
</PropertyGroup>

Expand Down
2 changes: 1 addition & 1 deletion dotnet/test/safari/WebDriver.Safari.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net5.0;net48;netcoreapp3.1</TargetFrameworks>
<TargetFrameworks>net6.0;net48;netcoreapp3.1</TargetFrameworks>
<AssemblyName>WebDriver.Safari.Tests</AssemblyName>
</PropertyGroup>

Expand Down
4 changes: 2 additions & 2 deletions dotnet/test/support/WebDriver.Support.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net5.0;net48;netcoreapp3.1</TargetFrameworks>
<TargetFrameworks>net6.0;net48;netcoreapp3.1</TargetFrameworks>
<AssemblyName>WebDriver.Support.Tests</AssemblyName>
</PropertyGroup>

Expand All @@ -12,7 +12,7 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<OutputPath>..\..\..\build\cli\Release\</OutputPath>
</PropertyGroup>

<ItemGroup>
<Compile Remove="obj\**" />
<EmbeddedResource Remove="obj\**" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net5.0;net48;netcoreapp3.1</TargetFrameworks>
<TargetFrameworks>net6.0;net48;netcoreapp3.1</TargetFrameworks>
<AssemblyName>Selenium.WebDriverBackedSelenium.Tests</AssemblyName>
</PropertyGroup>

Expand Down

0 comments on commit d2838e1

Please sign in to comment.