Skip to content

Commit

Permalink
Testing on tenants with request URL prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
barthamark committed Mar 27, 2024
1 parent fee1f5c commit 5501703
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
using Lombiq.Hosting.MediaTheme.Tests.UI.Extensions;
using Lombiq.Tests.UI.Extensions;
using Lombiq.Tests.UI.Pages;
using Lombiq.Tests.UI.Services;
using System.Threading.Tasks;
using Xunit;
using Xunit.Abstractions;
Expand All @@ -7,16 +10,40 @@ namespace Lombiq.OSOCE.Tests.UI.Tests.ThemeTests;

public class BehaviorMediaThemeTests : UITestBase
{
public const string TestTenantName = "test";

public BehaviorMediaThemeTests(ITestOutputHelper testOutputHelper)
: base(testOutputHelper)
{
}

[Fact]
public Task MediaThemeShouldWorkWhenDeployed() =>
ExecuteTestAfterSetupAsync(context => context.TestMediaThemeDeployedBehaviorAsync());
ExecuteTestAfterSetupAsync(async context =>
{
await context.TestMediaThemeDeployedBehaviorAsync();
await CreateAndSwitchToTenantAsync(context);
await context.TestMediaThemeDeployedBehaviorAsync(TestTenantName);
});

[Fact]
public Task MediaThemeShouldWorkLocally() =>
ExecuteTestAfterSetupAsync(context => context.TestMediaThemeLocalBehaviorAsync());
ExecuteTestAfterSetupAsync(async context =>
{
await context.TestMediaThemeLocalBehaviorAsync();
await CreateAndSwitchToTenantAsync(context);
await context.TestMediaThemeLocalBehaviorAsync();
});

private static Task CreateAndSwitchToTenantAsync(UITestContext context) =>
context.CreateAndSwitchToTenantAsync(
TestTenantName,
TestTenantName,
new OrchardCoreSetupParameters
{
SiteName = "Media Theme Test Tenant",
RecipeId = "Lombiq.OSOCE.Tests",
TablePrefix = TestTenantName,
UserName = "admin",
});
}

0 comments on commit 5501703

Please sign in to comment.