From 131b894082b2ddc966dac0d8f6b6bdc8dfc41377 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Tue, 9 Jul 2024 20:46:39 +0200 Subject: [PATCH 1/3] Turning AssertAppLogsWithIdleCheckAsync() into an extension method --- .../Extensions/IdleTenantManagementExtensions.cs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Lombiq.Hosting.Tenants.IdleTenantManagement.Tests.UI/Extensions/IdleTenantManagementExtensions.cs b/Lombiq.Hosting.Tenants.IdleTenantManagement.Tests.UI/Extensions/IdleTenantManagementExtensions.cs index 3eff499b..34e122d9 100644 --- a/Lombiq.Hosting.Tenants.IdleTenantManagement.Tests.UI/Extensions/IdleTenantManagementExtensions.cs +++ b/Lombiq.Hosting.Tenants.IdleTenantManagement.Tests.UI/Extensions/IdleTenantManagementExtensions.cs @@ -1,7 +1,6 @@ using Lombiq.Tests.UI.Extensions; using Lombiq.Tests.UI.Services; using Shouldly; -using System; using System.Threading.Tasks; using static Lombiq.Hosting.Tenants.IdleTenantManagement.Tests.UI.Constants.IdleTenantData; @@ -9,8 +8,8 @@ namespace Lombiq.Hosting.Tenants.IdleTenantManagement.Tests.UI.Extensions; public static class IdleTenantManagementExtensions { - public static void SetMaxIdleMinutesAndLoggingForUITest( - this OrchardCoreUITestExecutorConfiguration configuration) => configuration.OrchardCoreConfiguration.BeforeAppStart += + public static void SetMaxIdleMinutesAndLoggingForUITest(this OrchardCoreUITestExecutorConfiguration configuration) => + configuration.OrchardCoreConfiguration.BeforeAppStart += (_, argumentsBuilder) => { argumentsBuilder @@ -24,8 +23,7 @@ public static void SetMaxIdleMinutesAndLoggingForUITest( return Task.CompletedTask; }; - public static readonly Func AssertAppLogsWithIdleCheckAsync = - async webApplicationInstance => + public static async Task AssertAppLogsWithIdleCheckAsync(this IWebApplicationInstance webApplicationInstance) => (await webApplicationInstance.GetLogOutputAsync()) .ShouldContain($"Shutting down tenant \"{IdleTenantName}\" because of idle timeout."); } From ba2a32be8fc7038befff5ed2f58f5b902226a433 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Tue, 9 Jul 2024 22:09:04 +0200 Subject: [PATCH 2/3] Moving AssertAppLogsWithIdleCheckAsync() to the UI test instead of relying on the consumer to do it --- .../Extensions/TestCaseUITestContextExtensions.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Lombiq.Hosting.Tenants.IdleTenantManagement.Tests.UI/Extensions/TestCaseUITestContextExtensions.cs b/Lombiq.Hosting.Tenants.IdleTenantManagement.Tests.UI/Extensions/TestCaseUITestContextExtensions.cs index 3a6708b4..3e28d961 100644 --- a/Lombiq.Hosting.Tenants.IdleTenantManagement.Tests.UI/Extensions/TestCaseUITestContextExtensions.cs +++ b/Lombiq.Hosting.Tenants.IdleTenantManagement.Tests.UI/Extensions/TestCaseUITestContextExtensions.cs @@ -36,5 +36,8 @@ await context.GoToSetupPageAndSetupOrchardCoreAsync( // working as intended. await context.SignInDirectlyAsync(); await context.GoToDashboardAsync(); + + // Make sure the shutdown message is in the logs. + await context.Application.AssertAppLogsWithIdleCheckAsync(); } } From 7862c08adff5fbdb632232610bffb48a381f4a56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Tue, 9 Jul 2024 23:11:08 +0200 Subject: [PATCH 3/3] Updating Lombiq.Tests.UI NuGet reference --- .../Lombiq.Hosting.Tenants.EmailQuotaManagement.Tests.UI.csproj | 2 +- .../Lombiq.Hosting.Tenants.EnvironmentRobots.Tests.UI.csproj | 2 +- .../Lombiq.Hosting.Tenants.FeaturesGuard.Tests.UI.csproj | 2 +- .../Lombiq.Hosting.Tenants.IdleTenantManagement.Tests.UI.csproj | 2 +- .../Lombiq.Hosting.Tenants.Maintenance.Tests.UI.csproj | 2 +- .../Lombiq.Hosting.Tenants.Management.Tests.UI.csproj | 2 +- ...ombiq.Hosting.Tenants.MediaStorageManagement.Tests.UI.csproj | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Lombiq.Hosting.Tenants.EmailQuotaManagement.Tests.UI/Lombiq.Hosting.Tenants.EmailQuotaManagement.Tests.UI.csproj b/Lombiq.Hosting.Tenants.EmailQuotaManagement.Tests.UI/Lombiq.Hosting.Tenants.EmailQuotaManagement.Tests.UI.csproj index 35459e2a..d1891d81 100644 --- a/Lombiq.Hosting.Tenants.EmailQuotaManagement.Tests.UI/Lombiq.Hosting.Tenants.EmailQuotaManagement.Tests.UI.csproj +++ b/Lombiq.Hosting.Tenants.EmailQuotaManagement.Tests.UI/Lombiq.Hosting.Tenants.EmailQuotaManagement.Tests.UI.csproj @@ -32,7 +32,7 @@ - + diff --git a/Lombiq.Hosting.Tenants.EnvironmentRobots.Tests.UI/Lombiq.Hosting.Tenants.EnvironmentRobots.Tests.UI.csproj b/Lombiq.Hosting.Tenants.EnvironmentRobots.Tests.UI/Lombiq.Hosting.Tenants.EnvironmentRobots.Tests.UI.csproj index 336132a3..44b7d478 100644 --- a/Lombiq.Hosting.Tenants.EnvironmentRobots.Tests.UI/Lombiq.Hosting.Tenants.EnvironmentRobots.Tests.UI.csproj +++ b/Lombiq.Hosting.Tenants.EnvironmentRobots.Tests.UI/Lombiq.Hosting.Tenants.EnvironmentRobots.Tests.UI.csproj @@ -21,7 +21,7 @@ - + diff --git a/Lombiq.Hosting.Tenants.FeaturesGuard.Tests.UI/Lombiq.Hosting.Tenants.FeaturesGuard.Tests.UI.csproj b/Lombiq.Hosting.Tenants.FeaturesGuard.Tests.UI/Lombiq.Hosting.Tenants.FeaturesGuard.Tests.UI.csproj index 34412f4c..6241a6fd 100644 --- a/Lombiq.Hosting.Tenants.FeaturesGuard.Tests.UI/Lombiq.Hosting.Tenants.FeaturesGuard.Tests.UI.csproj +++ b/Lombiq.Hosting.Tenants.FeaturesGuard.Tests.UI/Lombiq.Hosting.Tenants.FeaturesGuard.Tests.UI.csproj @@ -32,7 +32,7 @@ - + diff --git a/Lombiq.Hosting.Tenants.IdleTenantManagement.Tests.UI/Lombiq.Hosting.Tenants.IdleTenantManagement.Tests.UI.csproj b/Lombiq.Hosting.Tenants.IdleTenantManagement.Tests.UI/Lombiq.Hosting.Tenants.IdleTenantManagement.Tests.UI.csproj index 8ce9b4b7..6b7983ec 100644 --- a/Lombiq.Hosting.Tenants.IdleTenantManagement.Tests.UI/Lombiq.Hosting.Tenants.IdleTenantManagement.Tests.UI.csproj +++ b/Lombiq.Hosting.Tenants.IdleTenantManagement.Tests.UI/Lombiq.Hosting.Tenants.IdleTenantManagement.Tests.UI.csproj @@ -21,7 +21,7 @@ - + diff --git a/Lombiq.Hosting.Tenants.Maintenance.Tests.UI/Lombiq.Hosting.Tenants.Maintenance.Tests.UI.csproj b/Lombiq.Hosting.Tenants.Maintenance.Tests.UI/Lombiq.Hosting.Tenants.Maintenance.Tests.UI.csproj index f64f3474..72ad1726 100644 --- a/Lombiq.Hosting.Tenants.Maintenance.Tests.UI/Lombiq.Hosting.Tenants.Maintenance.Tests.UI.csproj +++ b/Lombiq.Hosting.Tenants.Maintenance.Tests.UI/Lombiq.Hosting.Tenants.Maintenance.Tests.UI.csproj @@ -21,7 +21,7 @@ - + diff --git a/Lombiq.Hosting.Tenants.Management.Tests.UI/Lombiq.Hosting.Tenants.Management.Tests.UI.csproj b/Lombiq.Hosting.Tenants.Management.Tests.UI/Lombiq.Hosting.Tenants.Management.Tests.UI.csproj index 56b8d1c8..336f910a 100644 --- a/Lombiq.Hosting.Tenants.Management.Tests.UI/Lombiq.Hosting.Tenants.Management.Tests.UI.csproj +++ b/Lombiq.Hosting.Tenants.Management.Tests.UI/Lombiq.Hosting.Tenants.Management.Tests.UI.csproj @@ -21,7 +21,7 @@ - + diff --git a/Lombiq.Hosting.Tenants.MediaStorageManagement.Tests.UI/Lombiq.Hosting.Tenants.MediaStorageManagement.Tests.UI.csproj b/Lombiq.Hosting.Tenants.MediaStorageManagement.Tests.UI/Lombiq.Hosting.Tenants.MediaStorageManagement.Tests.UI.csproj index eeacf13e..e52d142f 100644 --- a/Lombiq.Hosting.Tenants.MediaStorageManagement.Tests.UI/Lombiq.Hosting.Tenants.MediaStorageManagement.Tests.UI.csproj +++ b/Lombiq.Hosting.Tenants.MediaStorageManagement.Tests.UI/Lombiq.Hosting.Tenants.MediaStorageManagement.Tests.UI.csproj @@ -32,7 +32,7 @@ - +