Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dev' into issue/NEST-499
Browse files Browse the repository at this point in the history
  • Loading branch information
wAsnk committed Nov 29, 2023
2 parents d90aa0a + 50a2c14 commit c867d64
Show file tree
Hide file tree
Showing 54 changed files with 238 additions and 422 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<PackageReference Include="Lombiq.DataTables" Version="7.0.2-alpha.0.osoe-638" />
<PackageReference Include="Lombiq.DataTables.Samples" Version="7.0.2-alpha.0.osoe-638" />
<PackageReference Include="Lombiq.HelpfulExtensions" Version="7.0.2" />
<PackageReference Include="Lombiq.Hosting.Azure.ApplicationInsights" Version="7.0.1-alpha.0.osoe-638" />
<PackageReference Include="Lombiq.Hosting.Azure.ApplicationInsights" Version="7.0.2-alpha.1.osoe-733" />
<PackageReference Include="Lombiq.Hosting.BuildVersionDisplay" Version="4.0.1-alpha.0.osoe-638" />
<PackageReference Include="Lombiq.Hosting.MediaTheme" Version="5.0.1-alpha.0.osoe-638" />
<PackageReference Include="Lombiq.Hosting.MediaTheme.Bridge" Version="5.0.1-alpha.0.osoe-638" />
Expand All @@ -47,8 +47,8 @@
<PackageReference Include="Lombiq.Privacy" Version="7.0.2-alpha.2.osoe-638" />
<PackageReference Include="Lombiq.Privacy.Samples" Version="7.0.2-alpha.2.osoe-638" />
<PackageReference Include="Lombiq.SetupExtensions" Version="5.0.0" />
<PackageReference Include="Lombiq.Tests.UI.AppExtensions" Version="8.1.0-alpha.1.osoe-638" />
<PackageReference Include="Lombiq.Tests.UI.Shortcuts" Version="8.1.0-alpha.1.osoe-638" />
<PackageReference Include="Lombiq.Tests.UI.AppExtensions" Version="8.2.1-alpha.1.osoe-733" />
<PackageReference Include="Lombiq.Tests.UI.Shortcuts" Version="8.2.1-alpha.1.osoe-733" />
<PackageReference Include="Lombiq.UIKit" Version="6.0.1-alpha.0.osoe-638" />
<PackageReference Include="Lombiq.VueJs" Version="3.0.1-alpha.0.osoe-638" />
<PackageReference Include="Lombiq.VueJs.Samples" Version="3.0.1-alpha.0.osoe-638" />
Expand Down
18 changes: 6 additions & 12 deletions NuGetTest/src/Lombiq.OSOCE.NuGet.Web/Program.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using OrchardCore.Logging;
using System.Collections.Generic;
Expand All @@ -13,20 +12,15 @@

builder.Services
.AddSingleton(configuration)
.AddOrchardCms(orchardCoreBuilder =>
{
orchardCoreBuilder.AuthorizeApiRequestsIfEnabled(configuration);
orchardCoreBuilder.ConfigureFeaturesGuard(
.AddOrchardCms(orchardCoreBuilder => orchardCoreBuilder
.AddOrchardCoreApplicationInsightsTelemetry(configuration)
.AuthorizeApiRequestsIfEnabled(configuration)
.ConfigureFeaturesGuard(
new Dictionary<string, IEnumerable<string>>
{
["OrchardCore.Twitter"] = new[] { "Lombiq.UIKit", "Lombiq.ChartJs" },
});

if (!configuration.IsUITesting())
{
orchardCoreBuilder.AddSetupFeatures("OrchardCore.AutoSetup");
}
});
})
.EnableAutoSetupIfNotUITesting(configuration));

var app = builder.Build();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<PackageReference Include="Lombiq.ChartJs.Tests.UI" Version="6.0.2-alpha.0.osoe-638" />
<PackageReference Include="Lombiq.ContentEditors.Tests.UI" Version="2.0.1-alpha.0.osoe-638" />
<PackageReference Include="Lombiq.DataTables.Tests.UI" Version="7.0.2-alpha.0.osoe-638" />
<PackageReference Include="Lombiq.Hosting.Azure.ApplicationInsights.Tests.UI" Version="7.0.1-alpha.0.osoe-638" />
<PackageReference Include="Lombiq.Hosting.Azure.ApplicationInsights.Tests.UI" Version="7.0.2-alpha.1.osoe-733" />
<PackageReference Include="Lombiq.Hosting.BuildVersionDisplay.Tests.UI" Version="4.0.1-alpha.0.osoe-638" />
<PackageReference Include="Lombiq.Hosting.MediaTheme.Tests.UI" Version="5.0.1-alpha.0.osoe-638" />
<PackageReference Include="Lombiq.Hosting.Tenants.EnvironmentRobots.Tests.UI" Version="6.3.0-alpha.2.lmbq-249" />
Expand All @@ -34,7 +34,7 @@
<PackageReference Include="Lombiq.OrchardCoreApiClient.Tests.UI" Version="4.0.1-alpha.0.osoe-638" />
<PackageReference Include="Lombiq.Privacy.Tests.UI" Version="7.0.2-alpha.2.osoe-638" />
<PackageReference Include="Lombiq.HelpfulExtensions.Tests.UI" Version="7.0.2-alpha.2.osoe-683" />
<PackageReference Include="Lombiq.Tests.UI" Version="8.2.1-alpha.0.nest-462" />
<PackageReference Include="Lombiq.Tests.UI" Version="8.2.1-alpha.1.osoe-733" />
<PackageReference Include="Lombiq.VueJs.Tests.UI" Version="3.0.1-alpha.0.osoe-638" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.1">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using Lombiq.Tests.UI.Attributes;
using Lombiq.Tests.UI.Extensions;
using Lombiq.Tests.UI.Services;
using System.Threading.Tasks;
using Xunit;
using Xunit.Abstractions;
Expand All @@ -14,9 +12,8 @@ public BasicOrchardFeaturesTests(ITestOutputHelper testOutputHelper)
{
}

[Theory, Chrome]
public Task BasicOrchardFeaturesShouldWork(Browser browser) =>
[Fact]
public Task BasicOrchardFeaturesShouldWork() =>
ExecuteTestAsync(
context => context.TestBasicOrchardFeaturesExceptRegistrationAsync("Lombiq.OSOCE.NuGet.BasicOrchardFeaturesTests"),
browser);
context => context.TestBasicOrchardFeaturesExceptRegistrationAsync("Lombiq.OSOCE.NuGet.BasicOrchardFeaturesTests"));
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
using Lombiq.Tests.UI.Attributes;
using Lombiq.Tests.UI.Extensions;
using Lombiq.Tests.UI.Helpers;
using Lombiq.Tests.UI.Services;
using OpenQA.Selenium;
using Shouldly;
using System.Threading.Tasks;
Expand All @@ -17,8 +15,8 @@ public BehaviorFileUploadTests(ITestOutputHelper testOutputHelper)
{
}

[Theory, Chrome]
public Task SampleFilesShouldBeAccessible(Browser browser) =>
[Fact]
public Task SampleFilesShouldBeAccessible() =>
ExecuteTestAfterSetupAsync(
async context =>
{
Expand All @@ -29,6 +27,5 @@ public Task SampleFilesShouldBeAccessible(Browser browser) =>
context.Get(By.CssSelector(".message-error"))
.Text
.ShouldContain("Only zip or json files are supported.");
},
browser);
});
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using Lombiq.OrchardCoreApiClient.Tests.UI.Extensions;
using Lombiq.Tests.UI.Attributes;
using Lombiq.Tests.UI.Services;
using System.Threading.Tasks;
using Xunit;
using Xunit.Abstractions;
Expand All @@ -14,9 +12,7 @@ public BehaviorOrchardCoreApiClientTests(ITestOutputHelper testOutputHelper)
{
}

[Theory, Chrome]
public Task OrchardCoreApiClientShouldWork(Browser browser) =>
ExecuteTestAfterSetupAsync(
async context => await context.TestOrchardCoreApiClientBehaviorAsync(),
browser);
[Fact]
public Task OrchardCoreApiClientShouldWork() =>
ExecuteTestAfterSetupAsync(context => context.TestOrchardCoreApiClientBehaviorAsync());
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using Lombiq.Hosting.Azure.ApplicationInsights.Tests.UI.TestCases;
using Lombiq.Tests.UI.Attributes;
using Lombiq.Tests.UI.Services;
using System.Threading.Tasks;
using Xunit;
using Xunit.Abstractions;
Expand All @@ -14,7 +12,7 @@ public BehaviorApplicationInsightsTests(ITestOutputHelper testOutputHelper)
{
}

[Theory, Chrome]
public Task ApplicationInsightsTrackingInOfflineOperationShouldWork(Browser browser) =>
ApplicationInsightsTestCases.ApplicationInsightsTrackingInOfflineOperationShouldWorkAsync(ExecuteTestAfterSetupAsync, browser);
[Fact]
public Task ApplicationInsightsTrackingInOfflineOperationShouldWork() =>
ApplicationInsightsTestCases.ApplicationInsightsTrackingInOfflineOperationShouldWorkAsync(ExecuteTestAfterSetupAsync);
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
using Lombiq.ContentEditors.Tests.UI.Extensions;
using Lombiq.Tests.UI.Attributes;
using Lombiq.Tests.UI.Extensions;
using Lombiq.Tests.UI.Helpers;
using Lombiq.Tests.UI.Services;
using System.Threading.Tasks;
using Xunit;
using Xunit.Abstractions;
Expand All @@ -16,24 +14,22 @@ public BehaviorAsyncEditorTests(ITestOutputHelper testOutputHelper)
{
}

[Theory, Chrome]
public Task DemoContentItemAsyncEditorShouldWork(Browser browser) =>
[Fact]
public Task DemoContentItemAsyncEditorShouldWork() =>
ExecuteTestAfterSetupAsync(
async context =>
{
await context.SignInDirectlyAsync();
await context.TestDemoContentItemAsyncEditorAsync();
},
browser);
});

[Theory, Chrome]
public Task DemoFrontEndAsyncEditorShouldWork(Browser browser) =>
[Fact]
public Task DemoFrontEndAsyncEditorShouldWork() =>
ExecuteTestAfterSetupAsync(
async context =>
{
await context.SignInDirectlyAsync();
await context.TestDemoFrontEndAsyncEditorAsync();
},
browser,
ConfigurationHelper.DisableHtmlValidation);
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using Lombiq.ChartJs.Tests.UI.Extensions;
using Lombiq.Tests.UI.Attributes;
using Lombiq.Tests.UI.Services;
using System.Threading.Tasks;
using Xunit;
using Xunit.Abstractions;
Expand All @@ -14,9 +12,7 @@ public BehaviorChartJsTests(ITestOutputHelper testOutputHelper)
{
}

[Theory, Chrome]
public Task RecipeDataShouldBeDisplayedCorrectly(Browser browser) =>
ExecuteTestAfterSetupAsync(
context => context.TestChartJsSampleBehaviorAsync(),
browser);
[Fact]
public Task RecipeDataShouldBeDisplayedCorrectly() =>
ExecuteTestAfterSetupAsync(context => context.TestChartJsSampleBehaviorAsync());
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using Lombiq.DataTables.Tests.UI.Extensions;
using Lombiq.Tests.UI.Attributes;
using Lombiq.Tests.UI.Services;
using System.Threading.Tasks;
using Xunit;
using Xunit.Abstractions;
Expand All @@ -14,9 +12,6 @@ public BehaviorDataTableTests(ITestOutputHelper testOutputHelper)
{
}

[Theory, Chrome]
public Task DataTableShouldWork(Browser browser) =>
ExecuteTestAfterSetupAsync(
context => context.TestDataTableRecipeDataAsync(),
browser);
[Fact]
public Task DataTableShouldWork() => ExecuteTestAfterSetupAsync(context => context.TestDataTableRecipeDataAsync());
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using Lombiq.Hosting.Tenants.EmailQuotaManagement.Tests.UI.Extensions;
using Lombiq.Tests.UI.Attributes;
using Lombiq.Tests.UI.Services;
using Lombiq.Hosting.Tenants.EmailQuotaManagement.Tests.UI.Extensions;
using System.Threading.Tasks;
using Xunit;
using Xunit.Abstractions;
Expand All @@ -14,18 +12,16 @@ public BehaviorEmailQuotaTests(ITestOutputHelper testOutputHelper)
{
}

[Theory, Chrome]
public Task EmailQuotaShouldBlockEmailsOverLimitAndWarn(Browser browser) =>
[Fact]
public Task EmailQuotaShouldBlockEmailsOverLimitAndWarn() =>
ExecuteTestAfterSetupAsync(
context => context.TestEmailQuotaManagementBehaviorAsync(10),
browser,
configuration => configuration.SetEmailQuotaManagementOptionsForUITest(10));

[Theory, Chrome]
public Task EmailQuotaShouldNotBlockEmailsWhenDifferentHostIsUsedThanOriginalFromConfig(Browser browser) =>
[Fact]
public Task EmailQuotaShouldNotBlockEmailsWhenDifferentHostIsUsedThanOriginalFromConfig() =>
ExecuteTestAfterSetupAsync(
context => context.TestEmailQuotaManagementBehaviorAsync(1, moduleShouldInterfere: false),
browser,
// The default SMTP host is localhost during UI tests, we set it to 127.0.0.1 to be able to send emails,
// but the Email Quota module shouldn't interfere.
configuration => configuration.SetEmailQuotaManagementOptionsForUITest(1, "127.0.0.1"));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using Lombiq.Hosting.Tenants.EnvironmentRobots.Tests.UI.Extensions;
using Lombiq.Tests.UI.Attributes;
using Lombiq.Tests.UI.Services;
using System.Threading.Tasks;
using Xunit;
using Xunit.Abstractions;
Expand All @@ -14,23 +12,20 @@ public BehaviorEnvironmentRobotsTests(ITestOutputHelper testOutputHelper)
{
}

[Theory, Chrome]
public Task RobotsMetaTagShouldBeMissing(Browser browser) =>
[Fact]
public Task RobotsMetaTagShouldBeMissing() =>
ExecuteTestAfterSetupAsync(
async context => await context.TestRobotMetaTagIsMissingAsync(shouldBeMissing: true),
browser,
context => context.TestRobotMetaTagIsMissingAsync(shouldBeMissing: true),
configuration => configuration.SetEnvironmentRobotsOptionsConfiguration(isProduction: true));

[Theory, Chrome]
public Task RobotsMetaTagShouldBeMissingWithoutConfiguration(Browser browser) =>
[Fact]
public Task RobotsMetaTagShouldBeMissingWithoutConfiguration() =>
ExecuteTestAfterSetupAsync(
async context => await context.TestRobotMetaTagIsMissingAsync(shouldBeMissing: false),
browser);
context => context.TestRobotMetaTagIsMissingAsync(shouldBeMissing: false));

[Theory, Chrome]
public Task RobotsMetaTagShouldBePresent(Browser browser) =>
[Fact]
public Task RobotsMetaTagShouldBePresent() =>
ExecuteTestAfterSetupAsync(
async context => await context.TestRobotMetaTagIsMissingAsync(shouldBeMissing: false),
browser,
context => context.TestRobotMetaTagIsMissingAsync(shouldBeMissing: false),
configuration => configuration.SetEnvironmentRobotsOptionsConfiguration(isProduction: false));
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
using Lombiq.Hosting.Tenants.FeaturesGuard.Tests.UI.Extensions;
using Lombiq.OSOCE.NuGet.Tests.UI.Helpers;
using Lombiq.Tests.UI.Attributes;
using Lombiq.Tests.UI.Services;
using System.Threading.Tasks;
using Xunit;
using Xunit.Abstractions;
Expand All @@ -18,16 +16,18 @@ public BehaviorFeaturesGuardTests(ITestOutputHelper testOutputHelper)
// HTML validation is disabled as OC's login and dashboard pages contain several errors. See:
// https://github.com/OrchardCMS/OrchardCore/issues/12271
// https://github.com/OrchardCMS/OrchardCore/issues/12271
[Theory, Chrome]
public Task ForbiddenFeaturesShouldNotBeActivatableOnTenants(Browser browser) =>
ExecuteTestAfterSetupAsync(context => context.TestForbiddenFeaturesAsync(SetupHelpers.RecipeId), browser, configuration =>
configuration.HtmlValidationConfiguration.RunHtmlValidationAssertionOnAllPageChanges = false);
[Fact]
public Task ForbiddenFeaturesShouldNotBeActivatableOnTenants() =>
ExecuteTestAfterSetupAsync(
context => context.TestForbiddenFeaturesAsync(SetupHelpers.RecipeId),
configuration => configuration.HtmlValidationConfiguration.RunHtmlValidationAssertionOnAllPageChanges = false);

// HTML validation is disabled as OC's login and dashboard pages contain several errors. See:
// https://github.com/OrchardCMS/OrchardCore/issues/12271
// https://github.com/OrchardCMS/OrchardCore/issues/12271
[Theory, Chrome]
public Task ConditionallyEnabledFeaturesShouldWorkCorrectlyOnTenants(Browser browser) =>
ExecuteTestAfterSetupAsync(context => context.TestConditionallyEnabledFeaturesAsync(SetupHelpers.RecipeId), browser, configuration =>
configuration.HtmlValidationConfiguration.RunHtmlValidationAssertionOnAllPageChanges = false);
[Fact]
public Task ConditionallyEnabledFeaturesShouldWorkCorrectlyOnTenants() =>
ExecuteTestAfterSetupAsync(
context => context.TestConditionallyEnabledFeaturesAsync(SetupHelpers.RecipeId),
configuration => configuration.HtmlValidationConfiguration.RunHtmlValidationAssertionOnAllPageChanges = false);
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using Lombiq.HelpfulExtensions.Tests.UI.Extensions;
using Lombiq.Tests.UI.Attributes;
using Lombiq.Tests.UI.Services;
using System.Threading.Tasks;
using Xunit;
using Xunit.Abstractions;
Expand All @@ -14,21 +12,15 @@ public BehaviorHelpfulExtensionsTests(ITestOutputHelper testOutputHelper)
{
}

[Theory, Chrome]
public Task FeatureFlow(Browser browser) =>
ExecuteTestAfterSetupAsync(
context => context.TestFlowAdditionalStylingPartAsync(),
browser);
[Fact]
public Task FeatureFlow() =>
ExecuteTestAfterSetupAsync(context => context.TestFlowAdditionalStylingPartAsync());

[Theory, Chrome]
public Task FeatureWidgets(Browser browser) =>
ExecuteTestAfterSetupAsync(
context => context.TestFeatureWidgetsAsync(),
browser);
[Fact]
public Task FeatureWidgets() =>
ExecuteTestAfterSetupAsync(context => context.TestFeatureWidgetsAsync());

[Theory, Chrome]
public Task FeatureCodeGeneration(Browser browser) =>
ExecuteTestAfterSetupAsync(
context => context.TestFeatureCodeGenerationsAsync(),
browser);
[Fact]
public Task FeatureCodeGeneration() =>
ExecuteTestAfterSetupAsync(context => context.TestFeatureCodeGenerationsAsync());
}
Loading

0 comments on commit c867d64

Please sign in to comment.