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-402: Custom logging instead of NLog-based one in Lombiq.UITestingToolbox #880

Merged
merged 29 commits into from
Nov 18, 2024
Merged
Show file tree
Hide file tree
Changes from 28 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
0371e31
Basics of in-memory logging during UI testing
Piedone Nov 8, 2024
f5a7c8c
Merge remote-tracking branch 'origin/dev' into issue/OSOE-402
Piedone Nov 8, 2024
9363e7e
Making fake logging work
Piedone Nov 10, 2024
eb58ae7
Spelling
Piedone Nov 10, 2024
7a624f6
Docs
Piedone Nov 10, 2024
2dbdb24
Fixing DatabaseSnapshotTests
Piedone Nov 10, 2024
173d3c7
Removing excessive logging in IdleTenantManagement tests
Piedone Nov 10, 2024
685ef2a
Fixing log assertions
Piedone Nov 10, 2024
af48c31
Fixing BehaviorIdleTenantsTests
Piedone Nov 10, 2024
3fa48cd
Attempting to get rid of debug logs during UI testing
Piedone Nov 10, 2024
86b52a4
Error default log level
Piedone Nov 10, 2024
69674c7
Better UI testing logging configuration
Piedone Nov 10, 2024
3226807
Fixing security scanning tests
Piedone Nov 10, 2024
9ec6067
Adding LogsShouldNotContainErrorsAsync()
Piedone Nov 10, 2024
183d03d
Better UI test output formatting
Piedone Nov 10, 2024
0ab425d
Releasing NuGet alphas
Piedone Nov 11, 2024
ca18b79
Temporarily not canceling in-progress PRs
Piedone Nov 11, 2024
df838cc
Seal
Piedone Nov 11, 2024
d1ad85f
Deliberate UI test fail to test artifacts
Piedone Nov 11, 2024
ee734e6
Updating NuGetTest solution
Piedone Nov 11, 2024
3e99a29
Build error
Piedone Nov 11, 2024
bfa0417
Fixing NuGetTest BehaviorIdleTenantsTests
Piedone Nov 11, 2024
60fc232
Revert "Temporarily not canceling in-progress PRs"
Piedone Nov 11, 2024
cee9cb1
Merge remote-tracking branch 'origin/dev' into issue/OSOE-402
Piedone Nov 16, 2024
123f8e2
Small UITT fixes
Piedone Nov 16, 2024
3295cea
LGHA docs
Piedone Nov 17, 2024
082c9fa
Merge remote-tracking branch 'origin/dev' into issue/OSOE-402
Piedone Nov 17, 2024
3974d85
Docs
Piedone Nov 18, 2024
b38de6a
Branch references
dministro Nov 18, 2024
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
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 28 files
+1 −1 .github/workflows/publish-nuget.yml
+1 −1 .github/workflows/validate-nuget-publish.yml
+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
Loading