Skip to content

Commit

Permalink
Merge pull request #127 from Lombiq/issue/NEST-501
Browse files Browse the repository at this point in the history
NEST-501: Improving UI test
  • Loading branch information
wAsnk authored Jul 18, 2024
2 parents 92b7261 + 7862c08 commit de8b8a0
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
</ItemGroup>

<ItemGroup Condition="'$(NuGetBuild)' == 'true'">
<PackageReference Include="Lombiq.Tests.UI" Version="10.0.1" />
<PackageReference Include="Lombiq.Tests.UI" Version="10.0.2-alpha.0.nest-501" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
</ItemGroup>

<ItemGroup Condition="'$(NuGetBuild)' == 'true'">
<PackageReference Include="Lombiq.Tests.UI" Version="10.0.1" />
<PackageReference Include="Lombiq.Tests.UI" Version="10.0.2-alpha.0.nest-501" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
</ItemGroup>

<ItemGroup Condition="'$(NuGetBuild)' == 'true'">
<PackageReference Include="Lombiq.Tests.UI" Version="10.0.1" />
<PackageReference Include="Lombiq.Tests.UI" Version="10.0.2-alpha.0.nest-501" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
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;

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
Expand All @@ -24,8 +23,7 @@ public static void SetMaxIdleMinutesAndLoggingForUITest(
return Task.CompletedTask;
};

public static readonly Func<IWebApplicationInstance, Task> AssertAppLogsWithIdleCheckAsync =
async webApplicationInstance =>
public static async Task AssertAppLogsWithIdleCheckAsync(this IWebApplicationInstance webApplicationInstance) =>
(await webApplicationInstance.GetLogOutputAsync())
.ShouldContain($"Shutting down tenant \"{IdleTenantName}\" because of idle timeout.");
}
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
</ItemGroup>

<ItemGroup Condition="'$(NuGetBuild)' == 'true'">
<PackageReference Include="Lombiq.Tests.UI" Version="10.0.1" />
<PackageReference Include="Lombiq.Tests.UI" Version="10.0.2-alpha.0.nest-501" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
</ItemGroup>

<ItemGroup Condition="'$(NuGetBuild)' == 'true'">
<PackageReference Include="Lombiq.Tests.UI" Version="10.0.1" />
<PackageReference Include="Lombiq.Tests.UI" Version="10.0.2-alpha.0.nest-501" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
</ItemGroup>

<ItemGroup Condition="'$(NuGetBuild)' == 'true'">
<PackageReference Include="Lombiq.Tests.UI" Version="10.0.1" />
<PackageReference Include="Lombiq.Tests.UI" Version="10.0.2-alpha.0.nest-501" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
</ItemGroup>

<ItemGroup Condition="'$(NuGetBuild)' == 'true'">
<PackageReference Include="Lombiq.Tests.UI" Version="10.0.1" />
<PackageReference Include="Lombiq.Tests.UI" Version="10.0.2-alpha.0.nest-501" />
</ItemGroup>

</Project>

0 comments on commit de8b8a0

Please sign in to comment.