Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OSOE-683: Update all NuGet dependencies #313

Merged
merged 12 commits into from
Sep 23, 2023
4 changes: 2 additions & 2 deletions Lombiq.Tests.UI.Samples/Lombiq.Tests.UI.Samples.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,10 @@ public static async Task UsingScopeAsync(
httpContextAccessor.HttpContext = shellScope.ShellContext.CreateHttpContext();
var httpContext = httpContextAccessor.HttpContext;

// Seems to be a false positive warning. IDE thinks that left hand side can't be null.
#pragma warning disable S2583 // Conditionally executed code should be reachable
httpContext.Request.PathBase = "/" + shellHost.GetSettings(tenant).RequestUrlPrefix ?? string.Empty;
#pragma warning restore S2583 // Conditionally executed code should be reachable
sarahelsaig marked this conversation as resolved.
Show resolved Hide resolved
httpContext.Features.Set(new RecipeEnvironmentFeature());

await shellScope.UsingAsync(execute, activateShell);
Expand Down
14 changes: 7 additions & 7 deletions Lombiq.Tests.UI/Lombiq.Tests.UI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,14 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Atata" Version="2.8.1" />
<PackageReference Include="Atata" Version="2.9.0" />
<PackageReference Include="Atata.Bootstrap" Version="2.1.0" />
<PackageReference Include="Atata.HtmlValidation" Version="2.3.0" />
<PackageReference Include="Atata.HtmlValidation" Version="2.4.0" />
<PackageReference Include="Atata.WebDriverExtras" Version="2.2.0" />
<PackageReference Include="Atata.WebDriverSetup" Version="2.7.0" />
<PackageReference Include="Azure.Storage.Blobs" Version="12.16.0" />
<PackageReference Include="Atata.WebDriverSetup" Version="2.8.0" />
<PackageReference Include="Azure.Storage.Blobs" Version="12.18.0" />
<PackageReference Include="Ben.Demystifier" Version="0.4.1" />
<PackageReference Include="Codeuctivity.ImageSharpCompare" Version="3.0.156" />
<PackageReference Include="Codeuctivity.ImageSharpCompare" Version="3.0.183" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="7.0.0" />
<PackageReference Include="Microsoft.SqlServer.DACFx" Version="162.0.52" />
Expand All @@ -68,12 +68,12 @@
<PackageReference Include="OrchardCore.Logging.NLog" Version="1.7.0" />
<PackageReference Include="OrchardCore.Abstractions" Version="1.7.0" />
<PackageReference Include="OrchardCore.Recipes.Core" Version="1.7.0" />
<PackageReference Include="Refit.HttpClientFactory" Version="6.3.2" />
<PackageReference Include="Refit.HttpClientFactory" Version="7.0.0" />
<PackageReference Include="Selenium.Axe" Version="4.0.13" />
<PackageReference Include="Shouldly" Version="4.2.1" />
<PackageReference Include="System.Linq.Async" Version="6.0.1" />
<PackageReference Include="WebDriverManager" Version="2.16.2" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit" Version="2.5.0" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion Lombiq.Tests.UI/Models/SafeWaitAsync.cs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ protected virtual bool DoesConditionResultSatisfy<TResult>(TResult result)
{
if (typeof(TResult) == typeof(bool))
{
if (result is true) return true;
if (result.Equals(true)) return true;
}
sarahelsaig marked this conversation as resolved.
Show resolved Hide resolved
else if (!Equals(result, default(TResult)) &&
(result is not IEnumerable enumerable || enumerable.Cast<object>().Any()))
Expand Down
3 changes: 3 additions & 0 deletions Lombiq.Tests.UI/OrchardCoreUITestBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,10 @@ protected virtual async Task ExecuteTestAsync(
finally
{
_testOutputHelper = originalTestOutputHelper;
// This warning is a false positive as it is not considering the evaluation of the if statement above.
#pragma warning disable S2583 // Conditionally executed code should be reachable
afterTest?.Invoke();
#pragma warning restore S2583 // Conditionally executed code should be reachable
}
}
}
6 changes: 3 additions & 3 deletions Lombiq.Tests.UI/Services/AtataFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,7 @@ public static async Task<AtataScope> StartAtataScopeAsync(
var browserConfiguration = configuration.BrowserConfiguration;

var builder = AtataContext.Configure()
// The drivers are disposed when disposing AtataScope.
#pragma warning disable CA2000 // Dispose objects before losing scope
.UseDriver(await CreateDriverAsync(browserConfiguration, timeoutConfiguration, testOutputHelper))
#pragma warning restore CA2000 // Dispose objects before losing scope
.UseBaseUrl(baseUri.ToString())
.UseCulture(browserConfiguration.AcceptLanguage.ToString())
.UseTestName(configuration.AtataConfiguration.TestName)
Expand Down Expand Up @@ -92,10 +89,13 @@ Task<T> FromAsync<T>(Func<BrowserConfiguration, TimeSpan, Task<T>> factory)
}
catch (WebDriverException ex)
{
// This warning seems to be a false positive as there is nothing that indicates its validity.
#pragma warning disable S2589 // Boolean expressions should not be gratuitous
if (!ex.Message.ContainsOrdinalIgnoreCase("Cannot start the driver service on") || currentTry >= maxTryCount)
{
throw;
}
#pragma warning restore S2589 // Boolean expressions should not be gratuitous

currentTry++;
var retryCount = maxTryCount - currentTry;
sarahelsaig marked this conversation as resolved.
Show resolved Hide resolved
Expand Down
2 changes: 1 addition & 1 deletion Lombiq.Tests.UI/Services/UITestExecutionSession.cs
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ private Exception PrepareAndLogException(Exception ex)
else if (_context?.Driver is not null)
{
_testOutputHelper.WriteLineTimestampedAndDebug(
$"An exception has occurred while interacting with the page {_context?.GetPageTitleAndAddress()}.");
$"An exception has occurred while interacting with the page {_context.GetPageTitleAndAddress()}.");
}

_testOutputHelper.WriteLineTimestampedAndDebug($"The test failed with the following exception: {ex}");
Expand Down