Skip to content

Commit e45f53d

Browse files
Merge pull request #276 from q2ebanking/SeleniumWebDriverUpdate
Update Selenium packages for Null Pointer vulnerability
2 parents b0a402d + cb044e7 commit e45f53d

File tree

14 files changed

+32
-26
lines changed

14 files changed

+32
-26
lines changed

.github/workflows/nuget-push.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
- name: Set up .NET
3333
uses: actions/setup-dotnet@v3
3434
with:
35-
dotnet-version: '7.0.x'
35+
dotnet-version: '8.0.x'
3636

3737

3838
# Screenplay

.github/workflows/unit-tests.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
steps:
1616

1717
- name: Check out repository
18-
uses: actions/checkout@v3
18+
uses: actions/checkout@v4
1919

2020
- name: Build the solution
2121
run: dotnet build
@@ -38,31 +38,31 @@ jobs:
3838

3939
- name: Archive Screenplay unit test results
4040
if: always()
41-
uses: actions/upload-artifact@v3
41+
uses: actions/upload-artifact@v4
4242
with:
4343
name: Screenplay unit test results
4444
path: Boa.Constrictor.Screenplay.UnitTests/TestResults/ScreenplayResults.trx
4545
retention-days: 30
4646

4747
- name: Archive Selenium unit test results
4848
if: always()
49-
uses: actions/upload-artifact@v3
49+
uses: actions/upload-artifact@v4
5050
with:
5151
name: Selenium unit test results
5252
path: Boa.Constrictor.Selenium.UnitTests/TestResults/SeleniumResults.trx
5353
retention-days: 30
5454

5555
- name: Archive RestSharp unit test results
5656
if: always()
57-
uses: actions/upload-artifact@v3
57+
uses: actions/upload-artifact@v4
5858
with:
5959
name: RestSharp unit test results
6060
path: Boa.Constrictor.RestSharp.UnitTests/TestResults/RestSharpResults.trx
6161
retention-days: 30
6262

6363
- name: Archive Xunit unit test results
6464
if: always()
65-
uses: actions/upload-artifact@v3
65+
uses: actions/upload-artifact@v4
6666
with:
6767
name: Xunit unit test results
6868
path: Boa.Constrictor.Xunit.UnitTests/TestResults/XunitResults.trx

Boa.Constrictor.Example/Boa.Constrictor.Example.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net7.0</TargetFramework>
4+
<TargetFramework>net8.0</TargetFramework>
55
<Version>4.0.0</Version>
66
<Authors>Pandy Knight and the PrecisionLender SETs</Authors>
77
<Company>Q2</Company>

Boa.Constrictor.RestSharp.UnitTests/Boa.Constrictor.RestSharp.UnitTests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net7.0</TargetFramework>
4+
<TargetFramework>net8.0</TargetFramework>
55

66
<IsPackable>false</IsPackable>
77
</PropertyGroup>

Boa.Constrictor.Screenplay.UnitTests/Boa.Constrictor.Screenplay.UnitTests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net7.0</TargetFramework>
4+
<TargetFramework>net8.0</TargetFramework>
55

66
<IsPackable>false</IsPackable>
77
</PropertyGroup>

Boa.Constrictor.Selenium.UnitTests/Boa.Constrictor.Selenium.UnitTests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net7.0</TargetFramework>
4+
<TargetFramework>net8.0</TargetFramework>
55

66
<IsPackable>false</IsPackable>
77
</PropertyGroup>

Boa.Constrictor.Selenium.UnitTests/Equality/WebInteractionEqualityTest.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using Boa.Constrictor.Screenplay;
2-
using Boa.Constrictor.Selenium;
32
using FluentAssertions;
43
using NUnit.Framework;
54
using OpenQA.Selenium;
@@ -34,8 +33,8 @@ public class WebInteractionEqualityTest
3433
new object[] { CssValueList.For(LocatorA, "property"), CssValueList.For(LocatorA1, "property") },
3534
new object[] { CurrentScreenshot.SavedTo("/path/to/screenshot"), CurrentScreenshot.SavedTo("/path/to/screenshot") },
3635
new object[] { CurrentScreenshot.SavedTo("/path/to/screenshot", "file"), CurrentScreenshot.SavedTo("/path/to/screenshot", "file") },
37-
new object[] { CurrentScreenshot.SavedTo("/path/to/screenshot", "file").UsingFormat(ScreenshotImageFormat.Png), CurrentScreenshot.SavedTo("/path/to/screenshot", "file").UsingFormat(ScreenshotImageFormat.Png) },
38-
new object[] { CurrentScreenshot.SavedTo("/path/to/screenshot").UsingFormat(ScreenshotImageFormat.Png), CurrentScreenshot.SavedTo("/path/to/screenshot").UsingFormat(ScreenshotImageFormat.Png) },
36+
new object[] { CurrentScreenshot.SavedTo("/path/to/screenshot", "file").UsingFormat(".png"), CurrentScreenshot.SavedTo("/path/to/screenshot", "file").UsingFormat(".png") },
37+
new object[] { CurrentScreenshot.SavedTo("/path/to/screenshot").UsingFormat(".png"), CurrentScreenshot.SavedTo("/path/to/screenshot").UsingFormat(".png") },
3938
new object[] { CurrentUrl.FromBrowser(), CurrentUrl.FromBrowser() },
4039
new object[] { DomProperty.Of(LocatorA, "property"), DomProperty.Of(LocatorA1, "property") },
4140
new object[] { EnabledState.Of(LocatorA), EnabledState.Of(LocatorA1) },
@@ -127,7 +126,7 @@ public class WebInteractionEqualityTest
127126
new object[] { CurrentScreenshot.SavedTo("/path/to/screenshot"), CurrentScreenshot.SavedTo("/path/to/screenshot2") },
128127
new object[] { CurrentScreenshot.SavedTo("/path/to/screenshot", "file"), CurrentScreenshot.SavedTo("/path/to/screenshot") },
129128
new object[] { CurrentScreenshot.SavedTo("/path/to/screenshot", "file"), CurrentScreenshot.SavedTo("/path/to/screenshot", "file2") },
130-
new object[] { CurrentScreenshot.SavedTo("/path/to/screenshot").UsingFormat(ScreenshotImageFormat.Png), CurrentScreenshot.SavedTo("/path/to/screenshot").UsingFormat(ScreenshotImageFormat.Jpeg) },
129+
new object[] { CurrentScreenshot.SavedTo("/path/to/screenshot").UsingFormat(".png"), CurrentScreenshot.SavedTo("/path/to/screenshot").UsingFormat(".jpeg") },
131130
new object[] { CurrentUrl.FromBrowser(), Title.OfPage() },
132131
new object[] { DomProperty.Of(LocatorA, "property"), Title.OfPage() },
133132
new object[] { DomProperty.Of(LocatorA, "property"), DomProperty.Of(LocatorB, "property") },

Boa.Constrictor.Selenium.UnitTests/Questions/CurrentScreenshotTest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public void TestSaveFileWithExtension()
7676
[Test]
7777
public void TestSaveFileWithJpegFormat()
7878
{
79-
var image = Actor.AsksFor(CurrentScreenshot.SavedTo(Dir, "webpage").UsingFormat(ScreenshotImageFormat.Jpeg));
79+
var image = Actor.AsksFor(CurrentScreenshot.SavedTo(Dir, "webpage").UsingFormat(".jpeg"));
8080
ImagesToDelete.Add(image);
8181
image.Should().Match(Dir + Path.DirectorySeparatorChar + "webpage*.jpeg");
8282
Logger.Messages.Should().ContainMatch($"*Screenshots: {Dir}{Path.DirectorySeparatorChar}webpage*.jpeg");
@@ -86,7 +86,7 @@ public void TestSaveFileWithJpegFormat()
8686
[Test]
8787
public void TestSaveFileWithBmpFormatNoName()
8888
{
89-
var image = Actor.AsksFor(CurrentScreenshot.SavedTo(Dir).UsingFormat(ScreenshotImageFormat.Bmp));
89+
var image = Actor.AsksFor(CurrentScreenshot.SavedTo(Dir).UsingFormat(".bmp"));
9090
ImagesToDelete.Add(image);
9191
image.Should().Match(Dir + Path.DirectorySeparatorChar + "Screenshot*.bmp");
9292
Logger.Messages.Should().ContainMatch($"*Screenshots: {Dir}{Path.DirectorySeparatorChar}Screenshot*.bmp");

Boa.Constrictor.Selenium/Boa.Constrictor.Selenium.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
</ItemGroup>
2828

2929
<ItemGroup>
30-
<PackageReference Include="Selenium.Support" Version="4.6.0" />
31-
<PackageReference Include="Selenium.WebDriver" Version="4.6.0" />
30+
<PackageReference Include="Selenium.Support" Version="4.28.0" />
31+
<PackageReference Include="Selenium.WebDriver" Version="4.28.0" />
3232
</ItemGroup>
3333

3434
<ItemGroup Condition="'$(Configuration)' == 'Release'">

Boa.Constrictor.Selenium/CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1717

1818
## [Unreleased]
1919

20-
(none)
20+
### Changed
21+
22+
- Updated `Selenium.Support` and `Selenium.Webdriver` to Version 4.28.0
23+
- Replaced `ScreenshotImageFormat` with `string` to append to screenshot file formatting path
24+
- Updated corresponding unit tests to correct for necessary changes
2125

2226

2327
## [4.2.0] - 2024-06-11

0 commit comments

Comments
 (0)