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

NEST-501: Improving UI test #127

Merged
merged 3 commits into from
Jul 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
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>
Loading