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-815: Updating all dependencies, fixing SMTP tests, changing browser logging to BiDi, fixing analyzer violations #442

Open
wants to merge 31 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
68e61ef
Fixing analyzer violations
Piedone Dec 25, 2024
5114bfa
Fixing more analyzer violations
Piedone Dec 25, 2024
bc58f71
Merge remote-tracking branch 'origin/dev' into issue/OSOE-815-analyzers
Piedone Dec 28, 2024
f004522
Update All packages
renovate[bot] Dec 29, 2024
f8eed91
Update All packages
renovate[bot] Dec 29, 2024
a1cca11
Removing unneeded package-lock
Piedone Dec 29, 2024
93a3b15
Merge remote-tracking branch 'origin/dev' into issue/OSOE-815-analyzers
Piedone Dec 29, 2024
c6a0078
Fixing SMTP service startup
Piedone Dec 29, 2024
2ba8251
Fixing SMTP inbox row lookup
Piedone Dec 29, 2024
df45f29
Merge remote-tracking branch 'origin/dev' into issue/OSOE-815-ui-test…
Piedone Dec 29, 2024
c50496f
Updating HelpfulLibraries reference
Piedone Dec 29, 2024
f9f022e
Removing temporary Renovate group
Piedone Dec 29, 2024
b1d839c
Make GetAndEmptyBrowserLog() throw when under Firefox
Piedone Dec 29, 2024
d521837
Changing browser logging to BiDi
Piedone Dec 30, 2024
de9d643
Not setting up BiDi log event if no browser is configured
Piedone Dec 30, 2024
86b4711
Adding response log to be able to assert on 404s and others, adding b…
Piedone Dec 30, 2024
2ec0c2e
Merge remote-tracking branch 'origin/dev' into issue/OSOE-815-analyzers
Piedone Dec 30, 2024
bcbb7bf
Merge remote-tracking branch 'origin/dev' into issue/OSOE-815-ui-test…
Piedone Dec 30, 2024
da7061f
Merge remote-tracking branch 'origin/renovate/major-all-packages' int…
Piedone Dec 30, 2024
3c77534
Suppressing breaking changes
Piedone Dec 30, 2024
bb8627b
Merge remote-tracking branch 'origin/issue/OSOE-815-analyzers' into i…
Piedone Dec 31, 2024
42532e7
Merge remote-tracking branch 'origin/dev' into issue/OSOE-815-combined
Piedone Jan 7, 2025
00cb797
Merge remote-tracking branch 'origin/dev' into issue/OSOE-815-combined
Piedone Jan 10, 2025
1c0bc9d
Merge remote-tracking branch 'origin/dev' into issue/OSOE-815-combined
BenedekFarkas Jan 20, 2025
e32db81
Merge branch 'dev' into issue/OSOE-815-combined
Piedone Jan 21, 2025
e7c73eb
Merge remote-tracking branch 'origin/dev' into issue/OSOE-815-combined
Piedone Jan 23, 2025
18dd258
Revert "Temporarily disabling SendingTestEmailShouldWork too"
Piedone Jan 23, 2025
ec501df
Merge branch 'dev' into issue/OSOE-815-combined
BenedekFarkas Jan 28, 2025
337acb2
Updating HL reference
Piedone Jan 28, 2025
2c856b0
Merge remote-tracking branch 'origin/dev' into issue/OSOE-815-combined
Piedone Jan 28, 2025
f5f0a0b
Updating CompatibilitySuppressions
Piedone Jan 28, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 2 additions & 9 deletions Lombiq.Tests.UI.Samples/Tests/AzureBlobStorageTests.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
using Lombiq.Tests.UI.Extensions;
using Lombiq.Tests.UI.Samples.Extensions;
using Lombiq.Tests.UI.Services;
using System.Linq;
using System.Threading.Tasks;
using Xunit;
using Xunit.Abstractions;
Expand Down Expand Up @@ -38,13 +36,8 @@ public Task TogglingFeaturesShouldWorkWithAzureBlobStorage() =>
{
configuration.UseAzureBlobStorage = true;

configuration.AssertBrowserLog =
logEntries =>
{
var messagesWithoutToggle = logEntries.Where(logEntry =>
!logEntry.IsNotFoundLogEntry(ShortcutsUITestContextExtensions.FeatureToggleTestBenchUrl));
OrchardCoreUITestExecutorConfiguration.AssertBrowserLogIsEmpty(messagesWithoutToggle);
};
configuration.ResponseLogFilter = e =>
e.IsNonSuccessResponseAndNotExpectedNotFoundResponse(ShortcutsUITestContextExtensions.FeatureToggleTestBenchUrl);
});
}

Expand Down
19 changes: 8 additions & 11 deletions Lombiq.Tests.UI.Samples/Tests/BasicTests.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
using Lombiq.Tests.UI.Constants;
using Lombiq.Tests.UI.Extensions;
using Lombiq.Tests.UI.Services;
using OpenQA.Selenium;
using Shouldly;
using System.Linq;
using System.Threading.Tasks;
using Xunit;
using Xunit.Abstractions;
Expand Down Expand Up @@ -74,15 +72,14 @@ public Task TogglingFeaturesShouldWork() =>
context => context.ExecuteAndAssertTestFeatureToggleAsync(),
// You can change the configuration even for each test.
configuration =>
// By default, apart from some commonly known exceptions, the browser log should be empty. However,
// ExecuteAndAssertTestFeatureToggle() causes a 404 so we need to make sure not to fail on that.
configuration.AssertBrowserLog =
logEntries =>
{
var messagesWithoutToggle = logEntries.Where(logEntry =>
!logEntry.IsNotFoundLogEntry(ShortcutsUITestContextExtensions.FeatureToggleTestBenchUrl));
OrchardCoreUITestExecutorConfiguration.AssertBrowserLogIsEmpty(messagesWithoutToggle);
});
// By default, apart from some commonly known false positives, the response log should be empty.
// However, ExecuteAndAssertTestFeatureToggle() causes a 404 so we need to make sure not to fail on
// that.
// Note that similarly, you can filter out log entries from the browser log with BrowserLogFilter. You
// can also adjust the assertion logic with AssertResponseLog and AssertBrowserLog, but it's best to
// filter out entries in the first place.
configuration.ResponseLogFilter = e =>
e.IsNonSuccessResponseAndNotExpectedNotFoundResponse(ShortcutsUITestContextExtensions.FeatureToggleTestBenchUrl));

// Let's see a couple more useful shortcuts in action.
[Fact]
Expand Down
5 changes: 1 addition & 4 deletions Lombiq.Tests.UI.Samples/Tests/EmailTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,7 @@ public EmailTests(ITestOutputHelper testOutputHelper)
{
}

// Will be re-enabled as part of https://github.com/Lombiq/Open-Source-Orchard-Core-Extensions/issues/703.
#pragma warning disable xUnit1004 // Test methods should not be skipped
[Fact(Skip = "Fails with smtp4dev JS exceptions, but works under https://github.com/Lombiq/Open-Source-Orchard-Core-Extensions/issues/703.")]
#pragma warning restore xUnit1004 // Test methods should not be skipped
[Fact]
public Task SendingTestEmailShouldWork() =>
ExecuteTestAfterSetupAsync(
async context =>
Expand Down
26 changes: 19 additions & 7 deletions Lombiq.Tests.UI.Samples/Tests/ErrorHandlingTests.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
using Lombiq.Tests.UI.Exceptions;
using Lombiq.Tests.UI.Extensions;
using Lombiq.Tests.UI.Helpers;
using Lombiq.Tests.UI.Pages;
using Lombiq.Tests.UI.Samples.Helpers;
using Lombiq.Tests.UI.Services;
using OpenQA.Selenium.BiDi.Modules.Log;
using Shouldly;
using System;
using System.Linq;
Expand Down Expand Up @@ -59,8 +62,8 @@ public Task ClientSideErrorOnLoadedPageShouldHaltTest() =>
}
catch (PageChangeAssertionException)
{
// Remove browser logs to have a clean slate.
context.ClearHistoricBrowserLog();
// Remove response logs to have a clean slate.
context.ClearCumulativeResponseLog();
}
});

Expand Down Expand Up @@ -89,12 +92,21 @@ public Task BrowserLogsShouldPersist() =>
WriteConsoleLog();
WriteConsoleLog();

await context.UpdateHistoricBrowserLogAsync();
// Since the browser log is updated asynchronously, we have to wait for most recent entries to appear.
ReliabilityHelper.DoWithRetriesOrFail(() =>
context
.CumulativeBrowserLog
.Count(entry => entry.Text.Contains(testLog)) == 6);
},
configuration =>
{
// By default, anything below warning is not logged to the browser log. So, to allow the info messages
// of the test, we change the filter.
configuration.BrowserLogFilter = logEntry =>
OrchardCoreUITestExecutorConfiguration.IsNonSuccessBrowserLogEntry(logEntry) || logEntry.Level == Level.Info;

context
.HistoricBrowserLog
.Count(entry => entry.Message.Contains(testLog))
.ShouldBe(6);
// By default, the test will fail if the browser log is not empty. We allow info entries here.
configuration.AssertBrowserLog = logEntries => logEntries.ShouldNotContain(entry => entry.Level > Level.Info);
});

[Fact]
Expand Down
34 changes: 7 additions & 27 deletions Lombiq.Tests.UI.Samples/Tests/MonkeyTests.cs
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
using Atata;
using Lombiq.Tests.UI.Extensions;
using Lombiq.Tests.UI.MonkeyTesting;
using Lombiq.Tests.UI.MonkeyTesting.UrlFilters;
using Lombiq.Tests.UI.Services;
using OpenQA.Selenium;
using Shouldly;
using System;
using System.Linq;
using System.Threading.Tasks;
using Xunit;
using Xunit.Abstractions;
using LogLevel = OpenQA.Selenium.LogLevel;

namespace Lombiq.Tests.UI.Samples.Tests;

Expand Down Expand Up @@ -69,10 +63,9 @@ public Task TestAdminPagesAsMonkeyRecursivelyShouldWorkWithAdminUser() =>

return context.TestAdminAsMonkeyRecursivelyAsync(monkeyTestingOptions);
},
configuration =>
configuration.AssertBrowserLog = logEntries => logEntries.ShouldNotContain(
logEntry => IsValidAdminBrowserLogEntry(logEntry),
logEntries.Where(IsValidAdminBrowserLogEntry).ToFormattedString()));
// Requests to /api/graphql without further parameters will fail with HTTP 400, but that's OK, since some
// parameters are required.
configuration => configuration.ResponseLogFilter = e => e.IsNonSuccessResponseAndNotExpectedStatusResponse("/api/graphql", 400));

// Let's just test the background tasks management admin area.
[Fact]
Expand All @@ -93,30 +86,17 @@ public Task TestAdminBackgroundTasksAsMonkeyRecursivelyShouldWorkWithAdminUser()
await context.SignInDirectlyAndGoToAdminRelativeUrlAsync("/BackgroundTasks");
await context.TestCurrentPageAsMonkeyRecursivelyAsync(monkeyTestingOptions);
},
configuration => configuration.AssertBrowserLog = (logEntries) => logEntries
.Where(logEntry =>
!logEntry
.Message
.Contains("An invalid form control with name='LockTimeout' is not focusable.")
&& !logEntry
.Message
.Contains("An invalid form control with name='LockExpiration' is not focusable.")
&& !logEntry.IsNotFoundLogEntry("/favicon.ico")
&& logEntry.Level != LogLevel.Info)
.ShouldBeEmpty());
configuration => configuration.BrowserLogFilter = logEntry =>
logEntry.IsNonSuccessBrowserLogEntry() &&
!logEntry.Text.Contains("An invalid form control with name='LockTimeout' is not focusable.") &&
!logEntry.Text.Contains("An invalid form control with name='LockExpiration' is not focusable."));

// Monkey testing has its own configuration too. Check out the docs of the options too.
private static MonkeyTestingOptions CreateMonkeyTestingOptions() =>
new()
{
PageTestTime = TimeSpan.FromSeconds(5),
};

private static bool IsValidAdminBrowserLogEntry(LogEntry logEntry) =>
OrchardCoreUITestExecutorConfiguration.IsValidBrowserLogEntry(logEntry) &&
// Requests to /api/graphql without further parameters will fail with HTTP 400, but that's OK, since some
// parameters are required.
!logEntry.Message.ContainsOrdinalIgnoreCase("/api/graphql - Failed to load resource: the server responded with a status of 400");
}

// END OF TRAINING SECTION: Monkey tests.
Expand Down
11 changes: 2 additions & 9 deletions Lombiq.Tests.UI.Samples/Tests/SqlServerTests.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
using Lombiq.Tests.UI.Extensions;
using Lombiq.Tests.UI.Samples.Extensions;
using Lombiq.Tests.UI.Services;
using System.Linq;
using System.Threading.Tasks;
using Xunit;
using Xunit.Abstractions;
Expand Down Expand Up @@ -37,13 +35,8 @@ public Task TogglingFeaturesShouldWorkWithSqlServer() =>
{
configuration.UseSqlServer = true;

configuration.AssertBrowserLog =
logEntries =>
{
var messagesWithoutToggle = logEntries.Where(logEntry =>
!logEntry.IsNotFoundLogEntry(ShortcutsUITestContextExtensions.FeatureToggleTestBenchUrl));
OrchardCoreUITestExecutorConfiguration.AssertBrowserLogIsEmpty(messagesWithoutToggle);
};
configuration.ResponseLogFilter = e =>
e.IsNonSuccessResponseAndNotExpectedNotFoundResponse(ShortcutsUITestContextExtensions.FeatureToggleTestBenchUrl);
});
}

Expand Down
2 changes: 1 addition & 1 deletion Lombiq.Tests.UI.Shortcuts/Lombiq.Tests.UI.Shortcuts.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
<PackageReference Include="OrchardCore.Abstractions" Version="2.1.0" />
<PackageReference Include="OrchardCore.ResourceManagement.Abstractions" Version="2.1.0" />
<PackageReference Include="OrchardCore.Workflows" Version="2.1.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.6.2" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="7.2.0" />
</ItemGroup>

<ItemGroup Condition="'$(NuGetBuild)' != 'true'">
Expand Down
2 changes: 1 addition & 1 deletion Lombiq.Tests.UI/.config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"isRoot": true,
"tools": {
"rnwood.smtp4dev": {
"version": "3.1.4",
"version": "3.6.1",
"commands": [
"smtp4dev"
]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
using Atata;
using Lombiq.Tests.UI.Extensions;
using Lombiq.Tests.UI.Helpers;
using System;

namespace Lombiq.Tests.UI.Attributes.Behaviors;

[AttributeUsage(AttributeTargets.Property, AllowMultiple = false)]
public sealed class SetsValueReliablyAttribute : ValueSetBehaviorAttribute
{
public override void Execute<TOwner>(IUIComponent<TOwner> component, string value) // #spell-check-ignore-line
Expand Down
2 changes: 2 additions & 0 deletions Lombiq.Tests.UI/Attributes/ChromeAttribute.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
using Lombiq.Tests.UI.Services;
using System;

namespace Lombiq.Tests.UI.Attributes;

[AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = true)]
public sealed class ChromeAttribute : BrowserAttributeBase
{
protected override Browser Browser => Browser.Chrome;
Expand Down
2 changes: 2 additions & 0 deletions Lombiq.Tests.UI/Attributes/EdgeAttribute.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
using Lombiq.Tests.UI.Services;
using System;

namespace Lombiq.Tests.UI.Attributes;

[AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = true)]
public sealed class EdgeAttribute : BrowserAttributeBase
{
protected override Browser Browser => Browser.Edge;
Expand Down
2 changes: 2 additions & 0 deletions Lombiq.Tests.UI/Attributes/FirefoxAttribute.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
using Lombiq.Tests.UI.Services;
using System;

namespace Lombiq.Tests.UI.Attributes;

[AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = true)]
public sealed class FirefoxAttribute : BrowserAttributeBase
{
protected override Browser Browser => Browser.Firefox;
Expand Down
61 changes: 55 additions & 6 deletions Lombiq.Tests.UI/CompatibilitySuppressions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,35 +3,84 @@
<Suppressions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Suppression>
<DiagnosticId>CP0001</DiagnosticId>
<Target>T:Lombiq.Tests.UI.Attributes.InternetExplorerAttribute</Target>
<Target>T:Lombiq.Tests.UI.Extensions.LoggingWebDriverExtensions</Target>
<Left>lib/net8.0/Lombiq.Tests.UI.dll</Left>
<Right>lib/net8.0/Lombiq.Tests.UI.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>F:Lombiq.Tests.UI.Services.Browser.InternetExplorer</Target>
<Target>F:Lombiq.Tests.UI.Services.OrchardCoreUITestExecutorConfiguration.AssertBrowserLogIsEmpty</Target>
<Left>lib/net8.0/Lombiq.Tests.UI.dll</Left>
<Right>lib/net8.0/Lombiq.Tests.UI.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>M:Lombiq.Tests.UI.Extensions.HttpClientUITestContextExtensions.CreateAndAuthorizeClientAsync(Lombiq.Tests.UI.Services.UITestContext,System.String,System.String,System.String,System.String,System.String)</Target>
<Target>F:Lombiq.Tests.UI.Services.OrchardCoreUITestExecutorConfiguration.IsValidBrowserLogEntry</Target>
<Left>lib/net8.0/Lombiq.Tests.UI.dll</Left>
<Right>lib/net8.0/Lombiq.Tests.UI.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>M:Lombiq.Tests.UI.Services.WebDriverFactory.CreateInternetExplorerDriverAsync(Lombiq.Tests.UI.Services.BrowserConfiguration,System.TimeSpan)</Target>
<Target>M:Lombiq.Tests.UI.Extensions.SeleniumLogEntryExtensions.IsNotFoundLogEntry(OpenQA.Selenium.LogEntry,System.String)</Target>
<Left>lib/net8.0/Lombiq.Tests.UI.dll</Left>
<Right>lib/net8.0/Lombiq.Tests.UI.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0011</DiagnosticId>
<Target>F:Lombiq.Tests.UI.Services.Browser.None</Target>
<DiagnosticId>CP0002</DiagnosticId>
<Target>M:Lombiq.Tests.UI.Extensions.SeleniumLogEntryExtensions.ToFormattedString(System.Collections.Generic.IEnumerable{OpenQA.Selenium.LogEntry})</Target>
<Left>lib/net8.0/Lombiq.Tests.UI.dll</Left>
<Right>lib/net8.0/Lombiq.Tests.UI.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>M:Lombiq.Tests.UI.Services.OrchardCoreUITestExecutorConfiguration.get_AssertBrowserLog</Target>
<Left>lib/net8.0/Lombiq.Tests.UI.dll</Left>
<Right>lib/net8.0/Lombiq.Tests.UI.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>M:Lombiq.Tests.UI.Services.UITestContext.#ctor(System.String,Lombiq.Tests.UI.Models.UITestManifest,Lombiq.Tests.UI.Services.OrchardCoreUITestExecutorConfiguration,Lombiq.Tests.UI.Services.IWebApplicationInstance,Lombiq.Tests.UI.Services.AtataScope,System.Uri,Lombiq.Tests.UI.Models.RunningContextContainer,Lombiq.Tests.UI.SecurityScanning.ZapManager)</Target>
<Left>lib/net8.0/Lombiq.Tests.UI.dll</Left>
<Right>lib/net8.0/Lombiq.Tests.UI.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>M:Lombiq.Tests.UI.Services.UITestContext.AssertCurrentBrowserLogAsync</Target>
<Left>lib/net8.0/Lombiq.Tests.UI.dll</Left>
<Right>lib/net8.0/Lombiq.Tests.UI.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>M:Lombiq.Tests.UI.Services.UITestContext.ClearHistoricBrowserLog</Target>
<Left>lib/net8.0/Lombiq.Tests.UI.dll</Left>
<Right>lib/net8.0/Lombiq.Tests.UI.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>M:Lombiq.Tests.UI.Services.UITestContext.get_HistoricBrowserLog</Target>
<Left>lib/net8.0/Lombiq.Tests.UI.dll</Left>
<Right>lib/net8.0/Lombiq.Tests.UI.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0002</DiagnosticId>
<Target>M:Lombiq.Tests.UI.Services.UITestContext.UpdateHistoricBrowserLogAsync</Target>
<Left>lib/net8.0/Lombiq.Tests.UI.dll</Left>
<Right>lib/net8.0/Lombiq.Tests.UI.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
</Suppression>
<Suppression>
<DiagnosticId>CP0009</DiagnosticId>
<Target>T:Lombiq.Tests.UI.Services.UITestContext</Target>
<Left>lib/net8.0/Lombiq.Tests.UI.dll</Left>
<Right>lib/net8.0/Lombiq.Tests.UI.dll</Right>
<IsBaselineSuppression>true</IsBaselineSuppression>
Expand Down
15 changes: 0 additions & 15 deletions Lombiq.Tests.UI/Extensions/LoggingWebDriverExtensions.cs

This file was deleted.

10 changes: 5 additions & 5 deletions Lombiq.Tests.UI/Extensions/SeleniumLogEntryExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
using OpenQA.Selenium;
using Lombiq.Tests.UI.Services;
using OpenQA.Selenium.BiDi.Modules.Log;
using System;
using System.Collections.Generic;

namespace Lombiq.Tests.UI.Extensions;

public static class SeleniumLogEntryExtensions
{
public static string ToFormattedString(this IEnumerable<LogEntry> logEntries) =>
public static string ToFormattedString(this IEnumerable<Entry> logEntries) =>
string.Join(Environment.NewLine, logEntries);

public static bool IsNotFoundLogEntry(this LogEntry logEntry, string url) =>
logEntry.Message.ContainsOrdinalIgnoreCase(
@$"{url} - Failed to load resource: the server responded with a status of 404");
public static bool IsNonSuccessBrowserLogEntry(this Entry entry) =>
OrchardCoreUITestExecutorConfiguration.IsNonSuccessBrowserLogEntry(entry);
}
Loading
Loading