Skip to content

Commit

Permalink
Merge pull request #880 from Lombiq/issue/OSOE-402
Browse files Browse the repository at this point in the history
OSOE-402: Custom logging instead of NLog-based one in Lombiq.UITestingToolbox
  • Loading branch information
LombiqBot authored Nov 18, 2024
2 parents f77e6a0 + b38de6a commit b37c3bc
Show file tree
Hide file tree
Showing 13 changed files with 32 additions and 73 deletions.
22 changes: 11 additions & 11 deletions NuGetTest/src/Lombiq.OSOCE.NuGet.Web/Lombiq.OSOCE.NuGet.Web.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Lombiq.AuditTrailExtensions" Version="7.0.0" />
<PackageReference Include="Lombiq.AuditTrailExtensions" Version="7.0.1-alpha.2.osoe-864" />
<PackageReference Include="Lombiq.BaseTheme" Version="8.0.0" />
<PackageReference Include="Lombiq.BaseTheme.Samples" Version="8.0.0" />
<PackageReference Include="Lombiq.ChartJs" Version="8.0.0" />
Expand All @@ -35,22 +35,22 @@
<PackageReference Include="Lombiq.Hosting.MediaTheme" Version="7.0.0" />
<PackageReference Include="Lombiq.Hosting.MediaTheme.Bridge" Version="7.0.0" />
<PackageReference Include="Lombiq.Hosting.MediaTheme.Targets" Version="7.0.0" />
<PackageReference Include="Lombiq.Hosting.Tenants.Admin.Login" Version="8.0.0" />
<PackageReference Include="Lombiq.Hosting.Tenants.EnvironmentRobots" Version="8.0.0" />
<PackageReference Include="Lombiq.Hosting.Tenants.FeaturesGuard" Version="8.0.0" />
<PackageReference Include="Lombiq.Hosting.Tenants.IdleTenantManagement" Version="8.0.0" />
<PackageReference Include="Lombiq.Hosting.Tenants.Maintenance" Version="8.0.0" />
<PackageReference Include="Lombiq.Hosting.Tenants.Management" Version="8.0.0" />
<PackageReference Include="Lombiq.Hosting.Tenants.MediaStorageManagement" Version="8.0.0" />
<PackageReference Include="Lombiq.Hosting.Tenants.EmailQuotaManagement" Version="8.0.0" />
<PackageReference Include="Lombiq.Hosting.Tenants.Admin.Login" Version="8.0.1-alpha.0.osoe-402" />
<PackageReference Include="Lombiq.Hosting.Tenants.EnvironmentRobots" Version="8.0.1-alpha.0.osoe-402" />
<PackageReference Include="Lombiq.Hosting.Tenants.FeaturesGuard" Version="8.0.1-alpha.0.osoe-402" />
<PackageReference Include="Lombiq.Hosting.Tenants.IdleTenantManagement" Version="8.0.1-alpha.0.osoe-402" />
<PackageReference Include="Lombiq.Hosting.Tenants.Maintenance" Version="8.0.1-alpha.0.osoe-402" />
<PackageReference Include="Lombiq.Hosting.Tenants.Management" Version="8.0.1-alpha.0.osoe-402" />
<PackageReference Include="Lombiq.Hosting.Tenants.MediaStorageManagement" Version="8.0.1-alpha.0.osoe-402" />
<PackageReference Include="Lombiq.Hosting.Tenants.EmailQuotaManagement" Version="8.0.1-alpha.0.osoe-402" />
<PackageReference Include="Lombiq.JsonEditor" Version="8.0.0" />
<PackageReference Include="Lombiq.JsonEditor.Tests.UI" Version="8.0.0" />
<PackageReference Include="Lombiq.LoginAsAnybody" Version="4.0.0" />
<PackageReference Include="Lombiq.Privacy" Version="9.0.0" />
<PackageReference Include="Lombiq.Privacy.Samples" Version="9.0.0" />
<PackageReference Include="Lombiq.SetupExtensions" Version="7.0.0" />
<PackageReference Include="Lombiq.Tests.UI.AppExtensions" Version="11.0.0" />
<PackageReference Include="Lombiq.Tests.UI.Shortcuts" Version="11.0.0" />
<PackageReference Include="Lombiq.Tests.UI.AppExtensions" Version="11.1.1-alpha.0.osoe-402" />
<PackageReference Include="Lombiq.Tests.UI.Shortcuts" Version="11.1.1-alpha.0.osoe-402" />
<PackageReference Include="Lombiq.UIKit" Version="8.0.0" />
<PackageReference Include="Lombiq.VueJs" Version="7.0.0" />
<PackageReference Include="Lombiq.VueJs.Samples" Version="7.0.0" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,19 @@
<PackageReference Include="Lombiq.Hosting.BuildVersionDisplay.Tests.UI" Version="6.0.0" />
<PackageReference Include="Lombiq.Hosting.MediaTheme.Bridge.Tests.UI" Version="7.0.0" />
<PackageReference Include="Lombiq.Hosting.MediaTheme.Tests.UI" Version="7.0.0" />
<PackageReference Include="Lombiq.Hosting.Tenants.EnvironmentRobots.Tests.UI" Version="8.0.0" />
<PackageReference Include="Lombiq.Hosting.Tenants.FeaturesGuard.Tests.UI" Version="8.0.0" />
<PackageReference Include="Lombiq.Hosting.Tenants.IdleTenantManagement.Tests.UI" Version="8.0.0" />
<PackageReference Include="Lombiq.Hosting.Tenants.MediaStorageManagement.Tests.UI" Version="8.0.0" />
<PackageReference Include="Lombiq.Hosting.Tenants.EmailQuotaManagement.Tests.UI" Version="8.0.0" />
<PackageReference Include="Lombiq.Hosting.Tenants.Maintenance.Tests.UI" Version="8.0.0" />
<PackageReference Include="Lombiq.Hosting.Tenants.Management.Tests.UI" Version="8.0.0" />
<PackageReference Include="Lombiq.Hosting.Tenants.EnvironmentRobots.Tests.UI" Version="8.0.1-alpha.0.osoe-402" />
<PackageReference Include="Lombiq.Hosting.Tenants.FeaturesGuard.Tests.UI" Version="8.0.1-alpha.0.osoe-402" />
<PackageReference Include="Lombiq.Hosting.Tenants.IdleTenantManagement.Tests.UI" Version="8.0.1-alpha.0.osoe-402" />
<PackageReference Include="Lombiq.Hosting.Tenants.MediaStorageManagement.Tests.UI" Version="8.0.1-alpha.0.osoe-402" />
<PackageReference Include="Lombiq.Hosting.Tenants.EmailQuotaManagement.Tests.UI" Version="8.0.1-alpha.0.osoe-402" />
<PackageReference Include="Lombiq.Hosting.Tenants.Maintenance.Tests.UI" Version="8.0.1-alpha.0.osoe-402" />
<PackageReference Include="Lombiq.Hosting.Tenants.Management.Tests.UI" Version="8.0.1-alpha.0.osoe-402" />
<PackageReference Include="Lombiq.JsonEditor.Tests.UI" Version="8.0.0" />
<PackageReference Include="Lombiq.LoginAsAnybody.Tests.UI" Version="4.0.0" />
<PackageReference Include="Lombiq.OrchardCoreApiClient.Tests.UI" Version="6.0.1-alpha.0.osoe-909" />
<PackageReference Include="Lombiq.Privacy.Tests.UI" Version="9.0.0" />
<PackageReference Include="Lombiq.HelpfulExtensions.Tests.UI" Version="9.0.0" />
<PackageReference Include="Lombiq.Tests.UI" Version="11.1.0" />
<PackageReference Include="Lombiq.Tests.UI" Version="11.1.1-alpha.0.osoe-402" />
<PackageReference Include="Lombiq.VueJs.Tests.UI" Version="7.0.0" />
<PackageReference Include="Lombiq.Walkthroughs.Tests.UI" Version="2.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
using Lombiq.Hosting.Tenants.IdleTenantManagement.Tests.UI.Extensions;
using Lombiq.OSOCE.NuGet.Tests.UI.Constants;
using Lombiq.Tests.UI.Extensions;
using System.Threading.Tasks;
using Xunit;
using Xunit.Abstractions;
using static Lombiq.OSOCE.NuGet.Tests.UI.Constants.RecipeIds;

namespace Lombiq.OSOCE.NuGet.Tests.UI.Tests.ModuleTests;

public class IdleTenantTests : UITestBase
public class BehaviorIdleTenantsTests : UITestBase
{
public IdleTenantTests(ITestOutputHelper testOutputHelper)
public BehaviorIdleTenantsTests(ITestOutputHelper testOutputHelper)
: base(testOutputHelper)
{
}
Expand All @@ -20,11 +20,7 @@ public Task ShuttingDownIdleTenantsShouldWork() =>
async context =>
{
await context.SignInDirectlyAsync();
await context.TestIdleTenantManagerBehaviorAsync(TestsSetupRecipeId);
context.Configuration.AssertAppLogsAsync = webApplicationInstance =>
IdleTenantManagementExtensions.AssertAppLogsWithIdleCheckAsync(webApplicationInstance);
await context.TestIdleTenantManagerBehaviorAsync(RecipeIds.TestsSetupRecipeId);
},
configuration => configuration.SetMaxIdleMinutesAndLoggingForUITest());
configuration => configuration.ConfigureIdleTenantManagementTestSettings());
}
2 changes: 1 addition & 1 deletion NuGetTest/test/Lombiq.OSOCE.NuGet.Tests.UI/UITestBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ protected override Task ExecuteTestAsync(
async configuration =>
{
configuration.AssertAppLogsAsync =
OrchardCoreUITestExecutorConfiguration.AssertAppLogsCanContainWarningsAndCacheFolderErrorsAsync;
OrchardCoreUITestExecutorConfiguration.AssertAppLogsCanContainCacheFolderErrorsAsync;
// These two can be removed once https://github.com/OrchardCMS/OrchardCore/issues/15222 is done.
configuration.AssertBrowserLog = AssertHtmlAndBrowserErrorsHelper.AssertNoNativeButtonUsageInBrowserLog;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<ItemGroup>
<PackageReference Include="Lombiq.HelpfulLibraries" Version="11.0.0" />
<PackageReference Include="Lombiq.Tests" Version="3.0.0" />
<PackageReference Include="Lombiq.Tests" Version="4.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down
2 changes: 1 addition & 1 deletion Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ When adding a new extension, or significant new features to existing extensions,
- If you introduce .NET breaking changes, the Validate NuGet Publish workflow will fail due to [baseline package validation](https://learn.microsoft.com/en-us/dotnet/fundamentals/apicompat/package-validation/baseline-version-validator). Preferably, adjust the change to not be breaking if possible; if it has to be a breaking change, then you’ll need to create a _CompatibilitySuppressions.xml_ file to mark it as deliberate, what you can do with the following command:

```powershell
dotnet pack /p:EnablePackageValidation=true /p:PackageValidationBaselineVersion=<current version> /p:Version=<new version> /p:NuGetBuild=true /p:GenerateCompatibilitySuppressionFile=true
dotnet pack /p:EnablePackageValidation=true /p:PackageValidationBaselineVersion=<current version, like 1.2.3> /p:Version=<the next patch version> /p:NuGetBuild=true /p:GenerateCompatibilitySuppressionFile=true
```

### Dependencies between Lombiq projects
Expand Down
35 changes: 0 additions & 35 deletions test/Lombiq.OSOCE.Tests.UI/Helpers/AssertAppLogsHelpers.cs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ public Task ShuttingDownIdleTenantsShouldWork() =>
await context.SignInDirectlyAsync();
await context.TestIdleTenantManagerBehaviorAsync();
},
configuration => configuration.SetMaxIdleMinutesAndLoggingForUITest());
configuration => configuration.ConfigureIdleTenantManagementTestSettings());
}
2 changes: 0 additions & 2 deletions test/Lombiq.OSOCE.Tests.UI/UITestBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,5 @@ protected static void ChangeConfiguration(OrchardCoreUITestExecutorConfiguration

configuration.BrowserConfiguration.Headless =
TestConfigurationManager.GetBoolConfiguration("BrowserConfiguration:Headless", defaultValue: false);

configuration.AssertAppLogsAsync = OrchardCoreUITestExecutorConfiguration.AssertAppLogsCanContainWarningsAndCacheFolderErrorsAsync;
}
}
2 changes: 1 addition & 1 deletion test/Lombiq.UITestingToolbox
Submodule Lombiq.UITestingToolbox updated 26 files
+11 −11 Lombiq.Tests.UI.Samples/Tests/DatabaseSnapshotTests.cs
+1 −1 Lombiq.Tests.UI.Samples/Tests/ErrorHandlingTests.cs
+5 −5 Lombiq.Tests.UI.Samples/Tests/ShiftTimeTests.cs
+37 −16 Lombiq.Tests.UI.Samples/UITestBase.cs
+2 −5 Lombiq.Tests.UI.Shortcuts/Controllers/ShiftTimeController.cs
+2 −2 Lombiq.Tests.UI.Tests.UI/TestCases/SecurityShortcutsTestCases.cs
+144 −0 Lombiq.Tests.UI/CompatibilitySuppressions.xml
+1 −1 Lombiq.Tests.UI/Docs/Troubleshooting.md
+19 −4 Lombiq.Tests.UI/Extensions/ApplicationLogEnumerableExtensions.cs
+2 −2 Lombiq.Tests.UI/Extensions/BrowserUITestContextExtensions.cs
+1 −1 Lombiq.Tests.UI/Extensions/ShortcutsUITestContextExtensions.cs
+1 −1 Lombiq.Tests.UI/Extensions/VerificationUITestContextExtensions.cs
+116 −34 Lombiq.Tests.UI/Extensions/WebApplicationInstanceExtensions.cs
+23 −0 Lombiq.Tests.UI/Helpers/AppLogAssertionHelper.cs
+1 −0 Lombiq.Tests.UI/Lombiq.Tests.UI.csproj
+46 −0 Lombiq.Tests.UI/Models/FakeLoggerLogApplicationLog.cs
+72 −0 Lombiq.Tests.UI/SecurityScanning/OrchardCoreUITestExecutorConfigurationExtensions.cs
+3 −3 Lombiq.Tests.UI/SecurityScanning/SecurityScanningUITestContextExtensions.cs
+69 −0 Lombiq.Tests.UI/Services/IApplicationLog.cs
+1 −33 Lombiq.Tests.UI/Services/IWebApplicationInstance.cs
+8 −18 Lombiq.Tests.UI/Services/OrchardCoreHosting/OrchardApplicationFactory.cs
+31 −37 Lombiq.Tests.UI/Services/OrchardCoreInstance.cs
+6 −101 Lombiq.Tests.UI/Services/OrchardCoreUITestExecutorConfiguration.cs
+3 −1 Lombiq.Tests.UI/Services/RemoteInstance.cs
+0 −1 Lombiq.Tests.UI/Services/SynchronizingWebApplicationSnapshotManager.cs
+2 −2 Lombiq.Tests.UI/Services/UITestContext.cs
2 changes: 1 addition & 1 deletion tools/Lombiq.GitHub.Actions

0 comments on commit b37c3bc

Please sign in to comment.