From 1c753df4b2c13e6ae7cd9125f7e7550ad471de48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Fri, 11 Feb 2022 01:20:01 +0100 Subject: [PATCH 001/175] Add UI testing basics --- OrchardCore.sln | 7 ++++ src/OrchardCore.Build/Dependencies.props | 3 ++ .../OrchardCore.Cms.Web.csproj | 7 +++- src/OrchardCore.Cms.Web/Startup.cs | 12 +++++- .../Helpers/SetupHelpers.cs | 32 +++++++++++++++ .../OrchardCore.Tests.UI.csproj | 18 ++++++++ .../Tests/BasicOrchardFeaturesTests.cs | 29 +++++++++++++ test/OrchardCore.Tests.UI/UITestBase.cs | 41 +++++++++++++++++++ 8 files changed, 147 insertions(+), 2 deletions(-) create mode 100644 test/OrchardCore.Tests.UI/Helpers/SetupHelpers.cs create mode 100644 test/OrchardCore.Tests.UI/OrchardCore.Tests.UI.csproj create mode 100644 test/OrchardCore.Tests.UI/Tests/BasicOrchardFeaturesTests.cs create mode 100644 test/OrchardCore.Tests.UI/UITestBase.cs diff --git a/OrchardCore.sln b/OrchardCore.sln index a79e9ce6fb4..f7d7d74aacf 100644 --- a/OrchardCore.sln +++ b/OrchardCore.sln @@ -429,6 +429,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "OrchardCore.Themes", "Orcha src\OrchardCore.Themes\Directory.Build.targets = src\OrchardCore.Themes\Directory.Build.targets EndProjectSection EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OrchardCore.Tests.UI", "test\OrchardCore.Tests.UI\OrchardCore.Tests.UI.csproj", "{2FADB5D9-E229-4689-A040-12EEE1876285}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -1139,6 +1141,10 @@ Global {D00CF459-396D-49C9-92E2-3FD3C2A59847}.Debug|Any CPU.Build.0 = Debug|Any CPU {D00CF459-396D-49C9-92E2-3FD3C2A59847}.Release|Any CPU.ActiveCfg = Release|Any CPU {D00CF459-396D-49C9-92E2-3FD3C2A59847}.Release|Any CPU.Build.0 = Release|Any CPU + {2FADB5D9-E229-4689-A040-12EEE1876285}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2FADB5D9-E229-4689-A040-12EEE1876285}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2FADB5D9-E229-4689-A040-12EEE1876285}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2FADB5D9-E229-4689-A040-12EEE1876285}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -1337,6 +1343,7 @@ Global {2BC850C3-9846-47E1-9068-AC0A8E5537AC} = {184139CF-C4AB-4FBE-AE19-54C8B3FE5C5E} {85EF279B-8F35-476D-9BBD-F503F20712B5} = {184139CF-C4AB-4FBE-AE19-54C8B3FE5C5E} {21F459C1-494E-41C9-B221-6C102774A47F} = {184139CF-C4AB-4FBE-AE19-54C8B3FE5C5E} + {2FADB5D9-E229-4689-A040-12EEE1876285} = {B8D16C60-99B4-43D5-A3AD-4CD89AF39B25} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {46A1D25A-78D1-4476-9CBF-25B75E296341} diff --git a/src/OrchardCore.Build/Dependencies.props b/src/OrchardCore.Build/Dependencies.props index c897f7b7091..a2cf42bae9c 100644 --- a/src/OrchardCore.Build/Dependencies.props +++ b/src/OrchardCore.Build/Dependencies.props @@ -20,6 +20,9 @@ + + + diff --git a/src/OrchardCore.Cms.Web/OrchardCore.Cms.Web.csproj b/src/OrchardCore.Cms.Web/OrchardCore.Cms.Web.csproj index 02ee6cc6c4a..76aa49680ca 100644 --- a/src/OrchardCore.Cms.Web/OrchardCore.Cms.Web.csproj +++ b/src/OrchardCore.Cms.Web/OrchardCore.Cms.Web.csproj @@ -15,7 +15,7 @@ - + @@ -37,5 +37,10 @@ + + + + + diff --git a/src/OrchardCore.Cms.Web/Startup.cs b/src/OrchardCore.Cms.Web/Startup.cs index 964b1bd1b0d..59d9e728f07 100644 --- a/src/OrchardCore.Cms.Web/Startup.cs +++ b/src/OrchardCore.Cms.Web/Startup.cs @@ -1,4 +1,5 @@ using Microsoft.AspNetCore.Builder; +using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; @@ -6,9 +7,18 @@ namespace OrchardCore.Cms.Web { public class Startup { + private readonly IConfiguration _configuration; + + public Startup(IConfiguration configuration) + { + _configuration = configuration; + } + public void ConfigureServices(IServiceCollection services) { - services.AddOrchardCms().AddSetupFeatures("OrchardCore.AutoSetup"); + services.AddOrchardCms(builder => builder + .ConfigureUITesting(_configuration, enableShortcutsDuringUITesting: true) + .AddSetupFeatures("OrchardCore.AutoSetup")); } public void Configure(IApplicationBuilder app, IHostEnvironment env) diff --git a/test/OrchardCore.Tests.UI/Helpers/SetupHelpers.cs b/test/OrchardCore.Tests.UI/Helpers/SetupHelpers.cs new file mode 100644 index 00000000000..10ba86c5373 --- /dev/null +++ b/test/OrchardCore.Tests.UI/Helpers/SetupHelpers.cs @@ -0,0 +1,32 @@ +using System; +using System.Threading.Tasks; +using Lombiq.Tests.UI.Extensions; +using Lombiq.Tests.UI.Pages; +using Lombiq.Tests.UI.Services; +using OpenQA.Selenium; + +namespace OrchardCore.Tests.UI.Helpers +{ + public static class SetupHelpers + { + public const string RecipeId = "Blog"; + + public static async Task RunSetupAsync(UITestContext context) + { + var setupPage = await context.GoToSetupPageAsync(); + setupPage = await setupPage.SetupOrchardCoreAsync( + context, + new OrchardCoreSetupParameters(context) + { + SiteName = "Orchard Core - UI Testing", + RecipeId = RecipeId, + TablePrefix = "oc", + SiteTimeZoneValue = "America/New_York", + }); + + context.Exists(By.Id("navbar")); + + return setupPage.PageUri.Value; + } + } +} diff --git a/test/OrchardCore.Tests.UI/OrchardCore.Tests.UI.csproj b/test/OrchardCore.Tests.UI/OrchardCore.Tests.UI.csproj new file mode 100644 index 00000000000..d45645bd387 --- /dev/null +++ b/test/OrchardCore.Tests.UI/OrchardCore.Tests.UI.csproj @@ -0,0 +1,18 @@ + + + + + + $(CommonTargetFrameworks) + false + + + + + + + + + + + diff --git a/test/OrchardCore.Tests.UI/Tests/BasicOrchardFeaturesTests.cs b/test/OrchardCore.Tests.UI/Tests/BasicOrchardFeaturesTests.cs new file mode 100644 index 00000000000..3a0f064baa7 --- /dev/null +++ b/test/OrchardCore.Tests.UI/Tests/BasicOrchardFeaturesTests.cs @@ -0,0 +1,29 @@ +using Lombiq.Tests.UI.Attributes; +using Lombiq.Tests.UI.Extensions; +using Lombiq.Tests.UI.Pages; +using Lombiq.Tests.UI.Services; +using System.Threading.Tasks; +using Xunit; +using Xunit.Abstractions; + +namespace OrchardCore.Tests.UI.Tests +{ + public class BasicOrchardFeaturesTests : UITestBase + { + public BasicOrchardFeaturesTests(ITestOutputHelper testOutputHelper) + : base(testOutputHelper) + { + } + + [Theory, Chrome] + public Task BasicOrchardFeaturesShouldWork(Browser browser) => + ExecuteTestAsync( + context => context + .TestBasicOrchardFeaturesExceptRegistrationAsync( + new OrchardCoreSetupParameters(context) + { + RecipeId = "Lombiq.OSOCE.NuGet.BasicOrchardFeaturesTests", + }), + browser); + } +} diff --git a/test/OrchardCore.Tests.UI/UITestBase.cs b/test/OrchardCore.Tests.UI/UITestBase.cs new file mode 100644 index 00000000000..b805734ac53 --- /dev/null +++ b/test/OrchardCore.Tests.UI/UITestBase.cs @@ -0,0 +1,41 @@ +using System; +using System.Threading.Tasks; +using Lombiq.Tests.UI; +using Lombiq.Tests.UI.Helpers; +using Lombiq.Tests.UI.Services; +using OrchardCore.Tests.UI.Helpers; +using Xunit.Abstractions; + +namespace OrchardCore.Tests.UI +{ + public class UITestBase : OrchardCoreUITestBase + { + protected override string AppAssemblyPath => WebAppConfigHelper + .GetAbsoluteApplicationAssemblyPath("OrchardCore.Cms.Web", "net6.0"); + + protected UITestBase(ITestOutputHelper testOutputHelper) + : base(testOutputHelper) + { + } + + protected override Task ExecuteTestAfterSetupAsync( + Func testAsync, + Browser browser, + Func changeConfigurationAsync) => + ExecuteTestAsync(testAsync, browser, SetupHelpers.RunSetupAsync, changeConfigurationAsync); + + protected override Task ExecuteTestAsync( + Func testAsync, + Browser browser, + Func> setupOperation, + Func changeConfigurationAsync) => + base.ExecuteTestAsync( + testAsync, + browser, + setupOperation, + async configuration => + { + if (changeConfigurationAsync != null) await changeConfigurationAsync(configuration); + }); + } +} From e2f0900d67611776b71f55402041f0ae39f83fbf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Fri, 11 Feb 2022 14:08:58 +0100 Subject: [PATCH 002/175] Copy-paste error --- test/OrchardCore.Tests.UI/Tests/BasicOrchardFeaturesTests.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/OrchardCore.Tests.UI/Tests/BasicOrchardFeaturesTests.cs b/test/OrchardCore.Tests.UI/Tests/BasicOrchardFeaturesTests.cs index 3a0f064baa7..f9471fe4da1 100644 --- a/test/OrchardCore.Tests.UI/Tests/BasicOrchardFeaturesTests.cs +++ b/test/OrchardCore.Tests.UI/Tests/BasicOrchardFeaturesTests.cs @@ -1,8 +1,9 @@ +using System.Threading.Tasks; using Lombiq.Tests.UI.Attributes; using Lombiq.Tests.UI.Extensions; using Lombiq.Tests.UI.Pages; using Lombiq.Tests.UI.Services; -using System.Threading.Tasks; +using OrchardCore.Tests.UI.Helpers; using Xunit; using Xunit.Abstractions; @@ -22,7 +23,7 @@ public Task BasicOrchardFeaturesShouldWork(Browser browser) => .TestBasicOrchardFeaturesExceptRegistrationAsync( new OrchardCoreSetupParameters(context) { - RecipeId = "Lombiq.OSOCE.NuGet.BasicOrchardFeaturesTests", + RecipeId = SetupHelpers.RecipeId, }), browser); } From 224ad84de17baf6492d66a4f12b5343f311c1841 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Fri, 11 Feb 2022 14:26:40 +0100 Subject: [PATCH 003/175] Overriding xUnit config --- test/OrchardCore.Tests.UI/OrchardCore.Tests.UI.csproj | 7 +++++++ test/OrchardCore.Tests.UI/xunit.runner.json | 6 ++++++ 2 files changed, 13 insertions(+) create mode 100644 test/OrchardCore.Tests.UI/xunit.runner.json diff --git a/test/OrchardCore.Tests.UI/OrchardCore.Tests.UI.csproj b/test/OrchardCore.Tests.UI/OrchardCore.Tests.UI.csproj index d45645bd387..5bbcaed2d91 100644 --- a/test/OrchardCore.Tests.UI/OrchardCore.Tests.UI.csproj +++ b/test/OrchardCore.Tests.UI/OrchardCore.Tests.UI.csproj @@ -7,6 +7,13 @@ false + + + + PreserveNewest + + + diff --git a/test/OrchardCore.Tests.UI/xunit.runner.json b/test/OrchardCore.Tests.UI/xunit.runner.json new file mode 100644 index 00000000000..100b12679c4 --- /dev/null +++ b/test/OrchardCore.Tests.UI/xunit.runner.json @@ -0,0 +1,6 @@ +{ + "$schema": "https://xunit.net/schema/current/xunit.runner.schema.json", + "parallelizeAssembly": false, + "parallelizeTestCollections": true, + "maxParallelThreads": 0 +} From 7e6353c2d83a6d9e230e49c37efaa1a3c39c3b4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Fri, 11 Feb 2022 14:30:12 +0100 Subject: [PATCH 004/175] Suppresssing VSTHRD200 for UI testing --- test/OrchardCore.Tests.UI/GlobalSuppressions.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 test/OrchardCore.Tests.UI/GlobalSuppressions.cs diff --git a/test/OrchardCore.Tests.UI/GlobalSuppressions.cs b/test/OrchardCore.Tests.UI/GlobalSuppressions.cs new file mode 100644 index 00000000000..9bea8313dad --- /dev/null +++ b/test/OrchardCore.Tests.UI/GlobalSuppressions.cs @@ -0,0 +1,11 @@ +// This file is used by Code Analysis to maintain SuppressMessage attributes that are applied to this project. +// Project-level suppressions either have no target or are given a specific target and scoped to a namespace, type, +// member, etc. + +using System.Diagnostics.CodeAnalysis; + +[assembly: SuppressMessage( + "Style", + "VSTHRD200:Use \"Async\" suffix for async methods", + Justification = "Test methods shouldn't be suffixed with \"Async\".", + Scope = "module")] From 22f2acb35537edcf9b5c474272a5623e73b8a7a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Mon, 14 Feb 2022 01:57:53 +0100 Subject: [PATCH 005/175] Updating to latest UI Testing Toolbox --- src/OrchardCore.Build/Dependencies.props | 6 +++--- test/OrchardCore.Tests.UI/Helpers/SetupHelpers.cs | 6 ++---- .../Tests/BasicOrchardFeaturesTests.cs | 8 +------- 3 files changed, 6 insertions(+), 14 deletions(-) diff --git a/src/OrchardCore.Build/Dependencies.props b/src/OrchardCore.Build/Dependencies.props index db28927ff7b..7d67ced554e 100644 --- a/src/OrchardCore.Build/Dependencies.props +++ b/src/OrchardCore.Build/Dependencies.props @@ -20,9 +20,9 @@ - - - + + + diff --git a/test/OrchardCore.Tests.UI/Helpers/SetupHelpers.cs b/test/OrchardCore.Tests.UI/Helpers/SetupHelpers.cs index 10ba86c5373..2cd07729679 100644 --- a/test/OrchardCore.Tests.UI/Helpers/SetupHelpers.cs +++ b/test/OrchardCore.Tests.UI/Helpers/SetupHelpers.cs @@ -13,9 +13,7 @@ public static class SetupHelpers public static async Task RunSetupAsync(UITestContext context) { - var setupPage = await context.GoToSetupPageAsync(); - setupPage = await setupPage.SetupOrchardCoreAsync( - context, + var homepageUri = await context.GoToSetupPageAndSetupOrchardCoreAsync( new OrchardCoreSetupParameters(context) { SiteName = "Orchard Core - UI Testing", @@ -26,7 +24,7 @@ public static async Task RunSetupAsync(UITestContext context) context.Exists(By.Id("navbar")); - return setupPage.PageUri.Value; + return homepageUri; } } } diff --git a/test/OrchardCore.Tests.UI/Tests/BasicOrchardFeaturesTests.cs b/test/OrchardCore.Tests.UI/Tests/BasicOrchardFeaturesTests.cs index f9471fe4da1..3bf73b3637c 100644 --- a/test/OrchardCore.Tests.UI/Tests/BasicOrchardFeaturesTests.cs +++ b/test/OrchardCore.Tests.UI/Tests/BasicOrchardFeaturesTests.cs @@ -1,7 +1,6 @@ using System.Threading.Tasks; using Lombiq.Tests.UI.Attributes; using Lombiq.Tests.UI.Extensions; -using Lombiq.Tests.UI.Pages; using Lombiq.Tests.UI.Services; using OrchardCore.Tests.UI.Helpers; using Xunit; @@ -19,12 +18,7 @@ public BasicOrchardFeaturesTests(ITestOutputHelper testOutputHelper) [Theory, Chrome] public Task BasicOrchardFeaturesShouldWork(Browser browser) => ExecuteTestAsync( - context => context - .TestBasicOrchardFeaturesExceptRegistrationAsync( - new OrchardCoreSetupParameters(context) - { - RecipeId = SetupHelpers.RecipeId, - }), + context => context.TestBasicOrchardFeaturesExceptRegistrationAsync(SetupHelpers.RecipeId), browser); } } From 62663cb8e9ba5f9cb22453010a366c783f907021 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Wed, 16 Feb 2022 00:32:44 +0100 Subject: [PATCH 006/175] Updating Lombiq.Tests.UI dependencies --- src/OrchardCore.Build/Dependencies.props | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/OrchardCore.Build/Dependencies.props b/src/OrchardCore.Build/Dependencies.props index 7d67ced554e..8ae45798203 100644 --- a/src/OrchardCore.Build/Dependencies.props +++ b/src/OrchardCore.Build/Dependencies.props @@ -20,9 +20,9 @@ - - - + + + From 6842a5bbb88a38d3da794bee39e909791cc96d1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Wed, 16 Feb 2022 01:05:11 +0100 Subject: [PATCH 007/175] Adding UI testing to PR pipeline --- .github/workflows/pr_ci.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pr_ci.yml b/.github/workflows/pr_ci.yml index a1b527e31a5..169b4466b3d 100644 --- a/.github/workflows/pr_ci.yml +++ b/.github/workflows/pr_ci.yml @@ -47,4 +47,13 @@ jobs: path: | test/OrchardCore.Tests.Functional/cms-tests/cypress/screenshots src/OrchardCore.Cms.Web/App_Data/logs - + - name: UI Tests + if: matrix.os == 'windows-latest' + run: | + dotnet test -c Release --no-restore --no-build ./test/OrchardCore.Tests.UI/OrchardCore.Tests.UI.csproj + - uses: actions/upload-artifact@v2 + if: matrix.os == 'windows-latest' && failure() + with: + name: functional-test-failure + path: | + test/OrchardCore.Tests.UI/bin/Release/net6.0/FailureDumps From 6b4b0441d5501126ea659db67abbd594c0fcf13b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Wed, 16 Feb 2022 01:05:27 +0100 Subject: [PATCH 008/175] Intentionally failing UI test to check artifact collection --- .../Tests/BasicOrchardFeaturesTests.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/OrchardCore.Tests.UI/Tests/BasicOrchardFeaturesTests.cs b/test/OrchardCore.Tests.UI/Tests/BasicOrchardFeaturesTests.cs index 3bf73b3637c..768f5cf119d 100644 --- a/test/OrchardCore.Tests.UI/Tests/BasicOrchardFeaturesTests.cs +++ b/test/OrchardCore.Tests.UI/Tests/BasicOrchardFeaturesTests.cs @@ -2,6 +2,7 @@ using Lombiq.Tests.UI.Attributes; using Lombiq.Tests.UI.Extensions; using Lombiq.Tests.UI.Services; +using OpenQA.Selenium; using OrchardCore.Tests.UI.Helpers; using Xunit; using Xunit.Abstractions; @@ -20,5 +21,11 @@ public Task BasicOrchardFeaturesShouldWork(Browser browser) => ExecuteTestAsync( context => context.TestBasicOrchardFeaturesExceptRegistrationAsync(SetupHelpers.RecipeId), browser); + + [Theory, Chrome] + public Task IntentionallyFailingTest(Browser browser) => + ExecuteTestAfterSetupAsync( + context => context.Exists(By.Id("navbarasdfds")), + browser); } } From 79562ff3f609a359aa93a8a87d378771a68da031 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Wed, 16 Feb 2022 01:18:18 +0100 Subject: [PATCH 009/175] Updating Lombiq.Tests.UI dependencies --- src/OrchardCore.Build/Dependencies.props | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/OrchardCore.Build/Dependencies.props b/src/OrchardCore.Build/Dependencies.props index 8ae45798203..1ce751e974a 100644 --- a/src/OrchardCore.Build/Dependencies.props +++ b/src/OrchardCore.Build/Dependencies.props @@ -20,9 +20,9 @@ - - - + + + From 580ae14049012eba8f7b10cf20e3f972c80ce016 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Wed, 16 Feb 2022 02:11:41 +0100 Subject: [PATCH 010/175] Suppressing VSTHRD200 in OrchardCore.Tests for now --- test/OrchardCore.Tests/GlobalSuppressions.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 test/OrchardCore.Tests/GlobalSuppressions.cs diff --git a/test/OrchardCore.Tests/GlobalSuppressions.cs b/test/OrchardCore.Tests/GlobalSuppressions.cs new file mode 100644 index 00000000000..9bea8313dad --- /dev/null +++ b/test/OrchardCore.Tests/GlobalSuppressions.cs @@ -0,0 +1,11 @@ +// This file is used by Code Analysis to maintain SuppressMessage attributes that are applied to this project. +// Project-level suppressions either have no target or are given a specific target and scoped to a namespace, type, +// member, etc. + +using System.Diagnostics.CodeAnalysis; + +[assembly: SuppressMessage( + "Style", + "VSTHRD200:Use \"Async\" suffix for async methods", + Justification = "Test methods shouldn't be suffixed with \"Async\".", + Scope = "module")] From 8c04eab78483ca92e281e4c1263bf262f7079f1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Wed, 16 Feb 2022 02:12:06 +0100 Subject: [PATCH 011/175] Fixing async issues in OrchardCore.Tests --- .../Commands/CommandHandlerTests.cs | 60 +++++++++---------- .../Commands/CommandManagerTests.cs | 9 +-- .../Localization/CultureScopeTests.cs | 5 +- .../OrchardCore.Media/MediaEventTests.cs | 10 +++- .../Workflows/Activities/WriteLineTask.cs | 2 +- 5 files changed, 47 insertions(+), 39 deletions(-) diff --git a/test/OrchardCore.Tests/Commands/CommandHandlerTests.cs b/test/OrchardCore.Tests/Commands/CommandHandlerTests.cs index ef54716401f..d71c2c39938 100644 --- a/test/OrchardCore.Tests/Commands/CommandHandlerTests.cs +++ b/test/OrchardCore.Tests/Commands/CommandHandlerTests.cs @@ -48,28 +48,28 @@ private CommandContext CreateCommandContext(string commandName, IDictionary(() => + await Assert.ThrowsAsync(async () => { var commandContext = CreateCommandContext("NoSuchCommand"); - _handler.ExecuteAsync(commandContext); + await _handler.ExecuteAsync(commandContext); }); } [Fact] - public void TestCommandWithCustomAlias() + public async Task TestCommandWithCustomAlias() { var commandContext = CreateCommandContext("Bar"); - _handler.ExecuteAsync(commandContext); + await _handler.ExecuteAsync(commandContext); Assert.Equal("Hello World!", commandContext.Output.ToString()); } @@ -88,34 +88,34 @@ public void TestEmptyHelpText() } [Fact] - public void TestCaseInsensitiveForCommand() + public async Task TestCaseInsensitiveForCommand() { var commandContext = CreateCommandContext("BAZ", new Dictionary { { "VERBOSE", "true" } }); - _handler.ExecuteAsync(commandContext); + await _handler.ExecuteAsync(commandContext); Assert.Equal("Command Baz Called : This was a test", commandContext.Output.ToString()); } [Fact] - public void TestBooleanSwitchForCommand() + public async Task TestBooleanSwitchForCommand() { var commandContext = CreateCommandContext("Baz", new Dictionary { { "Verbose", "true" } }); - _handler.ExecuteAsync(commandContext); + await _handler.ExecuteAsync(commandContext); Assert.Equal("Command Baz Called : This was a test", commandContext.Output.ToString()); } [Fact] - public void TestIntSwitchForCommand() + public async Task TestIntSwitchForCommand() { var commandContext = CreateCommandContext("Baz", new Dictionary { { "Level", "2" } }); - _handler.ExecuteAsync(commandContext); + await _handler.ExecuteAsync(commandContext); Assert.Equal("Command Baz Called : Entering Level 2", commandContext.Output.ToString()); } [Fact] - public void TestStringSwitchForCommand() + public async Task TestStringSwitchForCommand() { var commandContext = CreateCommandContext("Baz", new Dictionary { { "User", "OrchardUser" } }); - _handler.ExecuteAsync(commandContext); + await _handler.ExecuteAsync(commandContext); Assert.Equal("Command Baz Called : current user is OrchardUser", commandContext.Output.ToString()); } @@ -124,14 +124,14 @@ public async Task TestSwitchForCommandWithoutSupportForIt() { var switches = new Dictionary { { "User", "OrchardUser" } }; var commandContext = CreateCommandContext("Foo", switches); - await Assert.ThrowsAsync(() => _handler.ExecuteAsync(commandContext)); + await Assert.ThrowsAsync(async () => await _handler.ExecuteAsync(commandContext)); } [Fact] - public void TestCommandThatDoesNotReturnAValue() + public async Task TestCommandThatDoesNotReturnAValue() { var commandContext = CreateCommandContext("Log"); - _handler.ExecuteAsync(commandContext); + await _handler.ExecuteAsync(commandContext); Assert.Empty(commandContext.Output.ToString()); } @@ -140,40 +140,40 @@ public async Task TestNotExistingSwitch() { var switches = new Dictionary { { "ThisSwitchDoesNotExist", "Insignificant" } }; var commandContext = CreateCommandContext("Foo", switches); - await Assert.ThrowsAsync(() => _handler.ExecuteAsync(commandContext)); + await Assert.ThrowsAsync(async () => await _handler.ExecuteAsync(commandContext)); } [Fact] - public void TestCommandArgumentsArePassedCorrectly() + public async Task TestCommandArgumentsArePassedCorrectly() { var commandContext = CreateCommandContext("Concat", new Dictionary(), new[] { "left to ", "right" }); - _handler.ExecuteAsync(commandContext); + await _handler.ExecuteAsync(commandContext); Assert.Equal("left to right", commandContext.Output.ToString()); } [Fact] - public void TestCommandArgumentsArePassedCorrectlyWithAParamsParameters() + public async Task TestCommandArgumentsArePassedCorrectlyWithAParamsParameters() { var commandContext = CreateCommandContext("ConcatParams", new Dictionary(), new[] { "left to ", "right" }); - _handler.ExecuteAsync(commandContext); + await _handler.ExecuteAsync(commandContext); Assert.Equal("left to right", commandContext.Output.ToString()); } [Fact] - public void TestCommandArgumentsArePassedCorrectlyWithAParamsParameterAndNoArguments() + public async Task TestCommandArgumentsArePassedCorrectlyWithAParamsParameterAndNoArguments() { var commandContext = CreateCommandContext("ConcatParams", new Dictionary()); - _handler.ExecuteAsync(commandContext); + await _handler.ExecuteAsync(commandContext); Assert.Empty(commandContext.Output.ToString()); } [Fact] - public void TestCommandArgumentsArePassedCorrectlyWithNormalParametersAndAParamsParameters() + public async Task TestCommandArgumentsArePassedCorrectlyWithNormalParametersAndAParamsParameters() { var commandContext = CreateCommandContext("ConcatAllParams", new Dictionary(), new[] { "left-", "center-", "right" }); - _handler.ExecuteAsync(commandContext); + await _handler.ExecuteAsync(commandContext); Assert.Equal("left-center-right", commandContext.Output.ToString()); } @@ -181,21 +181,21 @@ public void TestCommandArgumentsArePassedCorrectlyWithNormalParametersAndAParams public async Task TestCommandParamsMismatchWithoutParamsNotEnoughArguments() { var commandContext = CreateCommandContext("Concat", new Dictionary(), new[] { "left to " }); - await Assert.ThrowsAsync(() => _handler.ExecuteAsync(commandContext)); + await Assert.ThrowsAsync(async () => await _handler.ExecuteAsync(commandContext)); } [Fact] public async Task TestCommandParamsMismatchWithoutParamsTooManyArguments() { var commandContext = CreateCommandContext("Foo", new Dictionary(), new[] { "left to " }); - await Assert.ThrowsAsync(() => _handler.ExecuteAsync(commandContext)); + await Assert.ThrowsAsync(async () => await _handler.ExecuteAsync(commandContext)); } [Fact] public async Task TestCommandParamsMismatchWithParamsButNotEnoughArguments() { var commandContext = CreateCommandContext("ConcatAllParams", new Dictionary()); - await Assert.ThrowsAsync(() => _handler.ExecuteAsync(commandContext)); + await Assert.ThrowsAsync(async () => await _handler.ExecuteAsync(commandContext)); } } diff --git a/test/OrchardCore.Tests/Commands/CommandManagerTests.cs b/test/OrchardCore.Tests/Commands/CommandManagerTests.cs index 5cef71b57f6..1d2d3f853e7 100644 --- a/test/OrchardCore.Tests/Commands/CommandManagerTests.cs +++ b/test/OrchardCore.Tests/Commands/CommandManagerTests.cs @@ -1,4 +1,5 @@ using System.IO; +using System.Threading.Tasks; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Localization; using OrchardCore.Environment.Commands; @@ -24,18 +25,18 @@ public CommandManagerTests() } [Fact] - public void ManagerCanRunACommand() + public async Task ManagerCanRunACommand() { var context = new CommandParameters { Arguments = new string[] { "FooBar" }, Output = new StringWriter() }; - _manager.ExecuteAsync(context); + await _manager.ExecuteAsync(context); Assert.Equal("success!", context.Output.ToString()); } [Fact] - public void ManagerCanRunACompositeCommand() + public async Task ManagerCanRunACompositeCommand() { var context = new CommandParameters { Arguments = ("Foo Bar Bleah").Split(' '), Output = new StringWriter() }; - _manager.ExecuteAsync(context); + await _manager.ExecuteAsync(context); Assert.Equal("Bleah", context.Output.ToString()); } diff --git a/test/OrchardCore.Tests/Localization/CultureScopeTests.cs b/test/OrchardCore.Tests/Localization/CultureScopeTests.cs index 71ff7641162..36844ed8432 100644 --- a/test/OrchardCore.Tests/Localization/CultureScopeTests.cs +++ b/test/OrchardCore.Tests/Localization/CultureScopeTests.cs @@ -1,5 +1,6 @@ using System; using System.Globalization; +using System.Threading.Tasks; using OrchardCore.Localization; using Xunit; @@ -57,14 +58,14 @@ public void CultureScopeRetrievesTheOrginalCulturesAfterScopeEnded() } [Fact] - public void CultureScopeRetrievesTheOrginalCulturesIfExceptionOccurs() + public async Task CultureScopeRetrievesTheOrginalCulturesIfExceptionOccurs() { // Arrange var culture = CultureInfo.CurrentCulture; var uiCulture = CultureInfo.CurrentUICulture; // Act & Assert - Assert.ThrowsAsync(() => + await Assert.ThrowsAsync(() => { using (var cultureScope = CultureScope.Create("FR")) { diff --git a/test/OrchardCore.Tests/Modules/OrchardCore.Media/MediaEventTests.cs b/test/OrchardCore.Tests/Modules/OrchardCore.Media/MediaEventTests.cs index 7b325c8bb37..bbeaac19247 100644 --- a/test/OrchardCore.Tests/Modules/OrchardCore.Media/MediaEventTests.cs +++ b/test/OrchardCore.Tests/Modules/OrchardCore.Media/MediaEventTests.cs @@ -55,12 +55,18 @@ public async Task DisposesMediaCreatingStreams() finally { // This disposes the final outputStream. - outputStream?.Dispose(); + if (outputStream != null) + { + await outputStream.DisposeAsync(); + } } } finally { - inputStream?.Dispose(); + if (inputStream != null) + { + await inputStream.DisposeAsync(); + } } foreach (var stream in streams) diff --git a/test/OrchardCore.Tests/Workflows/Activities/WriteLineTask.cs b/test/OrchardCore.Tests/Workflows/Activities/WriteLineTask.cs index 6c3e353b599..a2ad51a4f4c 100644 --- a/test/OrchardCore.Tests/Workflows/Activities/WriteLineTask.cs +++ b/test/OrchardCore.Tests/Workflows/Activities/WriteLineTask.cs @@ -42,7 +42,7 @@ public override IEnumerable GetPossibleOutcomes(WorkflowExecutionContex public override async Task ExecuteAsync(WorkflowExecutionContext workflowContext, ActivityContext activityContext) { var text = await _scriptEvaluator.EvaluateAsync(Text, workflowContext); - _output.WriteLine(text); + await _output.WriteLineAsync(text); return Outcomes("Done"); } } From c0c823fa848ed1752b3397b88887d35df68ba74b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Wed, 16 Feb 2022 02:27:33 +0100 Subject: [PATCH 012/175] Temporarily removing failing unit test --- test/OrchardCore.Tests/Commands/CommandHandlerTests.cs | 8 -------- 1 file changed, 8 deletions(-) diff --git a/test/OrchardCore.Tests/Commands/CommandHandlerTests.cs b/test/OrchardCore.Tests/Commands/CommandHandlerTests.cs index d71c2c39938..370ea7f8853 100644 --- a/test/OrchardCore.Tests/Commands/CommandHandlerTests.cs +++ b/test/OrchardCore.Tests/Commands/CommandHandlerTests.cs @@ -159,14 +159,6 @@ public async Task TestCommandArgumentsArePassedCorrectlyWithAParamsParameters() Assert.Equal("left to right", commandContext.Output.ToString()); } - [Fact] - public async Task TestCommandArgumentsArePassedCorrectlyWithAParamsParameterAndNoArguments() - { - var commandContext = CreateCommandContext("ConcatParams", new Dictionary()); - await _handler.ExecuteAsync(commandContext); - Assert.Empty(commandContext.Output.ToString()); - } - [Fact] public async Task TestCommandArgumentsArePassedCorrectlyWithNormalParametersAndAParamsParameters() { From b09fdb11d23a126c3ad34bf0614cf0d3d7f55663 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Wed, 16 Feb 2022 02:42:51 +0100 Subject: [PATCH 013/175] Fixing UI test artifact name --- .github/workflows/pr_ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr_ci.yml b/.github/workflows/pr_ci.yml index 169b4466b3d..d3db351ab6b 100644 --- a/.github/workflows/pr_ci.yml +++ b/.github/workflows/pr_ci.yml @@ -54,6 +54,6 @@ jobs: - uses: actions/upload-artifact@v2 if: matrix.os == 'windows-latest' && failure() with: - name: functional-test-failure + name: ui-test-failure path: | test/OrchardCore.Tests.UI/bin/Release/net6.0/FailureDumps From 203511457444d4ce73278e523ee4f3fa3ae80c5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Wed, 16 Feb 2022 02:43:42 +0100 Subject: [PATCH 014/175] Deactivating intentionally failing test --- test/OrchardCore.Tests.UI/Tests/BasicOrchardFeaturesTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/OrchardCore.Tests.UI/Tests/BasicOrchardFeaturesTests.cs b/test/OrchardCore.Tests.UI/Tests/BasicOrchardFeaturesTests.cs index 768f5cf119d..43a2433c801 100644 --- a/test/OrchardCore.Tests.UI/Tests/BasicOrchardFeaturesTests.cs +++ b/test/OrchardCore.Tests.UI/Tests/BasicOrchardFeaturesTests.cs @@ -22,7 +22,7 @@ public Task BasicOrchardFeaturesShouldWork(Browser browser) => context => context.TestBasicOrchardFeaturesExceptRegistrationAsync(SetupHelpers.RecipeId), browser); - [Theory, Chrome] + [Theory(Skip = "Used to test artifact creation during build."), Chrome] public Task IntentionallyFailingTest(Browser browser) => ExecuteTestAfterSetupAsync( context => context.Exists(By.Id("navbarasdfds")), From 9da0d19a5541a33649c5a6d52d96d07692fc09a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Wed, 16 Feb 2022 02:44:50 +0100 Subject: [PATCH 015/175] Adding UI testing step to the other workflows too --- .github/workflows/preview_ci.yml | 10 ++++++++++ .github/workflows/release_ci.yml | 10 ++++++++++ 2 files changed, 20 insertions(+) diff --git a/.github/workflows/preview_ci.yml b/.github/workflows/preview_ci.yml index 50842c91ca2..c1a8b580d57 100644 --- a/.github/workflows/preview_ci.yml +++ b/.github/workflows/preview_ci.yml @@ -50,6 +50,16 @@ jobs: path: | test/OrchardCore.Tests.Functional/cms-tests/cypress/screenshots src/OrchardCore.Cms.Web/App_Data_Tests/logs + - name: UI Tests + if: matrix.os == 'windows-latest' + run: | + dotnet test -c Release --no-restore --no-build ./test/OrchardCore.Tests.UI/OrchardCore.Tests.UI.csproj + - uses: actions/upload-artifact@v2 + if: matrix.os == 'windows-latest' && failure() + with: + name: ui-test-failure + path: | + test/OrchardCore.Tests.UI/bin/Release/net6.0/FailureDumps - name: Deploy preview nuget packages if: matrix.os == 'ubuntu-latest' run: | diff --git a/.github/workflows/release_ci.yml b/.github/workflows/release_ci.yml index c8821c27777..2c8f6c29986 100644 --- a/.github/workflows/release_ci.yml +++ b/.github/workflows/release_ci.yml @@ -61,6 +61,16 @@ jobs: path: | test/OrchardCore.Tests.Functional/cms-tests/cypress/screenshots src/OrchardCore.Cms.Web/App_Data_Tests/logs + - name: UI Tests + if: matrix.os == 'windows-latest' + run: | + dotnet test -c Release --no-restore --no-build ./test/OrchardCore.Tests.UI/OrchardCore.Tests.UI.csproj + - uses: actions/upload-artifact@v2 + if: matrix.os == 'windows-latest' && failure() + with: + name: ui-test-failure + path: | + test/OrchardCore.Tests.UI/bin/Release/net6.0/FailureDumps - name: Deploy release NuGet packages if: matrix.os == 'ubuntu-latest' run: | From 37f4a00e4d36e29a37d29d1e324f4fb52038b30d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Wed, 16 Feb 2022 02:53:58 +0100 Subject: [PATCH 016/175] Fixing TestCommandArgumentsArePassedCorrectlyWithAParamsParameterAndNoArguments --- .../Commands/DefaultCommandHandler.cs | 8 +++++++- test/OrchardCore.Tests/Commands/CommandHandlerTests.cs | 8 ++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/OrchardCore/OrchardCore.Infrastructure.Abstractions/Commands/DefaultCommandHandler.cs b/src/OrchardCore/OrchardCore.Infrastructure.Abstractions/Commands/DefaultCommandHandler.cs index 194c30e9024..7705607e513 100644 --- a/src/OrchardCore/OrchardCore.Infrastructure.Abstractions/Commands/DefaultCommandHandler.cs +++ b/src/OrchardCore/OrchardCore.Infrastructure.Abstractions/Commands/DefaultCommandHandler.cs @@ -145,7 +145,13 @@ private static object[] GetInvokeParametersForMethod(MethodInfo methodInfo, ILis } } - if (methodHasParams && (methodParameters.Length - args.Count == 1)) invokeParameters.Add(new string[] { }); + var lastParameterIsParams = + methodParameters.Last().GetCustomAttributes(typeof(ParamArrayAttribute), false).Length > 0; + + if (methodHasParams && (methodParameters.Length - args.Count == 1) && !lastParameterIsParams) + { + invokeParameters.Add(new string[] { }); + } return invokeParameters.ToArray(); } diff --git a/test/OrchardCore.Tests/Commands/CommandHandlerTests.cs b/test/OrchardCore.Tests/Commands/CommandHandlerTests.cs index 370ea7f8853..d71c2c39938 100644 --- a/test/OrchardCore.Tests/Commands/CommandHandlerTests.cs +++ b/test/OrchardCore.Tests/Commands/CommandHandlerTests.cs @@ -159,6 +159,14 @@ public async Task TestCommandArgumentsArePassedCorrectlyWithAParamsParameters() Assert.Equal("left to right", commandContext.Output.ToString()); } + [Fact] + public async Task TestCommandArgumentsArePassedCorrectlyWithAParamsParameterAndNoArguments() + { + var commandContext = CreateCommandContext("ConcatParams", new Dictionary()); + await _handler.ExecuteAsync(commandContext); + Assert.Empty(commandContext.Output.ToString()); + } + [Fact] public async Task TestCommandArgumentsArePassedCorrectlyWithNormalParametersAndAParamsParameters() { From 86f944449affaf26bc9b74a191e85c3c80be98d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Wed, 16 Feb 2022 03:46:01 +0100 Subject: [PATCH 017/175] Updating Lombiq.Tests.UI to latest, thus fixing that Microsoft.VisualStudio.Threading.Analyzers mistakenly being applied --- src/OrchardCore.Build/Dependencies.props | 6 +++--- test/OrchardCore.Tests.UI/GlobalSuppressions.cs | 11 ----------- test/OrchardCore.Tests/GlobalSuppressions.cs | 11 ----------- 3 files changed, 3 insertions(+), 25 deletions(-) delete mode 100644 test/OrchardCore.Tests.UI/GlobalSuppressions.cs delete mode 100644 test/OrchardCore.Tests/GlobalSuppressions.cs diff --git a/src/OrchardCore.Build/Dependencies.props b/src/OrchardCore.Build/Dependencies.props index 1ce751e974a..0233132c6c5 100644 --- a/src/OrchardCore.Build/Dependencies.props +++ b/src/OrchardCore.Build/Dependencies.props @@ -20,9 +20,9 @@ - - - + + + diff --git a/test/OrchardCore.Tests.UI/GlobalSuppressions.cs b/test/OrchardCore.Tests.UI/GlobalSuppressions.cs deleted file mode 100644 index 9bea8313dad..00000000000 --- a/test/OrchardCore.Tests.UI/GlobalSuppressions.cs +++ /dev/null @@ -1,11 +0,0 @@ -// This file is used by Code Analysis to maintain SuppressMessage attributes that are applied to this project. -// Project-level suppressions either have no target or are given a specific target and scoped to a namespace, type, -// member, etc. - -using System.Diagnostics.CodeAnalysis; - -[assembly: SuppressMessage( - "Style", - "VSTHRD200:Use \"Async\" suffix for async methods", - Justification = "Test methods shouldn't be suffixed with \"Async\".", - Scope = "module")] diff --git a/test/OrchardCore.Tests/GlobalSuppressions.cs b/test/OrchardCore.Tests/GlobalSuppressions.cs deleted file mode 100644 index 9bea8313dad..00000000000 --- a/test/OrchardCore.Tests/GlobalSuppressions.cs +++ /dev/null @@ -1,11 +0,0 @@ -// This file is used by Code Analysis to maintain SuppressMessage attributes that are applied to this project. -// Project-level suppressions either have no target or are given a specific target and scoped to a namespace, type, -// member, etc. - -using System.Diagnostics.CodeAnalysis; - -[assembly: SuppressMessage( - "Style", - "VSTHRD200:Use \"Async\" suffix for async methods", - Justification = "Test methods shouldn't be suffixed with \"Async\".", - Scope = "module")] From f2bfaa6a21f25d07428e9dc712b9d85e28a01b60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Wed, 16 Feb 2022 16:22:35 +0100 Subject: [PATCH 018/175] Reverting OrchardCore.Tests changes (will add to a separate PR) --- .../Commands/DefaultCommandHandler.cs | 8 +-- .../Commands/CommandHandlerTests.cs | 60 +++++++++---------- .../Commands/CommandManagerTests.cs | 9 ++- .../Localization/CultureScopeTests.cs | 5 +- .../OrchardCore.Media/MediaEventTests.cs | 10 +--- .../Workflows/Activities/WriteLineTask.cs | 2 +- 6 files changed, 40 insertions(+), 54 deletions(-) diff --git a/src/OrchardCore/OrchardCore.Infrastructure.Abstractions/Commands/DefaultCommandHandler.cs b/src/OrchardCore/OrchardCore.Infrastructure.Abstractions/Commands/DefaultCommandHandler.cs index 7705607e513..194c30e9024 100644 --- a/src/OrchardCore/OrchardCore.Infrastructure.Abstractions/Commands/DefaultCommandHandler.cs +++ b/src/OrchardCore/OrchardCore.Infrastructure.Abstractions/Commands/DefaultCommandHandler.cs @@ -145,13 +145,7 @@ private static object[] GetInvokeParametersForMethod(MethodInfo methodInfo, ILis } } - var lastParameterIsParams = - methodParameters.Last().GetCustomAttributes(typeof(ParamArrayAttribute), false).Length > 0; - - if (methodHasParams && (methodParameters.Length - args.Count == 1) && !lastParameterIsParams) - { - invokeParameters.Add(new string[] { }); - } + if (methodHasParams && (methodParameters.Length - args.Count == 1)) invokeParameters.Add(new string[] { }); return invokeParameters.ToArray(); } diff --git a/test/OrchardCore.Tests/Commands/CommandHandlerTests.cs b/test/OrchardCore.Tests/Commands/CommandHandlerTests.cs index d71c2c39938..ef54716401f 100644 --- a/test/OrchardCore.Tests/Commands/CommandHandlerTests.cs +++ b/test/OrchardCore.Tests/Commands/CommandHandlerTests.cs @@ -48,28 +48,28 @@ private CommandContext CreateCommandContext(string commandName, IDictionary(async () => + Assert.Throws(() => { var commandContext = CreateCommandContext("NoSuchCommand"); - await _handler.ExecuteAsync(commandContext); + _handler.ExecuteAsync(commandContext); }); } [Fact] - public async Task TestCommandWithCustomAlias() + public void TestCommandWithCustomAlias() { var commandContext = CreateCommandContext("Bar"); - await _handler.ExecuteAsync(commandContext); + _handler.ExecuteAsync(commandContext); Assert.Equal("Hello World!", commandContext.Output.ToString()); } @@ -88,34 +88,34 @@ public void TestEmptyHelpText() } [Fact] - public async Task TestCaseInsensitiveForCommand() + public void TestCaseInsensitiveForCommand() { var commandContext = CreateCommandContext("BAZ", new Dictionary { { "VERBOSE", "true" } }); - await _handler.ExecuteAsync(commandContext); + _handler.ExecuteAsync(commandContext); Assert.Equal("Command Baz Called : This was a test", commandContext.Output.ToString()); } [Fact] - public async Task TestBooleanSwitchForCommand() + public void TestBooleanSwitchForCommand() { var commandContext = CreateCommandContext("Baz", new Dictionary { { "Verbose", "true" } }); - await _handler.ExecuteAsync(commandContext); + _handler.ExecuteAsync(commandContext); Assert.Equal("Command Baz Called : This was a test", commandContext.Output.ToString()); } [Fact] - public async Task TestIntSwitchForCommand() + public void TestIntSwitchForCommand() { var commandContext = CreateCommandContext("Baz", new Dictionary { { "Level", "2" } }); - await _handler.ExecuteAsync(commandContext); + _handler.ExecuteAsync(commandContext); Assert.Equal("Command Baz Called : Entering Level 2", commandContext.Output.ToString()); } [Fact] - public async Task TestStringSwitchForCommand() + public void TestStringSwitchForCommand() { var commandContext = CreateCommandContext("Baz", new Dictionary { { "User", "OrchardUser" } }); - await _handler.ExecuteAsync(commandContext); + _handler.ExecuteAsync(commandContext); Assert.Equal("Command Baz Called : current user is OrchardUser", commandContext.Output.ToString()); } @@ -124,14 +124,14 @@ public async Task TestSwitchForCommandWithoutSupportForIt() { var switches = new Dictionary { { "User", "OrchardUser" } }; var commandContext = CreateCommandContext("Foo", switches); - await Assert.ThrowsAsync(async () => await _handler.ExecuteAsync(commandContext)); + await Assert.ThrowsAsync(() => _handler.ExecuteAsync(commandContext)); } [Fact] - public async Task TestCommandThatDoesNotReturnAValue() + public void TestCommandThatDoesNotReturnAValue() { var commandContext = CreateCommandContext("Log"); - await _handler.ExecuteAsync(commandContext); + _handler.ExecuteAsync(commandContext); Assert.Empty(commandContext.Output.ToString()); } @@ -140,40 +140,40 @@ public async Task TestNotExistingSwitch() { var switches = new Dictionary { { "ThisSwitchDoesNotExist", "Insignificant" } }; var commandContext = CreateCommandContext("Foo", switches); - await Assert.ThrowsAsync(async () => await _handler.ExecuteAsync(commandContext)); + await Assert.ThrowsAsync(() => _handler.ExecuteAsync(commandContext)); } [Fact] - public async Task TestCommandArgumentsArePassedCorrectly() + public void TestCommandArgumentsArePassedCorrectly() { var commandContext = CreateCommandContext("Concat", new Dictionary(), new[] { "left to ", "right" }); - await _handler.ExecuteAsync(commandContext); + _handler.ExecuteAsync(commandContext); Assert.Equal("left to right", commandContext.Output.ToString()); } [Fact] - public async Task TestCommandArgumentsArePassedCorrectlyWithAParamsParameters() + public void TestCommandArgumentsArePassedCorrectlyWithAParamsParameters() { var commandContext = CreateCommandContext("ConcatParams", new Dictionary(), new[] { "left to ", "right" }); - await _handler.ExecuteAsync(commandContext); + _handler.ExecuteAsync(commandContext); Assert.Equal("left to right", commandContext.Output.ToString()); } [Fact] - public async Task TestCommandArgumentsArePassedCorrectlyWithAParamsParameterAndNoArguments() + public void TestCommandArgumentsArePassedCorrectlyWithAParamsParameterAndNoArguments() { var commandContext = CreateCommandContext("ConcatParams", new Dictionary()); - await _handler.ExecuteAsync(commandContext); + _handler.ExecuteAsync(commandContext); Assert.Empty(commandContext.Output.ToString()); } [Fact] - public async Task TestCommandArgumentsArePassedCorrectlyWithNormalParametersAndAParamsParameters() + public void TestCommandArgumentsArePassedCorrectlyWithNormalParametersAndAParamsParameters() { var commandContext = CreateCommandContext("ConcatAllParams", new Dictionary(), new[] { "left-", "center-", "right" }); - await _handler.ExecuteAsync(commandContext); + _handler.ExecuteAsync(commandContext); Assert.Equal("left-center-right", commandContext.Output.ToString()); } @@ -181,21 +181,21 @@ public async Task TestCommandArgumentsArePassedCorrectlyWithNormalParametersAndA public async Task TestCommandParamsMismatchWithoutParamsNotEnoughArguments() { var commandContext = CreateCommandContext("Concat", new Dictionary(), new[] { "left to " }); - await Assert.ThrowsAsync(async () => await _handler.ExecuteAsync(commandContext)); + await Assert.ThrowsAsync(() => _handler.ExecuteAsync(commandContext)); } [Fact] public async Task TestCommandParamsMismatchWithoutParamsTooManyArguments() { var commandContext = CreateCommandContext("Foo", new Dictionary(), new[] { "left to " }); - await Assert.ThrowsAsync(async () => await _handler.ExecuteAsync(commandContext)); + await Assert.ThrowsAsync(() => _handler.ExecuteAsync(commandContext)); } [Fact] public async Task TestCommandParamsMismatchWithParamsButNotEnoughArguments() { var commandContext = CreateCommandContext("ConcatAllParams", new Dictionary()); - await Assert.ThrowsAsync(async () => await _handler.ExecuteAsync(commandContext)); + await Assert.ThrowsAsync(() => _handler.ExecuteAsync(commandContext)); } } diff --git a/test/OrchardCore.Tests/Commands/CommandManagerTests.cs b/test/OrchardCore.Tests/Commands/CommandManagerTests.cs index 1d2d3f853e7..5cef71b57f6 100644 --- a/test/OrchardCore.Tests/Commands/CommandManagerTests.cs +++ b/test/OrchardCore.Tests/Commands/CommandManagerTests.cs @@ -1,5 +1,4 @@ using System.IO; -using System.Threading.Tasks; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Localization; using OrchardCore.Environment.Commands; @@ -25,18 +24,18 @@ public CommandManagerTests() } [Fact] - public async Task ManagerCanRunACommand() + public void ManagerCanRunACommand() { var context = new CommandParameters { Arguments = new string[] { "FooBar" }, Output = new StringWriter() }; - await _manager.ExecuteAsync(context); + _manager.ExecuteAsync(context); Assert.Equal("success!", context.Output.ToString()); } [Fact] - public async Task ManagerCanRunACompositeCommand() + public void ManagerCanRunACompositeCommand() { var context = new CommandParameters { Arguments = ("Foo Bar Bleah").Split(' '), Output = new StringWriter() }; - await _manager.ExecuteAsync(context); + _manager.ExecuteAsync(context); Assert.Equal("Bleah", context.Output.ToString()); } diff --git a/test/OrchardCore.Tests/Localization/CultureScopeTests.cs b/test/OrchardCore.Tests/Localization/CultureScopeTests.cs index 36844ed8432..71ff7641162 100644 --- a/test/OrchardCore.Tests/Localization/CultureScopeTests.cs +++ b/test/OrchardCore.Tests/Localization/CultureScopeTests.cs @@ -1,6 +1,5 @@ using System; using System.Globalization; -using System.Threading.Tasks; using OrchardCore.Localization; using Xunit; @@ -58,14 +57,14 @@ public void CultureScopeRetrievesTheOrginalCulturesAfterScopeEnded() } [Fact] - public async Task CultureScopeRetrievesTheOrginalCulturesIfExceptionOccurs() + public void CultureScopeRetrievesTheOrginalCulturesIfExceptionOccurs() { // Arrange var culture = CultureInfo.CurrentCulture; var uiCulture = CultureInfo.CurrentUICulture; // Act & Assert - await Assert.ThrowsAsync(() => + Assert.ThrowsAsync(() => { using (var cultureScope = CultureScope.Create("FR")) { diff --git a/test/OrchardCore.Tests/Modules/OrchardCore.Media/MediaEventTests.cs b/test/OrchardCore.Tests/Modules/OrchardCore.Media/MediaEventTests.cs index bbeaac19247..7b325c8bb37 100644 --- a/test/OrchardCore.Tests/Modules/OrchardCore.Media/MediaEventTests.cs +++ b/test/OrchardCore.Tests/Modules/OrchardCore.Media/MediaEventTests.cs @@ -55,18 +55,12 @@ public async Task DisposesMediaCreatingStreams() finally { // This disposes the final outputStream. - if (outputStream != null) - { - await outputStream.DisposeAsync(); - } + outputStream?.Dispose(); } } finally { - if (inputStream != null) - { - await inputStream.DisposeAsync(); - } + inputStream?.Dispose(); } foreach (var stream in streams) diff --git a/test/OrchardCore.Tests/Workflows/Activities/WriteLineTask.cs b/test/OrchardCore.Tests/Workflows/Activities/WriteLineTask.cs index a2ad51a4f4c..6c3e353b599 100644 --- a/test/OrchardCore.Tests/Workflows/Activities/WriteLineTask.cs +++ b/test/OrchardCore.Tests/Workflows/Activities/WriteLineTask.cs @@ -42,7 +42,7 @@ public override IEnumerable GetPossibleOutcomes(WorkflowExecutionContex public override async Task ExecuteAsync(WorkflowExecutionContext workflowContext, ActivityContext activityContext) { var text = await _scriptEvaluator.EvaluateAsync(Text, workflowContext); - await _output.WriteLineAsync(text); + _output.WriteLine(text); return Outcomes("Done"); } } From 569a7f83773cf877cbc13fc1f1c7e6f88ce3774a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Thu, 17 Feb 2022 21:00:08 +0100 Subject: [PATCH 019/175] Fixing Blob recipe accessibility issues --- .../TheBlogTheme/Recipes/Snippets/footer.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/OrchardCore.Themes/TheBlogTheme/Recipes/Snippets/footer.html b/src/OrchardCore.Themes/TheBlogTheme/Recipes/Snippets/footer.html index e62908b413a..3ff6cea2c27 100644 --- a/src/OrchardCore.Themes/TheBlogTheme/Recipes/Snippets/footer.html +++ b/src/OrchardCore.Themes/TheBlogTheme/Recipes/Snippets/footer.html @@ -4,7 +4,7 @@
- - - + + +
Privacy Policy From 0a799069c9ed0da44d704e572cb34e75392b9590 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Mon, 17 Oct 2022 23:08:47 +0200 Subject: [PATCH 054/175] Removing unneeded Blog recipe modification --- .../TheBlogTheme/Recipes/blog.recipe.json | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/OrchardCore.Themes/TheBlogTheme/Recipes/blog.recipe.json b/src/OrchardCore.Themes/TheBlogTheme/Recipes/blog.recipe.json index 1017ea9e021..48def3f7091 100644 --- a/src/OrchardCore.Themes/TheBlogTheme/Recipes/blog.recipe.json +++ b/src/OrchardCore.Themes/TheBlogTheme/Recipes/blog.recipe.json @@ -60,7 +60,6 @@ "OrchardCore.Indexing", "OrchardCore.Layers", "OrchardCore.Lists", - "OrchardCore.Localization", "OrchardCore.Markdown", "OrchardCore.Media", "OrchardCore.Menu", @@ -95,12 +94,6 @@ }, "LayerSettings": { "Zones": [ "Content", "Footer" ] - }, - "LocalizationSettings": { - "DefaultCulture": "en-US", - "SupportedCultures": [ - "en-US" - ] } }, { From d56c708098f283f6462bdf299179c331d666585b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Mon, 17 Oct 2022 23:58:15 +0200 Subject: [PATCH 055/175] Fixing more Agency accessibility issues --- .../TheAgencyTheme/Recipes/Snippets/landingpage.liquid | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/OrchardCore.Themes/TheAgencyTheme/Recipes/Snippets/landingpage.liquid b/src/OrchardCore.Themes/TheAgencyTheme/Recipes/Snippets/landingpage.liquid index eca0a8227a0..52d7ddc96fd 100644 --- a/src/OrchardCore.Themes/TheAgencyTheme/Recipes/Snippets/landingpage.liquid +++ b/src/OrchardCore.Themes/TheAgencyTheme/Recipes/Snippets/landingpage.liquid @@ -118,17 +118,17 @@

{{ member.DisplayText }}

{{ member.TeamMember.Occupation.Text }}

{% if member.TeamMember.Twitter.Text.size > 0 %} - + {% endif %} {% if member.TeamMember.Facebook.Text.size > 0 %} - + {% endif %} {% if member.TeamMember.LinkedIn.Text.size > 0 %} - + {% endif %} @@ -152,8 +152,8 @@
{% for client in Model.ContentItem.Content.Clients.ContentItems %} {% endfor %} From f4ca49dbf523ee3932f506362181ed604e6adffb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Mon, 17 Oct 2022 23:58:27 +0200 Subject: [PATCH 056/175] Wrong link label --- .../TheAgencyTheme/Recipes/Snippets/footer.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/OrchardCore.Themes/TheAgencyTheme/Recipes/Snippets/footer.html b/src/OrchardCore.Themes/TheAgencyTheme/Recipes/Snippets/footer.html index 84d1a430e8b..cdcc360fd00 100644 --- a/src/OrchardCore.Themes/TheAgencyTheme/Recipes/Snippets/footer.html +++ b/src/OrchardCore.Themes/TheAgencyTheme/Recipes/Snippets/footer.html @@ -12,7 +12,7 @@
- +
Privacy Policy From 7aebfcbe8dbe5670589cb0c33dd7e3996e1304a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Mon, 17 Oct 2022 23:59:19 +0200 Subject: [PATCH 057/175] Basic Orchard features tests for all themes with test recipes --- test/OrchardCore.Tests.UI/.htmlvalidate.json | 18 +++++ .../Helpers/SetupHelpers.cs | 2 +- .../OrchardCore.Tests.UI.csproj | 20 +++++ .../Recipes/Agency.Tests.recipe.json | 26 +++++++ .../Recipes/Blog.Tests.recipe.json | 28 +------ .../Recipes/ComingSoon.Tests.recipe.json | 26 +++++++ .../Recipes/Configuration.Tests.recipe.json | 49 ++++++++++++ .../Recipes/SaaS.Tests.recipe.json | 26 +++++++ .../OrchardCore.Tests.UI/Tests/AgencyTests.cs | 74 +++++++++++++++++++ ...icOrchardFeaturesTests.cs => BlogTests.cs} | 6 +- .../Tests/ComingSoonTests.cs | 44 +++++++++++ test/OrchardCore.Tests.UI/Tests/SaaSTests.cs | 43 +++++++++++ 12 files changed, 334 insertions(+), 28 deletions(-) create mode 100644 test/OrchardCore.Tests.UI/.htmlvalidate.json create mode 100644 test/OrchardCore.Tests.UI/Recipes/Agency.Tests.recipe.json create mode 100644 test/OrchardCore.Tests.UI/Recipes/ComingSoon.Tests.recipe.json create mode 100644 test/OrchardCore.Tests.UI/Recipes/Configuration.Tests.recipe.json create mode 100644 test/OrchardCore.Tests.UI/Recipes/SaaS.Tests.recipe.json create mode 100644 test/OrchardCore.Tests.UI/Tests/AgencyTests.cs rename test/OrchardCore.Tests.UI/Tests/{BasicOrchardFeaturesTests.cs => BlogTests.cs} (86%) create mode 100644 test/OrchardCore.Tests.UI/Tests/ComingSoonTests.cs create mode 100644 test/OrchardCore.Tests.UI/Tests/SaaSTests.cs diff --git a/test/OrchardCore.Tests.UI/.htmlvalidate.json b/test/OrchardCore.Tests.UI/.htmlvalidate.json new file mode 100644 index 00000000000..0db6e7d1eac --- /dev/null +++ b/test/OrchardCore.Tests.UI/.htmlvalidate.json @@ -0,0 +1,18 @@ +{ + "extends": [ + "html-validate:recommended" + ], + + "rules": { + "attribute-boolean-style": "off", + "no-autoplay": "off", + "no-trailing-whitespace": "off", + "no-inline-style": "off", + "wcag/h30": "off", + "wcag/h32": "off", + "wcag/h36": "off", + "wcag/h37": "off", + "wcag/h67": "off", + "wcag/h71": "off" + } +} diff --git a/test/OrchardCore.Tests.UI/Helpers/SetupHelpers.cs b/test/OrchardCore.Tests.UI/Helpers/SetupHelpers.cs index 2cd07729679..1231fef25eb 100644 --- a/test/OrchardCore.Tests.UI/Helpers/SetupHelpers.cs +++ b/test/OrchardCore.Tests.UI/Helpers/SetupHelpers.cs @@ -9,7 +9,7 @@ namespace OrchardCore.Tests.UI.Helpers { public static class SetupHelpers { - public const string RecipeId = "Blog"; + public const string RecipeId = "Blog.Tests"; public static async Task RunSetupAsync(UITestContext context) { diff --git a/test/OrchardCore.Tests.UI/OrchardCore.Tests.UI.csproj b/test/OrchardCore.Tests.UI/OrchardCore.Tests.UI.csproj index 0d02037d7ac..c5782b9b8bd 100644 --- a/test/OrchardCore.Tests.UI/OrchardCore.Tests.UI.csproj +++ b/test/OrchardCore.Tests.UI/OrchardCore.Tests.UI.csproj @@ -8,8 +8,28 @@ + + + + + + + Always + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + PreserveNewest diff --git a/test/OrchardCore.Tests.UI/Recipes/Agency.Tests.recipe.json b/test/OrchardCore.Tests.UI/Recipes/Agency.Tests.recipe.json new file mode 100644 index 00000000000..db238840008 --- /dev/null +++ b/test/OrchardCore.Tests.UI/Recipes/Agency.Tests.recipe.json @@ -0,0 +1,26 @@ +{ + "name": "Agency.Tests", + "displayName": "Agency Tests", + "description": "Setup recipe for automated UI test execution using the Agency recipe.", + "author": "The Orchard Core Team", + "website": "https://orchardcore.net", + "version": "1.0.0", + "issetuprecipe": true, + "categories": [ "test" ], + "tags": [ "agency", "test" ], + "steps": [ + { + "name": "recipes", + "Values": [ + { + "executionid": "OrchardCore.Tests.UI", + "name": "Agency" + }, + { + "executionid": "OrchardCore.Tests.UI", + "name": "Configuration.Tests" + } + ] + } + ] +} diff --git a/test/OrchardCore.Tests.UI/Recipes/Blog.Tests.recipe.json b/test/OrchardCore.Tests.UI/Recipes/Blog.Tests.recipe.json index 5526aed194f..b0a607bd144 100644 --- a/test/OrchardCore.Tests.UI/Recipes/Blog.Tests.recipe.json +++ b/test/OrchardCore.Tests.UI/Recipes/Blog.Tests.recipe.json @@ -15,32 +15,12 @@ { "executionid": "OrchardCore.Tests.UI", "name": "Blog" + }, + { + "executionid": "OrchardCore.Tests.UI", + "name": "Configuration.Tests" } ] - }, - { - "name": "feature", - "enable": [ - "OrchardCore.Users.Registration" - ] - }, - { - "name": "settings", - "UseCdn": false, - "SmtpSettings": { - "DefaultSender": "sender@example.com" - }, - "LocalizationSettings": { - "DefaultCulture": "en-US", - "SupportedCultures": [ - "en-US" - ] - }, - "RegistrationSettings": { - "UsersCanRegister": 1, - "UsersMustValidateEmail": false, - "UsersAreModerated": false - } } ] } diff --git a/test/OrchardCore.Tests.UI/Recipes/ComingSoon.Tests.recipe.json b/test/OrchardCore.Tests.UI/Recipes/ComingSoon.Tests.recipe.json new file mode 100644 index 00000000000..68293c15e5a --- /dev/null +++ b/test/OrchardCore.Tests.UI/Recipes/ComingSoon.Tests.recipe.json @@ -0,0 +1,26 @@ +{ + "name": "ComingSoon.Tests", + "displayName": "Coming Soon Tests", + "description": "Setup recipe for automated UI test execution using the Coming Soon recipe.", + "author": "The Orchard Core Team", + "website": "https://orchardcore.net", + "version": "1.0.0", + "issetuprecipe": true, + "categories": [ "test" ], + "tags": [ "comingsoon", "test" ], + "steps": [ + { + "name": "recipes", + "Values": [ + { + "executionid": "OrchardCore.Tests.UI", + "name": "ComingSoon" + }, + { + "executionid": "OrchardCore.Tests.UI", + "name": "Configuration.Tests" + } + ] + } + ] +} diff --git a/test/OrchardCore.Tests.UI/Recipes/Configuration.Tests.recipe.json b/test/OrchardCore.Tests.UI/Recipes/Configuration.Tests.recipe.json new file mode 100644 index 00000000000..fef4eeb97a5 --- /dev/null +++ b/test/OrchardCore.Tests.UI/Recipes/Configuration.Tests.recipe.json @@ -0,0 +1,49 @@ +{ + "name": "Configuration.Tests", + "displayName": "Configuration Tests", + "description": "Common configuration necessary for UI tests.", + "author": "The Orchard Core Team", + "website": "https://orchardcore.net", + "version": "1.0.0", + "issetuprecipe": false, + "categories": [ "test" ], + "tags": [ "blog", "test" ], + "steps": [ + { + "name": "feature", + "enable": [ + "OrchardCore.Users.Registration" + ] + }, + { + "name": "settings", + "UseCdn": false, + "SmtpSettings": { + "DefaultSender": "sender@example.com" + }, + "LocalizationSettings": { + "DefaultCulture": "en-US", + "SupportedCultures": [ + "en-US" + ] + }, + "RegistrationSettings": { + "UsersCanRegister": 1, + "UsersMustValidateEmail": false, + "UsersAreModerated": false + } + }, + { + "name": "Roles", + "Roles": [ + { + "Name": "Anonymous", + "Description": "Anonymous role", + "Permissions": [ + "ViewContent" + ] + } + ] + } + ] +} diff --git a/test/OrchardCore.Tests.UI/Recipes/SaaS.Tests.recipe.json b/test/OrchardCore.Tests.UI/Recipes/SaaS.Tests.recipe.json new file mode 100644 index 00000000000..4ca20a1753d --- /dev/null +++ b/test/OrchardCore.Tests.UI/Recipes/SaaS.Tests.recipe.json @@ -0,0 +1,26 @@ +{ + "name": "SaaS.Tests", + "displayName": "SaaS Tests", + "description": "Setup recipe for automated UI test execution using the SaaS recipe.", + "author": "The Orchard Core Team", + "website": "https://orchardcore.net", + "version": "1.0.0", + "issetuprecipe": true, + "categories": [ "test" ], + "tags": [ "developer", "test" ], + "steps": [ + { + "name": "recipes", + "Values": [ + { + "executionid": "OrchardCore.Tests.UI", + "name": "SaaS" + }, + { + "executionid": "OrchardCore.Tests.UI", + "name": "Configuration.Tests" + } + ] + } + ] +} diff --git a/test/OrchardCore.Tests.UI/Tests/AgencyTests.cs b/test/OrchardCore.Tests.UI/Tests/AgencyTests.cs new file mode 100644 index 00000000000..6159c27424c --- /dev/null +++ b/test/OrchardCore.Tests.UI/Tests/AgencyTests.cs @@ -0,0 +1,74 @@ +using System.Threading.Tasks; +using Atata; +using Lombiq.Tests.UI.Attributes; +using Lombiq.Tests.UI.Extensions; +using Lombiq.Tests.UI.Pages; +using Lombiq.Tests.UI.Services; +using OpenQA.Selenium; +using Xunit; +using Xunit.Abstractions; + +namespace OrchardCore.Tests.UI.Tests +{ + public class AgencyTests : UITestBase + { + public AgencyTests(ITestOutputHelper testOutputHelper) + : base(testOutputHelper) + { + } + + [Theory, Chrome] + public Task BasicOrchardFeaturesShouldWorkWithAgency(Browser browser) => + ExecuteTestAsync( + async context => + { + await context.TestSetupWithInvalidAndValidDataAsync(new OrchardCoreSetupParameters(context) + { + RecipeId = "Agency.Tests", + }); + + await context.TestRegistrationWithInvalidDataAsync(); + await context.TestRegistrationAsync(); + await context.TestRegistrationWithAlreadyRegisteredEmailAsync(); + await context.TestLoginWithInvalidDataAsync(); + await context.TestLoginAsync(); + + // This is similar to BasicOrchardFeaturesTestingUITestContextExtensions.TestContentOperationsAsync(), + // but the original method can only check page titles that are inside an

HTML tag. Here the page + // title is inside a
HTML tag. + var pageTitle = "Test page"; + + var contentItemsPage = await context.GoToContentItemsPageAsync(); + context.RefreshCurrentAtataContext(); + contentItemsPage + .CreateNewPage() + .Title.Set(pageTitle) + .Publish.ClickAndGo() + .AlertMessages.Should.Contain(message => message.IsSuccess) + .Items[item => item.Title == pageTitle].View.Click(); + + var page = new OrdinaryPage(pageTitle); + context.Scope.AtataContext.Go.ToNextWindow(page) + .AggregateAssert(page => page + .PageTitle.Should.Contain(pageTitle)); + + context.Driver.Exists(By.XPath($"//div[contains(text(), '" + pageTitle + "')]").Visible()); + + page.CloseWindow(); + + await context.TestTurningFeatureOnAndOffAsync(); + await context.TestLogoutAsync(); + }, + browser, + configuration => + { + configuration.AccessibilityCheckingConfiguration.RunAccessibilityCheckingAssertionOnAllPageChanges = true; + configuration.AccessibilityCheckingConfiguration.AxeBuilderConfigurator += axeBuilder => + AccessibilityCheckingConfiguration + .ConfigureWcag21aa(axeBuilder) + .DisableRules("color-contrast"); + + return Task.CompletedTask; + }); + } +} diff --git a/test/OrchardCore.Tests.UI/Tests/BasicOrchardFeaturesTests.cs b/test/OrchardCore.Tests.UI/Tests/BlogTests.cs similarity index 86% rename from test/OrchardCore.Tests.UI/Tests/BasicOrchardFeaturesTests.cs rename to test/OrchardCore.Tests.UI/Tests/BlogTests.cs index 07ae57a4af4..025c8dbd616 100644 --- a/test/OrchardCore.Tests.UI/Tests/BasicOrchardFeaturesTests.cs +++ b/test/OrchardCore.Tests.UI/Tests/BlogTests.cs @@ -8,15 +8,15 @@ namespace OrchardCore.Tests.UI.Tests { - public class BasicOrchardFeaturesTests : UITestBase + public class BlogTests : UITestBase { - public BasicOrchardFeaturesTests(ITestOutputHelper testOutputHelper) + public BlogTests(ITestOutputHelper testOutputHelper) : base(testOutputHelper) { } [Theory, Chrome] - public Task BasicOrchardFeaturesShouldWork(Browser browser) => + public Task BasicOrchardFeaturesShouldWorkWithBlog(Browser browser) => ExecuteTestAsync( context => context.TestBasicOrchardFeaturesAsync("Blog.Tests"), browser, diff --git a/test/OrchardCore.Tests.UI/Tests/ComingSoonTests.cs b/test/OrchardCore.Tests.UI/Tests/ComingSoonTests.cs new file mode 100644 index 00000000000..cb43fadd166 --- /dev/null +++ b/test/OrchardCore.Tests.UI/Tests/ComingSoonTests.cs @@ -0,0 +1,44 @@ +using System.Threading.Tasks; +using Lombiq.Tests.UI.Attributes; +using Lombiq.Tests.UI.Extensions; +using Lombiq.Tests.UI.Pages; +using Lombiq.Tests.UI.Services; +using Xunit; +using Xunit.Abstractions; + +namespace OrchardCore.Tests.UI.Tests +{ + public class ComingSoonTests : UITestBase + { + public ComingSoonTests(ITestOutputHelper testOutputHelper) + : base(testOutputHelper) + { + } + + [Theory, Chrome] + public Task BasicOrchardFeaturesShouldWorkWithComingSoon(Browser browser) => + ExecuteTestAsync( + async context => + { + await context.TestSetupWithInvalidAndValidDataAsync(new OrchardCoreSetupParameters(context) + { + RecipeId = "ComingSoon.Tests", + }); + + await context.TestRegistrationWithInvalidDataAsync(); + await context.TestRegistrationAsync(); + await context.TestRegistrationWithAlreadyRegisteredEmailAsync(); + await context.TestLoginWithInvalidDataAsync(); + await context.TestLoginAsync(); + await context.TestTurningFeatureOnAndOffAsync(); + await context.TestLogoutAsync(); + }, + browser, + configuration => + { + // Axe crashes the WebDriver on the second page load for some reason. + configuration.AccessibilityCheckingConfiguration.RunAccessibilityCheckingAssertionOnAllPageChanges = false; + return Task.CompletedTask; + }); + } +} diff --git a/test/OrchardCore.Tests.UI/Tests/SaaSTests.cs b/test/OrchardCore.Tests.UI/Tests/SaaSTests.cs new file mode 100644 index 00000000000..1a03e90852c --- /dev/null +++ b/test/OrchardCore.Tests.UI/Tests/SaaSTests.cs @@ -0,0 +1,43 @@ +using System.Threading.Tasks; +using Lombiq.Tests.UI.Attributes; +using Lombiq.Tests.UI.Extensions; +using Lombiq.Tests.UI.Pages; +using Lombiq.Tests.UI.Services; +using Xunit; +using Xunit.Abstractions; + +namespace OrchardCore.Tests.UI.Tests +{ + public class SaaSTests : UITestBase + { + public SaaSTests(ITestOutputHelper testOutputHelper) + : base(testOutputHelper) + { + } + + [Theory, Chrome] + public Task BasicOrchardFeaturesShouldWorkWithSaaS(Browser browser) => + ExecuteTestAsync( + async context => + { + await context.TestSetupWithInvalidAndValidDataAsync(new OrchardCoreSetupParameters(context) + { + RecipeId = "SaaS.Tests", + }); + + await context.TestRegistrationWithInvalidDataAsync(); + await context.TestRegistrationAsync(); + await context.TestRegistrationWithAlreadyRegisteredEmailAsync(); + await context.TestLoginWithInvalidDataAsync(); + await context.TestLoginAsync(); + await context.TestTurningFeatureOnAndOffAsync(); + await context.TestLogoutAsync(); + }, + browser, + configuration => + { + configuration.AccessibilityCheckingConfiguration.RunAccessibilityCheckingAssertionOnAllPageChanges = true; + return Task.CompletedTask; + }); + } +} From 4d8d5642a8abd205d595a72298893a78691820c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Tue, 18 Oct 2022 00:09:17 +0200 Subject: [PATCH 058/175] Missing OrchardCore.Localization enable --- .../OrchardCore.Tests.UI/Recipes/Configuration.Tests.recipe.json | 1 + 1 file changed, 1 insertion(+) diff --git a/test/OrchardCore.Tests.UI/Recipes/Configuration.Tests.recipe.json b/test/OrchardCore.Tests.UI/Recipes/Configuration.Tests.recipe.json index fef4eeb97a5..e972c5a20c2 100644 --- a/test/OrchardCore.Tests.UI/Recipes/Configuration.Tests.recipe.json +++ b/test/OrchardCore.Tests.UI/Recipes/Configuration.Tests.recipe.json @@ -12,6 +12,7 @@ { "name": "feature", "enable": [ + "OrchardCore.Localization", "OrchardCore.Users.Registration" ] }, From 50e9d4e694fa11bdd5d22194ed6c68c4b7de2c20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Tue, 18 Oct 2022 00:25:21 +0200 Subject: [PATCH 059/175] Adding tenant creation test --- .../Helpers/SetupHelpers.cs | 2 +- test/OrchardCore.Tests.UI/Tests/SaaSTests.cs | 38 +++++++++++++++++++ 2 files changed, 39 insertions(+), 1 deletion(-) diff --git a/test/OrchardCore.Tests.UI/Helpers/SetupHelpers.cs b/test/OrchardCore.Tests.UI/Helpers/SetupHelpers.cs index 1231fef25eb..89748f9f29d 100644 --- a/test/OrchardCore.Tests.UI/Helpers/SetupHelpers.cs +++ b/test/OrchardCore.Tests.UI/Helpers/SetupHelpers.cs @@ -9,7 +9,7 @@ namespace OrchardCore.Tests.UI.Helpers { public static class SetupHelpers { - public const string RecipeId = "Blog.Tests"; + public const string RecipeId = "SaaS.Tests"; public static async Task RunSetupAsync(UITestContext context) { diff --git a/test/OrchardCore.Tests.UI/Tests/SaaSTests.cs b/test/OrchardCore.Tests.UI/Tests/SaaSTests.cs index 1a03e90852c..0db30b21b5f 100644 --- a/test/OrchardCore.Tests.UI/Tests/SaaSTests.cs +++ b/test/OrchardCore.Tests.UI/Tests/SaaSTests.cs @@ -1,8 +1,10 @@ using System.Threading.Tasks; using Lombiq.Tests.UI.Attributes; using Lombiq.Tests.UI.Extensions; +using Lombiq.Tests.UI.Models; using Lombiq.Tests.UI.Pages; using Lombiq.Tests.UI.Services; +using OpenQA.Selenium; using Xunit; using Xunit.Abstractions; @@ -10,6 +12,9 @@ namespace OrchardCore.Tests.UI.Tests { public class SaaSTests : UITestBase { + private const string TestTenantUrlPrefix = "test"; + private const string TestTenantDisplayName = "Test Tenant"; + public SaaSTests(ITestOutputHelper testOutputHelper) : base(testOutputHelper) { @@ -39,5 +44,38 @@ await context.TestSetupWithInvalidAndValidDataAsync(new OrchardCoreSetupParamete configuration.AccessibilityCheckingConfiguration.RunAccessibilityCheckingAssertionOnAllPageChanges = true; return Task.CompletedTask; }); + + [Theory, Chrome] + public Task CreatingTenantShouldWork(Browser browser) => + ExecuteTestAfterSetupAsync( + async context => + { + // Taken from https://github.com/Lombiq/UI-Testing-Toolbox/blob/6eb53a55c991f9f3764660791e649783973236d1/Lombiq.Tests.UI.Samples/Tests/TenantTests.cs + const string tenantAdminName = "tenantAdmin"; + await context.SignInDirectlyAsync(); + + await context.CreateAndEnterTenantAsync( + TestTenantDisplayName, + TestTenantUrlPrefix, + "Blog.Tests", + new CreateTenant { UserName = tenantAdminName }); + + Assert.Equal(TestTenantDisplayName, context.Get(By.ClassName("navbar-brand")).Text); + + await context.SignInDirectlyAsync(tenantAdminName); + Assert.Equal(tenantAdminName, await context.GetCurrentUserNameAsync()); + Assert.StartsWith($"/{TestTenantUrlPrefix}", context.GetCurrentUri().AbsolutePath); + }, + browser, + configuration => + { + configuration.AccessibilityCheckingConfiguration.RunAccessibilityCheckingAssertionOnAllPageChanges = true; + configuration.AccessibilityCheckingConfiguration.AxeBuilderConfigurator += axeBuilder => + AccessibilityCheckingConfiguration + .ConfigureWcag21aa(axeBuilder) + .DisableRules("color-contrast"); + + return Task.CompletedTask; + }); } } From 7fe74330fd29ac9759124df127646a902e321365 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Tue, 18 Oct 2022 00:29:11 +0200 Subject: [PATCH 060/175] Adding "Recipe" to test name --- .../Tests/{AgencyTests.cs => AgencyRecipeTests.cs} | 4 ++-- .../Tests/{BlogTests.cs => BlogRecipeTests.cs} | 4 ++-- .../Tests/{ComingSoonTests.cs => ComingSoonRecipeTests.cs} | 4 ++-- .../Tests/{SaaSTests.cs => SaaSRecipeTests.cs} | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) rename test/OrchardCore.Tests.UI/Tests/{AgencyTests.cs => AgencyRecipeTests.cs} (96%) rename test/OrchardCore.Tests.UI/Tests/{BlogTests.cs => BlogRecipeTests.cs} (92%) rename test/OrchardCore.Tests.UI/Tests/{ComingSoonTests.cs => ComingSoonRecipeTests.cs} (92%) rename test/OrchardCore.Tests.UI/Tests/{SaaSTests.cs => SaaSRecipeTests.cs} (96%) diff --git a/test/OrchardCore.Tests.UI/Tests/AgencyTests.cs b/test/OrchardCore.Tests.UI/Tests/AgencyRecipeTests.cs similarity index 96% rename from test/OrchardCore.Tests.UI/Tests/AgencyTests.cs rename to test/OrchardCore.Tests.UI/Tests/AgencyRecipeTests.cs index 6159c27424c..e988c0bdbea 100644 --- a/test/OrchardCore.Tests.UI/Tests/AgencyTests.cs +++ b/test/OrchardCore.Tests.UI/Tests/AgencyRecipeTests.cs @@ -10,9 +10,9 @@ namespace OrchardCore.Tests.UI.Tests { - public class AgencyTests : UITestBase + public class AgencyRecipeTests : UITestBase { - public AgencyTests(ITestOutputHelper testOutputHelper) + public AgencyRecipeTests(ITestOutputHelper testOutputHelper) : base(testOutputHelper) { } diff --git a/test/OrchardCore.Tests.UI/Tests/BlogTests.cs b/test/OrchardCore.Tests.UI/Tests/BlogRecipeTests.cs similarity index 92% rename from test/OrchardCore.Tests.UI/Tests/BlogTests.cs rename to test/OrchardCore.Tests.UI/Tests/BlogRecipeTests.cs index 025c8dbd616..9e4f7558446 100644 --- a/test/OrchardCore.Tests.UI/Tests/BlogTests.cs +++ b/test/OrchardCore.Tests.UI/Tests/BlogRecipeTests.cs @@ -8,9 +8,9 @@ namespace OrchardCore.Tests.UI.Tests { - public class BlogTests : UITestBase + public class BlogRecipeTests : UITestBase { - public BlogTests(ITestOutputHelper testOutputHelper) + public BlogRecipeTests(ITestOutputHelper testOutputHelper) : base(testOutputHelper) { } diff --git a/test/OrchardCore.Tests.UI/Tests/ComingSoonTests.cs b/test/OrchardCore.Tests.UI/Tests/ComingSoonRecipeTests.cs similarity index 92% rename from test/OrchardCore.Tests.UI/Tests/ComingSoonTests.cs rename to test/OrchardCore.Tests.UI/Tests/ComingSoonRecipeTests.cs index cb43fadd166..9f19a6ada4d 100644 --- a/test/OrchardCore.Tests.UI/Tests/ComingSoonTests.cs +++ b/test/OrchardCore.Tests.UI/Tests/ComingSoonRecipeTests.cs @@ -8,9 +8,9 @@ namespace OrchardCore.Tests.UI.Tests { - public class ComingSoonTests : UITestBase + public class ComingSoonRecipeTests : UITestBase { - public ComingSoonTests(ITestOutputHelper testOutputHelper) + public ComingSoonRecipeTests(ITestOutputHelper testOutputHelper) : base(testOutputHelper) { } diff --git a/test/OrchardCore.Tests.UI/Tests/SaaSTests.cs b/test/OrchardCore.Tests.UI/Tests/SaaSRecipeTests.cs similarity index 96% rename from test/OrchardCore.Tests.UI/Tests/SaaSTests.cs rename to test/OrchardCore.Tests.UI/Tests/SaaSRecipeTests.cs index 0db30b21b5f..7cde203d6d5 100644 --- a/test/OrchardCore.Tests.UI/Tests/SaaSTests.cs +++ b/test/OrchardCore.Tests.UI/Tests/SaaSRecipeTests.cs @@ -10,12 +10,12 @@ namespace OrchardCore.Tests.UI.Tests { - public class SaaSTests : UITestBase + public class SaaSRecipeTests : UITestBase { private const string TestTenantUrlPrefix = "test"; private const string TestTenantDisplayName = "Test Tenant"; - public SaaSTests(ITestOutputHelper testOutputHelper) + public SaaSRecipeTests(ITestOutputHelper testOutputHelper) : base(testOutputHelper) { } From dcf9433019b6c623cccc40a592729ffa76625ffe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Tue, 18 Oct 2022 00:30:15 +0200 Subject: [PATCH 061/175] Enabling accessibility checks by default --- test/OrchardCore.Tests.UI/Tests/AgencyRecipeTests.cs | 1 - test/OrchardCore.Tests.UI/Tests/BlogRecipeTests.cs | 1 - test/OrchardCore.Tests.UI/Tests/SaaSRecipeTests.cs | 8 +------- test/OrchardCore.Tests.UI/UITestBase.cs | 2 ++ 4 files changed, 3 insertions(+), 9 deletions(-) diff --git a/test/OrchardCore.Tests.UI/Tests/AgencyRecipeTests.cs b/test/OrchardCore.Tests.UI/Tests/AgencyRecipeTests.cs index e988c0bdbea..b53068f0253 100644 --- a/test/OrchardCore.Tests.UI/Tests/AgencyRecipeTests.cs +++ b/test/OrchardCore.Tests.UI/Tests/AgencyRecipeTests.cs @@ -62,7 +62,6 @@ await context.TestSetupWithInvalidAndValidDataAsync(new OrchardCoreSetupParamete browser, configuration => { - configuration.AccessibilityCheckingConfiguration.RunAccessibilityCheckingAssertionOnAllPageChanges = true; configuration.AccessibilityCheckingConfiguration.AxeBuilderConfigurator += axeBuilder => AccessibilityCheckingConfiguration .ConfigureWcag21aa(axeBuilder) diff --git a/test/OrchardCore.Tests.UI/Tests/BlogRecipeTests.cs b/test/OrchardCore.Tests.UI/Tests/BlogRecipeTests.cs index 9e4f7558446..c49c4e3f9d1 100644 --- a/test/OrchardCore.Tests.UI/Tests/BlogRecipeTests.cs +++ b/test/OrchardCore.Tests.UI/Tests/BlogRecipeTests.cs @@ -22,7 +22,6 @@ public Task BasicOrchardFeaturesShouldWorkWithBlog(Browser browser) => browser, configuration => { - configuration.AccessibilityCheckingConfiguration.RunAccessibilityCheckingAssertionOnAllPageChanges = true; configuration.AccessibilityCheckingConfiguration.AxeBuilderConfigurator += axeBuilder => AccessibilityCheckingConfiguration .ConfigureWcag21aa(axeBuilder) diff --git a/test/OrchardCore.Tests.UI/Tests/SaaSRecipeTests.cs b/test/OrchardCore.Tests.UI/Tests/SaaSRecipeTests.cs index 7cde203d6d5..2c51b4ac71c 100644 --- a/test/OrchardCore.Tests.UI/Tests/SaaSRecipeTests.cs +++ b/test/OrchardCore.Tests.UI/Tests/SaaSRecipeTests.cs @@ -38,12 +38,7 @@ await context.TestSetupWithInvalidAndValidDataAsync(new OrchardCoreSetupParamete await context.TestTurningFeatureOnAndOffAsync(); await context.TestLogoutAsync(); }, - browser, - configuration => - { - configuration.AccessibilityCheckingConfiguration.RunAccessibilityCheckingAssertionOnAllPageChanges = true; - return Task.CompletedTask; - }); + browser); [Theory, Chrome] public Task CreatingTenantShouldWork(Browser browser) => @@ -69,7 +64,6 @@ await context.CreateAndEnterTenantAsync( browser, configuration => { - configuration.AccessibilityCheckingConfiguration.RunAccessibilityCheckingAssertionOnAllPageChanges = true; configuration.AccessibilityCheckingConfiguration.AxeBuilderConfigurator += axeBuilder => AccessibilityCheckingConfiguration .ConfigureWcag21aa(axeBuilder) diff --git a/test/OrchardCore.Tests.UI/UITestBase.cs b/test/OrchardCore.Tests.UI/UITestBase.cs index 156dbf36a33..d2caefec571 100644 --- a/test/OrchardCore.Tests.UI/UITestBase.cs +++ b/test/OrchardCore.Tests.UI/UITestBase.cs @@ -31,6 +31,8 @@ protected override Task ExecuteTestAsync( setupOperation, async configuration => { + configuration.AccessibilityCheckingConfiguration.RunAccessibilityCheckingAssertionOnAllPageChanges = true; + if (changeConfigurationAsync != null) await changeConfigurationAsync(configuration); }); } From e80515f828023c40e7110bd09238b559fd957a13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Tue, 18 Oct 2022 00:55:26 +0200 Subject: [PATCH 062/175] Blank and Headless recipe tests --- .../OrchardCore.Tests.UI.csproj | 8 +++ .../Recipes/Blank.Tests.recipe.json | 26 +++++++++ .../Recipes/Headless.Tests.recipe.json | 26 +++++++++ .../Tests/BlankRecipeTests.cs | 56 +++++++++++++++++++ .../Tests/HeadlessRecipeTests.cs | 41 ++++++++++++++ 5 files changed, 157 insertions(+) create mode 100644 test/OrchardCore.Tests.UI/Recipes/Blank.Tests.recipe.json create mode 100644 test/OrchardCore.Tests.UI/Recipes/Headless.Tests.recipe.json create mode 100644 test/OrchardCore.Tests.UI/Tests/BlankRecipeTests.cs create mode 100644 test/OrchardCore.Tests.UI/Tests/HeadlessRecipeTests.cs diff --git a/test/OrchardCore.Tests.UI/OrchardCore.Tests.UI.csproj b/test/OrchardCore.Tests.UI/OrchardCore.Tests.UI.csproj index c5782b9b8bd..d4e44f8a82c 100644 --- a/test/OrchardCore.Tests.UI/OrchardCore.Tests.UI.csproj +++ b/test/OrchardCore.Tests.UI/OrchardCore.Tests.UI.csproj @@ -10,14 +10,22 @@ + + Always + + PreserveNewest + + + PreserveNewest + PreserveNewest diff --git a/test/OrchardCore.Tests.UI/Recipes/Blank.Tests.recipe.json b/test/OrchardCore.Tests.UI/Recipes/Blank.Tests.recipe.json new file mode 100644 index 00000000000..508b9502bb4 --- /dev/null +++ b/test/OrchardCore.Tests.UI/Recipes/Blank.Tests.recipe.json @@ -0,0 +1,26 @@ +{ + "name": "Blank.Tests", + "displayName": "Blank Tests", + "description": "Setup recipe for automated UI test execution using the Blank recipe.", + "author": "The Orchard Core Team", + "website": "https://orchardcore.net", + "version": "1.0.0", + "issetuprecipe": true, + "categories": [ "test" ], + "tags": [ "agency", "test" ], + "steps": [ + { + "name": "recipes", + "Values": [ + { + "executionid": "OrchardCore.Tests.UI", + "name": "Blank" + }, + { + "executionid": "OrchardCore.Tests.UI", + "name": "Configuration.Tests" + } + ] + } + ] +} diff --git a/test/OrchardCore.Tests.UI/Recipes/Headless.Tests.recipe.json b/test/OrchardCore.Tests.UI/Recipes/Headless.Tests.recipe.json new file mode 100644 index 00000000000..6026ffbd1f1 --- /dev/null +++ b/test/OrchardCore.Tests.UI/Recipes/Headless.Tests.recipe.json @@ -0,0 +1,26 @@ +{ + "name": "Headless.Tests", + "displayName": "Headless Tests", + "description": "Setup recipe for automated UI test execution using the Headless recipe.", + "author": "The Orchard Core Team", + "website": "https://orchardcore.net", + "version": "1.0.0", + "issetuprecipe": true, + "categories": [ "test" ], + "tags": [ "agency", "test" ], + "steps": [ + { + "name": "recipes", + "Values": [ + { + "executionid": "OrchardCore.Tests.UI", + "name": "Headless" + }, + { + "executionid": "OrchardCore.Tests.UI", + "name": "Configuration.Tests" + } + ] + } + ] +} diff --git a/test/OrchardCore.Tests.UI/Tests/BlankRecipeTests.cs b/test/OrchardCore.Tests.UI/Tests/BlankRecipeTests.cs new file mode 100644 index 00000000000..d9ab4869ca4 --- /dev/null +++ b/test/OrchardCore.Tests.UI/Tests/BlankRecipeTests.cs @@ -0,0 +1,56 @@ +using System.Linq; +using System.Threading.Tasks; +using Lombiq.Tests.UI.Attributes; +using Lombiq.Tests.UI.Extensions; +using Lombiq.Tests.UI.Pages; +using Lombiq.Tests.UI.Services; +using OpenQA.Selenium; +using Shouldly; +using Xunit; +using Xunit.Abstractions; + +namespace OrchardCore.Tests.UI.Tests +{ + public class BlankRecipeTests : UITestBase + { + public BlankRecipeTests(ITestOutputHelper testOutputHelper) + : base(testOutputHelper) + { + } + + [Theory, Chrome] + public Task BasicOrchardFeaturesShouldWorkWithBlank(Browser browser) => + ExecuteTestAsync( + async context => + { + await context.TestSetupWithInvalidAndValidDataAsync(new OrchardCoreSetupParameters(context) + { + RecipeId = "Blank.Tests", + }); + + await context.TestLoginWithInvalidDataAsync(); + await context.TestLoginAsync(); + await context.TestTurningFeatureOnAndOffAsync(); + await context.TestLogoutAsync(); + }, + browser, + configuration => + { + configuration.HtmlValidationConfiguration.RunHtmlValidationAssertionOnAllPageChanges = false; + configuration.AccessibilityCheckingConfiguration.RunAccessibilityCheckingAssertionOnAllPageChanges = false; + + configuration.AssertBrowserLog = logEntries => + logEntries.ShouldNotContain( + logEntry => IsValidBrowserLogEntry(logEntry), + logEntries.Where(IsValidBrowserLogEntry).ToFormattedString()); + + return Task.CompletedTask; + }); + + private static bool IsValidBrowserLogEntry(LogEntry logEntry) + { + return OrchardCoreUITestExecutorConfiguration.IsValidBrowserLogMessage(logEntry) && + !logEntry.IsNotFoundMessage("/"); + } + } +} diff --git a/test/OrchardCore.Tests.UI/Tests/HeadlessRecipeTests.cs b/test/OrchardCore.Tests.UI/Tests/HeadlessRecipeTests.cs new file mode 100644 index 00000000000..42a39050ea9 --- /dev/null +++ b/test/OrchardCore.Tests.UI/Tests/HeadlessRecipeTests.cs @@ -0,0 +1,41 @@ +using System.Threading.Tasks; +using Lombiq.Tests.UI.Attributes; +using Lombiq.Tests.UI.Extensions; +using Lombiq.Tests.UI.Pages; +using Lombiq.Tests.UI.Services; +using Xunit; +using Xunit.Abstractions; + +namespace OrchardCore.Tests.UI.Tests +{ + public class HeadlessRecipeTests : UITestBase + { + public HeadlessRecipeTests(ITestOutputHelper testOutputHelper) + : base(testOutputHelper) + { + } + + [Theory, Chrome] + public Task BasicOrchardFeaturesShouldWorkWithHeadless(Browser browser) => + ExecuteTestAsync( + async context => + { + await context.TestSetupWithInvalidAndValidDataAsync(new OrchardCoreSetupParameters(context) + { + RecipeId = "Headless.Tests", + }); + + await context.TestLoginWithInvalidDataAsync(); + await context.TestLoginAsync(); + await context.TestTurningFeatureOnAndOffAsync(); + await context.TestLogoutAsync(); + }, + browser, + configuration => + { + configuration.HtmlValidationConfiguration.RunHtmlValidationAssertionOnAllPageChanges = false; + configuration.AccessibilityCheckingConfiguration.RunAccessibilityCheckingAssertionOnAllPageChanges = false; + return Task.CompletedTask; + }); + } +} From 13f4f9092831d9a8184953f45e8926a73e4dd495 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Tue, 18 Oct 2022 01:32:47 +0200 Subject: [PATCH 063/175] Updating Lombiq.Tests.UI* to 4.0.2-alpha.1.osoe-401 --- src/OrchardCore.Build/Dependencies.props | 6 +++--- test/OrchardCore.Tests.UI/Tests/BlankRecipeTests.cs | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/OrchardCore.Build/Dependencies.props b/src/OrchardCore.Build/Dependencies.props index 81f570ca56b..de2b84f2655 100644 --- a/src/OrchardCore.Build/Dependencies.props +++ b/src/OrchardCore.Build/Dependencies.props @@ -26,9 +26,9 @@ - - - + + + diff --git a/test/OrchardCore.Tests.UI/Tests/BlankRecipeTests.cs b/test/OrchardCore.Tests.UI/Tests/BlankRecipeTests.cs index d9ab4869ca4..45356ebe9c4 100644 --- a/test/OrchardCore.Tests.UI/Tests/BlankRecipeTests.cs +++ b/test/OrchardCore.Tests.UI/Tests/BlankRecipeTests.cs @@ -49,8 +49,8 @@ await context.TestSetupWithInvalidAndValidDataAsync(new OrchardCoreSetupParamete private static bool IsValidBrowserLogEntry(LogEntry logEntry) { - return OrchardCoreUITestExecutorConfiguration.IsValidBrowserLogMessage(logEntry) && - !logEntry.IsNotFoundMessage("/"); + return OrchardCoreUITestExecutorConfiguration.IsValidBrowserLogEntry(logEntry) && + !logEntry.IsNotFoundLogEntry("/"); } } } From 015c2f5065c1e5321665df6dff776abdf553e4a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Tue, 18 Oct 2022 01:38:17 +0200 Subject: [PATCH 064/175] Adding MVC UI test --- OrchardCore.sln | 8 +++- src/OrchardCore.Mvc.Web/Program.cs | 15 +++++++ test/OrchardCore.Tests.UI.Mvc/NLog.config | 34 ++++++++++++++++ .../OrchardCore.Tests.UI.Mvc.csproj | 35 ++++++++++++++++ .../Tests/MvcTests.cs | 40 +++++++++++++++++++ .../xunit.runner.json | 6 +++ 6 files changed, 137 insertions(+), 1 deletion(-) create mode 100644 test/OrchardCore.Tests.UI.Mvc/NLog.config create mode 100644 test/OrchardCore.Tests.UI.Mvc/OrchardCore.Tests.UI.Mvc.csproj create mode 100644 test/OrchardCore.Tests.UI.Mvc/Tests/MvcTests.cs create mode 100644 test/OrchardCore.Tests.UI.Mvc/xunit.runner.json diff --git a/OrchardCore.sln b/OrchardCore.sln index 3a7ef8dfe25..a82f15c6861 100644 --- a/OrchardCore.sln +++ b/OrchardCore.sln @@ -442,7 +442,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OrchardCore.Autoroute.Core" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OrchardCore.Security", "src\OrchardCore.Modules\OrchardCore.Security\OrchardCore.Security.csproj", "{B02C00A7-33C2-4FEE-9D0F-B14C349ADB68}" EndProject -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OrchardCore.Abstractions.Tests", "test\OrchardCore.Abstractions.Tests\OrchardCore.Abstractions.Tests.csproj", "{FE8011DE-D917-4F74-9955-238B2BBA9165}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OrchardCore.Tests.UI", "test\OrchardCore.Tests.UI\OrchardCore.Tests.UI.csproj", "{2FADB5D9-E229-4689-A040-12EEE1876285}" @@ -504,6 +503,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ui-tests", "ui-tests", "{0B .github\actions\ui-tests\action.yml = .github\actions\ui-tests\action.yml EndProjectSection EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OrchardCore.Tests.UI.Mvc", "test\OrchardCore.Tests.UI.Mvc\OrchardCore.Tests.UI.Mvc.csproj", "{BC3553BF-B9C9-4BE9-B09B-5F69524A44AA}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -1304,6 +1305,10 @@ Global {7BDF280B-70B7-4AFC-A6F7-B5759DCA2A2C}.Debug|Any CPU.Build.0 = Debug|Any CPU {7BDF280B-70B7-4AFC-A6F7-B5759DCA2A2C}.Release|Any CPU.ActiveCfg = Release|Any CPU {7BDF280B-70B7-4AFC-A6F7-B5759DCA2A2C}.Release|Any CPU.Build.0 = Release|Any CPU + {BC3553BF-B9C9-4BE9-B09B-5F69524A44AA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BC3553BF-B9C9-4BE9-B09B-5F69524A44AA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BC3553BF-B9C9-4BE9-B09B-5F69524A44AA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BC3553BF-B9C9-4BE9-B09B-5F69524A44AA}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -1531,6 +1536,7 @@ Global {01A2BBC1-B9C1-4DD1-825C-A63B6D40F91D} = {59C52CE8-CE78-4502-8C19-34EC63918BE2} {2FF93CCD-E4DF-4086-950B-0F7484C88906} = {59C52CE8-CE78-4502-8C19-34EC63918BE2} {0B2B9EBE-C008-42A0-9CC0-37727DD8ED0C} = {2FF93CCD-E4DF-4086-950B-0F7484C88906} + {BC3553BF-B9C9-4BE9-B09B-5F69524A44AA} = {B8D16C60-99B4-43D5-A3AD-4CD89AF39B25} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {46A1D25A-78D1-4476-9CBF-25B75E296341} diff --git a/src/OrchardCore.Mvc.Web/Program.cs b/src/OrchardCore.Mvc.Web/Program.cs index d93a0dc32b3..7c69f1b05eb 100644 --- a/src/OrchardCore.Mvc.Web/Program.cs +++ b/src/OrchardCore.Mvc.Web/Program.cs @@ -1,6 +1,9 @@ var builder = WebApplication.CreateBuilder(args); +var configuration = builder.Configuration; + builder.Services + .AddSingleton(configuration) .AddOrchardCore() .AddMvc(); @@ -16,3 +19,15 @@ app.UseOrchardCore(); app.Run(); + +[System.Diagnostics.CodeAnalysis.SuppressMessage( + "Design", + "CA1050: Declare types in namespaces", + Justification = "As described here: https://docs.microsoft.com/en-us/aspnet/core/test/integration-tests?view=aspnetcore-6.0.")] +public partial class Program +{ + protected Program() + { + // Nothing to do here. + } +} diff --git a/test/OrchardCore.Tests.UI.Mvc/NLog.config b/test/OrchardCore.Tests.UI.Mvc/NLog.config new file mode 100644 index 00000000000..80b2911a6f4 --- /dev/null +++ b/test/OrchardCore.Tests.UI.Mvc/NLog.config @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/OrchardCore.Tests.UI.Mvc/OrchardCore.Tests.UI.Mvc.csproj b/test/OrchardCore.Tests.UI.Mvc/OrchardCore.Tests.UI.Mvc.csproj new file mode 100644 index 00000000000..4efda2038fe --- /dev/null +++ b/test/OrchardCore.Tests.UI.Mvc/OrchardCore.Tests.UI.Mvc.csproj @@ -0,0 +1,35 @@ + + + + + + $(CommonTargetFrameworks) + false + + + + + + + + + PreserveNewest + true + PreserveNewest + + + + + + + + + + + + + + + + + diff --git a/test/OrchardCore.Tests.UI.Mvc/Tests/MvcTests.cs b/test/OrchardCore.Tests.UI.Mvc/Tests/MvcTests.cs new file mode 100644 index 00000000000..43508557ae1 --- /dev/null +++ b/test/OrchardCore.Tests.UI.Mvc/Tests/MvcTests.cs @@ -0,0 +1,40 @@ +using System; +using System.Threading.Tasks; +using Lombiq.Tests.UI; +using Lombiq.Tests.UI.Attributes; +using Lombiq.Tests.UI.Extensions; +using Lombiq.Tests.UI.Services; +using OpenQA.Selenium; +using Xunit; +using Xunit.Abstractions; + +namespace OrchardCore.Tests.UI.Tests +{ + public class MvcTests : OrchardCoreUITestBase + { + public MvcTests(ITestOutputHelper testOutputHelper) + : base(testOutputHelper) + { + } + + [Theory, Chrome] + public Task BasicOrchardFeaturesShouldWorkWithBlank(Browser browser) => + ExecuteTestAsync( + async context => + { + await context.GoToRelativeUrlAsync("/"); + Assert.Equal("Hello World", context.Get(By.TagName("h1")).Text); + }, + browser, + configuration => + { + configuration.HtmlValidationConfiguration.RunHtmlValidationAssertionOnAllPageChanges = false; + return Task.CompletedTask; + }); + + protected override Task ExecuteTestAfterSetupAsync(Func testAsync, Browser browser, Func changeConfigurationAsync) + { + throw new NotImplementedException(); + } + } +} diff --git a/test/OrchardCore.Tests.UI.Mvc/xunit.runner.json b/test/OrchardCore.Tests.UI.Mvc/xunit.runner.json new file mode 100644 index 00000000000..100b12679c4 --- /dev/null +++ b/test/OrchardCore.Tests.UI.Mvc/xunit.runner.json @@ -0,0 +1,6 @@ +{ + "$schema": "https://xunit.net/schema/current/xunit.runner.schema.json", + "parallelizeAssembly": false, + "parallelizeTestCollections": true, + "maxParallelThreads": 0 +} From 9cf30c8ec731ccdb37861e992b683307cc2a64a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Tue, 18 Oct 2022 01:39:35 +0200 Subject: [PATCH 065/175] Also running MVC UI tests --- .github/actions/ui-tests/action.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/actions/ui-tests/action.yml b/.github/actions/ui-tests/action.yml index 8725c6a9f6d..81228d601b8 100644 --- a/.github/actions/ui-tests/action.yml +++ b/.github/actions/ui-tests/action.yml @@ -19,3 +19,13 @@ runs: name: ui-test-failure-${{ inputs.os-name }} path: | test/OrchardCore.Tests.UI/bin/Release/*/FailureDumps + - name: MVC UI Tests + shell: bash + run: | + dotnet test -c Release --no-restore --no-build ./test/OrchardCore.Tests.UI.Mvc/OrchardCore.Tests.UI.Mvc.csproj + - uses: actions/upload-artifact@v2 + if: failure() && hashFiles('test/OrchardCore.Tests.UI.Mvc/bin/Release/*/FailureDumps') + with: + name: mvc-ui-test-failure-${{ inputs.os-name }} + path: | + test/OrchardCore.Tests.UI.Mvc/bin/Release/*/FailureDumps From 212949bd4515737c66a89ce06e74a59d634047e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Wed, 19 Oct 2022 01:00:21 +0200 Subject: [PATCH 066/175] Running basic Orchard features tests on the tenant too --- src/OrchardCore.Build/Dependencies.props | 6 +++--- .../OrchardCore.Tests.UI/Tests/SaaSRecipeTests.cs | 15 ++++++--------- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/src/OrchardCore.Build/Dependencies.props b/src/OrchardCore.Build/Dependencies.props index de2b84f2655..97aa88237d0 100644 --- a/src/OrchardCore.Build/Dependencies.props +++ b/src/OrchardCore.Build/Dependencies.props @@ -26,9 +26,9 @@ - - - + + + diff --git a/test/OrchardCore.Tests.UI/Tests/SaaSRecipeTests.cs b/test/OrchardCore.Tests.UI/Tests/SaaSRecipeTests.cs index 2c51b4ac71c..1b97e401ec5 100644 --- a/test/OrchardCore.Tests.UI/Tests/SaaSRecipeTests.cs +++ b/test/OrchardCore.Tests.UI/Tests/SaaSRecipeTests.cs @@ -45,21 +45,18 @@ public Task CreatingTenantShouldWork(Browser browser) => ExecuteTestAfterSetupAsync( async context => { - // Taken from https://github.com/Lombiq/UI-Testing-Toolbox/blob/6eb53a55c991f9f3764660791e649783973236d1/Lombiq.Tests.UI.Samples/Tests/TenantTests.cs - const string tenantAdminName = "tenantAdmin"; - await context.SignInDirectlyAsync(); - await context.CreateAndEnterTenantAsync( - TestTenantDisplayName, + TestTenantUrlPrefix, TestTenantUrlPrefix, "Blog.Tests", - new CreateTenant { UserName = tenantAdminName }); + new TenantSetupParameters + { + SiteName = TestTenantDisplayName, + }); Assert.Equal(TestTenantDisplayName, context.Get(By.ClassName("navbar-brand")).Text); - await context.SignInDirectlyAsync(tenantAdminName); - Assert.Equal(tenantAdminName, await context.GetCurrentUserNameAsync()); - Assert.StartsWith($"/{TestTenantUrlPrefix}", context.GetCurrentUri().AbsolutePath); + await context.TestBasicOrchardFeaturesExceptSetupAsync(); }, browser, configuration => From 6ef7b4ee1215a1fa470f9dfa59fcf727727c7d24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Wed, 19 Oct 2022 01:01:23 +0200 Subject: [PATCH 067/175] Renaming test --- test/OrchardCore.Tests.UI/Tests/SaaSRecipeTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/OrchardCore.Tests.UI/Tests/SaaSRecipeTests.cs b/test/OrchardCore.Tests.UI/Tests/SaaSRecipeTests.cs index 1b97e401ec5..2fe8650ffbd 100644 --- a/test/OrchardCore.Tests.UI/Tests/SaaSRecipeTests.cs +++ b/test/OrchardCore.Tests.UI/Tests/SaaSRecipeTests.cs @@ -41,7 +41,7 @@ await context.TestSetupWithInvalidAndValidDataAsync(new OrchardCoreSetupParamete browser); [Theory, Chrome] - public Task CreatingTenantShouldWork(Browser browser) => + public Task BasicOrchardFeaturesShouldWorkWithNewTenant(Browser browser) => ExecuteTestAfterSetupAsync( async context => { From 359a313fc25d0acc111111afb44ab207ccfbbb8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Wed, 19 Oct 2022 02:25:03 +0200 Subject: [PATCH 068/175] Testing manual tenant creation too --- src/OrchardCore.Build/Dependencies.props | 6 ++--- .../Tests/SaaSRecipeTests.cs | 22 ++++++++----------- 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/src/OrchardCore.Build/Dependencies.props b/src/OrchardCore.Build/Dependencies.props index 97aa88237d0..5f6a0d3a565 100644 --- a/src/OrchardCore.Build/Dependencies.props +++ b/src/OrchardCore.Build/Dependencies.props @@ -26,9 +26,9 @@ - - - + + + diff --git a/test/OrchardCore.Tests.UI/Tests/SaaSRecipeTests.cs b/test/OrchardCore.Tests.UI/Tests/SaaSRecipeTests.cs index 2fe8650ffbd..984e81fca29 100644 --- a/test/OrchardCore.Tests.UI/Tests/SaaSRecipeTests.cs +++ b/test/OrchardCore.Tests.UI/Tests/SaaSRecipeTests.cs @@ -1,10 +1,8 @@ using System.Threading.Tasks; using Lombiq.Tests.UI.Attributes; using Lombiq.Tests.UI.Extensions; -using Lombiq.Tests.UI.Models; using Lombiq.Tests.UI.Pages; using Lombiq.Tests.UI.Services; -using OpenQA.Selenium; using Xunit; using Xunit.Abstractions; @@ -12,9 +10,6 @@ namespace OrchardCore.Tests.UI.Tests { public class SaaSRecipeTests : UITestBase { - private const string TestTenantUrlPrefix = "test"; - private const string TestTenantDisplayName = "Test Tenant"; - public SaaSRecipeTests(ITestOutputHelper testOutputHelper) : base(testOutputHelper) { @@ -45,17 +40,18 @@ public Task BasicOrchardFeaturesShouldWorkWithNewTenant(Browser browser) => ExecuteTestAfterSetupAsync( async context => { - await context.CreateAndEnterTenantAsync( - TestTenantUrlPrefix, - TestTenantUrlPrefix, - "Blog.Tests", - new TenantSetupParameters + await context.SignInDirectlyAsync(); + + await context.CreateAndEnterTenantManuallyAsync("test", "test"); + + await context.GoToSetupPageAndSetupOrchardCoreAsync( + new OrchardCoreSetupParameters(context) { - SiteName = TestTenantDisplayName, + SiteName = "Test Tenant", + RecipeId = "Blog.Tests", + RunSetupOnCurrentPage = true, }); - Assert.Equal(TestTenantDisplayName, context.Get(By.ClassName("navbar-brand")).Text); - await context.TestBasicOrchardFeaturesExceptSetupAsync(); }, browser, From 3255e4b6c7831fe41ea9d1e6777cd4c8ed7690d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Fri, 21 Oct 2022 16:41:06 +0200 Subject: [PATCH 069/175] Updating Lombiq.Tests.UI* --- src/OrchardCore.Build/Dependencies.props | 6 +++--- test/OrchardCore.Tests.UI/Tests/SaaSRecipeTests.cs | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/OrchardCore.Build/Dependencies.props b/src/OrchardCore.Build/Dependencies.props index 5f6a0d3a565..9e6381c0019 100644 --- a/src/OrchardCore.Build/Dependencies.props +++ b/src/OrchardCore.Build/Dependencies.props @@ -26,9 +26,9 @@ - - - + + + diff --git a/test/OrchardCore.Tests.UI/Tests/SaaSRecipeTests.cs b/test/OrchardCore.Tests.UI/Tests/SaaSRecipeTests.cs index 984e81fca29..a21390966f0 100644 --- a/test/OrchardCore.Tests.UI/Tests/SaaSRecipeTests.cs +++ b/test/OrchardCore.Tests.UI/Tests/SaaSRecipeTests.cs @@ -42,13 +42,14 @@ public Task BasicOrchardFeaturesShouldWorkWithNewTenant(Browser browser) => { await context.SignInDirectlyAsync(); - await context.CreateAndEnterTenantManuallyAsync("test", "test"); + await context.CreateAndChangeToTenantManuallyAsync("test", "test"); await context.GoToSetupPageAndSetupOrchardCoreAsync( new OrchardCoreSetupParameters(context) { SiteName = "Test Tenant", RecipeId = "Blog.Tests", + TablePrefix = "test", RunSetupOnCurrentPage = true, }); From e562ace9ac663bb4fe68b4981a784996d86d185f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Fri, 21 Oct 2022 16:44:09 +0200 Subject: [PATCH 070/175] Fixing sln --- OrchardCore.sln | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/OrchardCore.sln b/OrchardCore.sln index 6b0a0870de2..1cab73b0ab2 100644 --- a/OrchardCore.sln +++ b/OrchardCore.sln @@ -484,7 +484,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OrchardCore.Media.AmazonS3" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OrchardCore.ArchiveLater", "src\OrchardCore.Modules\OrchardCore.ArchiveLater\OrchardCore.ArchiveLater.csproj", "{190C4BEB-C506-4F7F-BDCA-93F3C1C221BC}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OrchardCore.Features.Core", "src\OrchardCore\OrchardCore.Features.Core\OrchardCore.Features.Core.csproj", "{122EC0DA-A593-4038-BD21-2D4A7061F348}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OrchardCore.Features.Core", "src\OrchardCore\OrchardCore.Features.Core\OrchardCore.Features.Core.csproj", "{122EC0DA-A593-4038-BD21-2D4A7061F348}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OrchardCore.Search", "src\OrchardCore.Modules\OrchardCore.Search\OrchardCore.Search.csproj", "{7BDF280B-70B7-4AFC-A6F7-B5759DCA2A2C}" EndProject @@ -1299,10 +1299,6 @@ Global {FF1C550C-6D30-499A-AF11-68DE7C8B6869}.Debug|Any CPU.Build.0 = Debug|Any CPU {FF1C550C-6D30-499A-AF11-68DE7C8B6869}.Release|Any CPU.ActiveCfg = Release|Any CPU {FF1C550C-6D30-499A-AF11-68DE7C8B6869}.Release|Any CPU.Build.0 = Release|Any CPU - {A6563050-EE6D-4E7C-81AA-C383DB3ED124}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A6563050-EE6D-4E7C-81AA-C383DB3ED124}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A6563050-EE6D-4E7C-81AA-C383DB3ED124}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A6563050-EE6D-4E7C-81AA-C383DB3ED124}.Release|Any CPU.Build.0 = Release|Any CPU {190C4BEB-C506-4F7F-BDCA-93F3C1C221BC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {190C4BEB-C506-4F7F-BDCA-93F3C1C221BC}.Debug|Any CPU.Build.0 = Debug|Any CPU {190C4BEB-C506-4F7F-BDCA-93F3C1C221BC}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -1315,6 +1311,7 @@ Global {7BDF280B-70B7-4AFC-A6F7-B5759DCA2A2C}.Debug|Any CPU.Build.0 = Debug|Any CPU {7BDF280B-70B7-4AFC-A6F7-B5759DCA2A2C}.Release|Any CPU.ActiveCfg = Release|Any CPU {7BDF280B-70B7-4AFC-A6F7-B5759DCA2A2C}.Release|Any CPU.Build.0 = Release|Any CPU + {BC3553BF-B9C9-4BE9-B09B-5F69524A44AA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {BC3553BF-B9C9-4BE9-B09B-5F69524A44AA}.Debug|Any CPU.Build.0 = Debug|Any CPU {BC3553BF-B9C9-4BE9-B09B-5F69524A44AA}.Release|Any CPU.ActiveCfg = Release|Any CPU {BC3553BF-B9C9-4BE9-B09B-5F69524A44AA}.Release|Any CPU.Build.0 = Release|Any CPU From d15e1a0aa77aa2b4cf6df47361a3a2b313bcd766 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Wed, 26 Oct 2022 18:29:51 +0200 Subject: [PATCH 071/175] Updating Lombiq.Tests.UI* --- src/OrchardCore.Build/Dependencies.props | 6 +++--- test/OrchardCore.Tests.UI/Tests/SaaSRecipeTests.cs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/OrchardCore.Build/Dependencies.props b/src/OrchardCore.Build/Dependencies.props index 6a673507736..8d4b0ae5651 100644 --- a/src/OrchardCore.Build/Dependencies.props +++ b/src/OrchardCore.Build/Dependencies.props @@ -26,9 +26,9 @@ - - - + + + diff --git a/test/OrchardCore.Tests.UI/Tests/SaaSRecipeTests.cs b/test/OrchardCore.Tests.UI/Tests/SaaSRecipeTests.cs index a21390966f0..2ea145b32cc 100644 --- a/test/OrchardCore.Tests.UI/Tests/SaaSRecipeTests.cs +++ b/test/OrchardCore.Tests.UI/Tests/SaaSRecipeTests.cs @@ -42,7 +42,7 @@ public Task BasicOrchardFeaturesShouldWorkWithNewTenant(Browser browser) => { await context.SignInDirectlyAsync(); - await context.CreateAndChangeToTenantManuallyAsync("test", "test"); + await context.CreateAndSwitchToTenantManuallyAsync("test", "test"); await context.GoToSetupPageAndSetupOrchardCoreAsync( new OrchardCoreSetupParameters(context) From 826fc6d337c4b36c96c8248d1aa02e447c0e971f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Wed, 26 Oct 2022 18:30:34 +0200 Subject: [PATCH 072/175] Trying installation of service containers --- .github/workflows/pr_ci.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/.github/workflows/pr_ci.yml b/.github/workflows/pr_ci.yml index a053af345f9..3af150e735f 100644 --- a/.github/workflows/pr_ci.yml +++ b/.github/workflows/pr_ci.yml @@ -13,6 +13,34 @@ jobs: matrix: os: [ubuntu-latest, windows-latest] name: Build & Test + services: + postgres: + image: postgres:11 + env: + POSTGRES_USER: postgres + POSTGRES_PASSWORD: admin + POSTGRES_DB: app + # Set health checks to wait until postgres has started + options: >- + --health-cmd pg_isready + --health-interval 10s + --health-timeout 5s + --health-retries 5 + mariadb: + image: mariadb:latest + ports: + - 3306 + env: + MYSQL_DATABASE: test + MYSQL_ROOT_PASSWORD: test123 + options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3 + mssql: + image: mcr.microsoft.com/mssql/server:2019-latest + ports: + - 1433 + env: + ACCEPT_EULA: Y + MSSQL_SA_PASSWORD: Password12! steps: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 From 282b166eea8962abfd97149de0656947cde2168d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Wed, 26 Oct 2022 18:37:30 +0200 Subject: [PATCH 073/175] Revert "Trying installation of service containers" This reverts commit 826fc6d337c4b36c96c8248d1aa02e447c0e971f. --- .github/workflows/pr_ci.yml | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/.github/workflows/pr_ci.yml b/.github/workflows/pr_ci.yml index 3af150e735f..a053af345f9 100644 --- a/.github/workflows/pr_ci.yml +++ b/.github/workflows/pr_ci.yml @@ -13,34 +13,6 @@ jobs: matrix: os: [ubuntu-latest, windows-latest] name: Build & Test - services: - postgres: - image: postgres:11 - env: - POSTGRES_USER: postgres - POSTGRES_PASSWORD: admin - POSTGRES_DB: app - # Set health checks to wait until postgres has started - options: >- - --health-cmd pg_isready - --health-interval 10s - --health-timeout 5s - --health-retries 5 - mariadb: - image: mariadb:latest - ports: - - 3306 - env: - MYSQL_DATABASE: test - MYSQL_ROOT_PASSWORD: test123 - options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3 - mssql: - image: mcr.microsoft.com/mssql/server:2019-latest - ports: - - 1433 - env: - ACCEPT_EULA: Y - MSSQL_SA_PASSWORD: Password12! steps: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 From 2384df13c274fca4eb705df4bafbf5370716a89f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Wed, 26 Oct 2022 18:43:13 +0200 Subject: [PATCH 074/175] Simplifying build --- .github/actions/ui-tests/action.yml | 12 +++++++----- .github/workflows/pr_ci.yml | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/actions/ui-tests/action.yml b/.github/actions/ui-tests/action.yml index 81228d601b8..e92877b155c 100644 --- a/.github/actions/ui-tests/action.yml +++ b/.github/actions/ui-tests/action.yml @@ -2,7 +2,7 @@ name: UI Tests description: Runs UI tests and publishes the failure dumps as an artifact on test failure. inputs: - os-name: + artifact-name-suffix: description: The name of the OS used for the runner (e.g. "ubuntu-latest"). required: true @@ -14,18 +14,20 @@ runs: run: | dotnet test -c Release --no-restore --no-build ./test/OrchardCore.Tests.UI/OrchardCore.Tests.UI.csproj - uses: actions/upload-artifact@v2 - if: failure() && hashFiles('test/OrchardCore.Tests.UI/bin/Release/*/FailureDumps') + if: success() || failure() with: - name: ui-test-failure-${{ inputs.os-name }} + name: ui-test-failure-${{ inputs.artifact-name-suffix }} path: | test/OrchardCore.Tests.UI/bin/Release/*/FailureDumps + if-no-files-found: ignore - name: MVC UI Tests shell: bash run: | dotnet test -c Release --no-restore --no-build ./test/OrchardCore.Tests.UI.Mvc/OrchardCore.Tests.UI.Mvc.csproj - uses: actions/upload-artifact@v2 - if: failure() && hashFiles('test/OrchardCore.Tests.UI.Mvc/bin/Release/*/FailureDumps') + if: success() || failure() with: - name: mvc-ui-test-failure-${{ inputs.os-name }} + name: mvc-ui-test-failure-${{ inputs.artifact-name-suffix}} path: | test/OrchardCore.Tests.UI.Mvc/bin/Release/*/FailureDumps + if-no-files-found: ignore \ No newline at end of file diff --git a/.github/workflows/pr_ci.yml b/.github/workflows/pr_ci.yml index a053af345f9..c9c05606549 100644 --- a/.github/workflows/pr_ci.yml +++ b/.github/workflows/pr_ci.yml @@ -31,4 +31,4 @@ jobs: - name: UI Tests uses: ./.github/actions/ui-tests with: - os-name: ${{ matrix.os }} + artifact-name-suffix: ${{ matrix.os }} From 2bf138b795b029f0e83d3145c7abcb52e39417d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Wed, 26 Oct 2022 20:35:42 +0200 Subject: [PATCH 075/175] Using the Lombiq GitHub actions test-dotnet action to run UI tests, not to reinvent the wheel --- .github/actions/ui-tests/action.yml | 1 + .github/workflows/pr_ci.yml | 10 +++++--- .../OrchardCore.Tests.UI.Mvc.sln | 25 +++++++++++++++++++ .../OrchardCore.Tests.UI.sln | 25 +++++++++++++++++++ 4 files changed, 58 insertions(+), 3 deletions(-) create mode 100644 test/OrchardCore.Tests.UI.Mvc/OrchardCore.Tests.UI.Mvc.sln create mode 100644 test/OrchardCore.Tests.UI/OrchardCore.Tests.UI.sln diff --git a/.github/actions/ui-tests/action.yml b/.github/actions/ui-tests/action.yml index e92877b155c..9773fa9b339 100644 --- a/.github/actions/ui-tests/action.yml +++ b/.github/actions/ui-tests/action.yml @@ -1,3 +1,4 @@ +# To be refactored, need to check how DRY can work in the end. name: UI Tests description: Runs UI tests and publishes the failure dumps as an artifact on test failure. diff --git a/.github/workflows/pr_ci.yml b/.github/workflows/pr_ci.yml index c9c05606549..d62de3bf094 100644 --- a/.github/workflows/pr_ci.yml +++ b/.github/workflows/pr_ci.yml @@ -28,7 +28,11 @@ jobs: - name: Unit Tests run: | dotnet test -c Release --no-restore --no-build ./test/OrchardCore.Tests/OrchardCore.Tests.csproj - - name: UI Tests - uses: ./.github/actions/ui-tests + - name: CMS UI Tests + uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@dev with: - artifact-name-suffix: ${{ matrix.os }} + build-directory: test/OrchardCore.Tests.UI + - name: MVC UI Tests + uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@dev + with: + build-directory: test/OrchardCore.Tests.UI.Mvc diff --git a/test/OrchardCore.Tests.UI.Mvc/OrchardCore.Tests.UI.Mvc.sln b/test/OrchardCore.Tests.UI.Mvc/OrchardCore.Tests.UI.Mvc.sln new file mode 100644 index 00000000000..ddca45a4046 --- /dev/null +++ b/test/OrchardCore.Tests.UI.Mvc/OrchardCore.Tests.UI.Mvc.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.0.31903.59 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OrchardCore.Tests.UI.Mvc", "OrchardCore.Tests.UI.Mvc.csproj", "{7CE77458-A686-408A-98D5-6E0C29C469A9}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {7CE77458-A686-408A-98D5-6E0C29C469A9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7CE77458-A686-408A-98D5-6E0C29C469A9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7CE77458-A686-408A-98D5-6E0C29C469A9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7CE77458-A686-408A-98D5-6E0C29C469A9}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {D84ED0CF-D93B-43DC-A064-8FFE6C0C16FD} + EndGlobalSection +EndGlobal diff --git a/test/OrchardCore.Tests.UI/OrchardCore.Tests.UI.sln b/test/OrchardCore.Tests.UI/OrchardCore.Tests.UI.sln new file mode 100644 index 00000000000..26402c557e1 --- /dev/null +++ b/test/OrchardCore.Tests.UI/OrchardCore.Tests.UI.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.0.31903.59 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OrchardCore.Tests.UI", "OrchardCore.Tests.UI.csproj", "{8F87345E-F88D-4EEC-8167-D575E64F9A72}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {8F87345E-F88D-4EEC-8167-D575E64F9A72}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8F87345E-F88D-4EEC-8167-D575E64F9A72}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8F87345E-F88D-4EEC-8167-D575E64F9A72}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8F87345E-F88D-4EEC-8167-D575E64F9A72}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {170EBED0-4781-43B5-8E5B-A09C84EDC4B2} + EndGlobalSection +EndGlobal From 41a5b3eba5d726f4207fa497d13baa55d9a46fd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Wed, 26 Oct 2022 20:45:06 +0200 Subject: [PATCH 076/175] Removing ExecuteTestAfterSetupAsync() support since we can't have that with all the DB engines not supporting snapshots --- .../Helpers/SetupHelpers.cs | 30 ------------------- .../Tests/SaaSRecipeTests.cs | 11 ++++++- test/OrchardCore.Tests.UI/UITestBase.cs | 10 +++++-- 3 files changed, 17 insertions(+), 34 deletions(-) delete mode 100644 test/OrchardCore.Tests.UI/Helpers/SetupHelpers.cs diff --git a/test/OrchardCore.Tests.UI/Helpers/SetupHelpers.cs b/test/OrchardCore.Tests.UI/Helpers/SetupHelpers.cs deleted file mode 100644 index 89748f9f29d..00000000000 --- a/test/OrchardCore.Tests.UI/Helpers/SetupHelpers.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System; -using System.Threading.Tasks; -using Lombiq.Tests.UI.Extensions; -using Lombiq.Tests.UI.Pages; -using Lombiq.Tests.UI.Services; -using OpenQA.Selenium; - -namespace OrchardCore.Tests.UI.Helpers -{ - public static class SetupHelpers - { - public const string RecipeId = "SaaS.Tests"; - - public static async Task RunSetupAsync(UITestContext context) - { - var homepageUri = await context.GoToSetupPageAndSetupOrchardCoreAsync( - new OrchardCoreSetupParameters(context) - { - SiteName = "Orchard Core - UI Testing", - RecipeId = RecipeId, - TablePrefix = "oc", - SiteTimeZoneValue = "America/New_York", - }); - - context.Exists(By.Id("navbar")); - - return homepageUri; - } - } -} diff --git a/test/OrchardCore.Tests.UI/Tests/SaaSRecipeTests.cs b/test/OrchardCore.Tests.UI/Tests/SaaSRecipeTests.cs index 2ea145b32cc..f53102f4de1 100644 --- a/test/OrchardCore.Tests.UI/Tests/SaaSRecipeTests.cs +++ b/test/OrchardCore.Tests.UI/Tests/SaaSRecipeTests.cs @@ -37,9 +37,18 @@ await context.TestSetupWithInvalidAndValidDataAsync(new OrchardCoreSetupParamete [Theory, Chrome] public Task BasicOrchardFeaturesShouldWorkWithNewTenant(Browser browser) => - ExecuteTestAfterSetupAsync( + ExecuteTestAsync( async context => { + await context.GoToSetupPageAndSetupOrchardCoreAsync( + new OrchardCoreSetupParameters(context) + { + SiteName = "Orchard Core - UI Testing", + RecipeId = "SaaS.Tests", + TablePrefix = "default", + SiteTimeZoneValue = "America/New_York", + }); + await context.SignInDirectlyAsync(); await context.CreateAndSwitchToTenantManuallyAsync("test", "test"); diff --git a/test/OrchardCore.Tests.UI/UITestBase.cs b/test/OrchardCore.Tests.UI/UITestBase.cs index d2caefec571..c13b2875100 100644 --- a/test/OrchardCore.Tests.UI/UITestBase.cs +++ b/test/OrchardCore.Tests.UI/UITestBase.cs @@ -2,7 +2,6 @@ using System.Threading.Tasks; using Lombiq.Tests.UI; using Lombiq.Tests.UI.Services; -using OrchardCore.Tests.UI.Helpers; using Xunit.Abstractions; namespace OrchardCore.Tests.UI @@ -17,8 +16,13 @@ protected UITestBase(ITestOutputHelper testOutputHelper) protected override Task ExecuteTestAfterSetupAsync( Func testAsync, Browser browser, - Func changeConfigurationAsync) => - ExecuteTestAsync(testAsync, browser, SetupHelpers.RunSetupAsync, changeConfigurationAsync); + Func changeConfigurationAsync) + { + throw new NotSupportedException( + "Since these tests are run for all database engines supported by Orchard Core, and setup snapshotting " + + "required by this method is only supported for SQLite and SQL Server by the UI Testing Toolbox, this " + + "isn't supported. Run the applicable setup operation in the test instead."); + } protected override Task ExecuteTestAsync( Func testAsync, From e9c8a13cd0cad0084464871f0a606ce47e234d6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Wed, 26 Oct 2022 23:17:10 +0200 Subject: [PATCH 077/175] Referencing test-dotnet with fork check --- .github/workflows/pr_ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr_ci.yml b/.github/workflows/pr_ci.yml index d62de3bf094..dc62dca0549 100644 --- a/.github/workflows/pr_ci.yml +++ b/.github/workflows/pr_ci.yml @@ -29,10 +29,10 @@ jobs: run: | dotnet test -c Release --no-restore --no-build ./test/OrchardCore.Tests/OrchardCore.Tests.csproj - name: CMS UI Tests - uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@dev + uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@issue/OSOE-407 with: build-directory: test/OrchardCore.Tests.UI - name: MVC UI Tests - uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@dev + uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@issue/OSOE-407 with: build-directory: test/OrchardCore.Tests.UI.Mvc From 8359e9f7b0481a57aa23b5442a47ac2ec6182b85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Thu, 27 Oct 2022 01:12:19 +0200 Subject: [PATCH 078/175] Adding Blob Storage test --- .github/workflows/pr_ci.yml | 12 ++++--- .../Tests/AzureBlobStorageTests.cs | 34 +++++++++++++++++++ 2 files changed, 42 insertions(+), 4 deletions(-) create mode 100644 test/OrchardCore.Tests.UI/Tests/AzureBlobStorageTests.cs diff --git a/.github/workflows/pr_ci.yml b/.github/workflows/pr_ci.yml index dc62dca0549..af58bd0a8ae 100644 --- a/.github/workflows/pr_ci.yml +++ b/.github/workflows/pr_ci.yml @@ -28,11 +28,15 @@ jobs: - name: Unit Tests run: | dotnet test -c Release --no-restore --no-build ./test/OrchardCore.Tests/OrchardCore.Tests.csproj - - name: CMS UI Tests - uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@issue/OSOE-407 - with: - build-directory: test/OrchardCore.Tests.UI - name: MVC UI Tests uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@issue/OSOE-407 with: build-directory: test/OrchardCore.Tests.UI.Mvc + - name: Set up Azurite + uses: Lombiq/GitHub-Actions/.github/actions/setup-azurite@dev + with: + location: ${{ inputs.build-directory}} + - name: CMS UI Tests - SQLite + uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@issue/OSOE-407 + with: + build-directory: test/OrchardCore.Tests.UI diff --git a/test/OrchardCore.Tests.UI/Tests/AzureBlobStorageTests.cs b/test/OrchardCore.Tests.UI/Tests/AzureBlobStorageTests.cs new file mode 100644 index 00000000000..c77d76ff982 --- /dev/null +++ b/test/OrchardCore.Tests.UI/Tests/AzureBlobStorageTests.cs @@ -0,0 +1,34 @@ +using System.Threading.Tasks; +using Lombiq.Tests.UI.Attributes; +using Lombiq.Tests.UI.Extensions; +using Lombiq.Tests.UI.Services; +using Xunit; +using Xunit.Abstractions; + +namespace OrchardCore.Tests.UI.Tests +{ + public class AzureBlobStorageTests : UITestBase + { + public AzureBlobStorageTests(ITestOutputHelper testOutputHelper) + : base(testOutputHelper) + { + } + + [Theory, Chrome] + public Task BasicOrchardFeaturesShouldWorkWithBlogAndAzureBlobStorage(Browser browser) => + ExecuteTestAsync( + context => context.TestBasicOrchardFeaturesAsync("Blog.Tests"), + browser, + configuration => + { + configuration.UseAzureBlobStorage = true; + + configuration.AccessibilityCheckingConfiguration.AxeBuilderConfigurator += axeBuilder => + AccessibilityCheckingConfiguration + .ConfigureWcag21aa(axeBuilder) + .DisableRules("color-contrast"); + + return Task.CompletedTask; + }); + } +} From 0886b054723cf14361dc859f13dd27af389813cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Thu, 27 Oct 2022 01:30:41 +0200 Subject: [PATCH 079/175] Fixing copy-paste error --- .github/workflows/pr_ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr_ci.yml b/.github/workflows/pr_ci.yml index af58bd0a8ae..122b3771791 100644 --- a/.github/workflows/pr_ci.yml +++ b/.github/workflows/pr_ci.yml @@ -35,7 +35,7 @@ jobs: - name: Set up Azurite uses: Lombiq/GitHub-Actions/.github/actions/setup-azurite@dev with: - location: ${{ inputs.build-directory}} + location: test/OrchardCore.Tests.UI - name: CMS UI Tests - SQLite uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@issue/OSOE-407 with: From ac80b8350a79eceb5252442958ce81e87d44500d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Thu, 27 Oct 2022 01:33:58 +0200 Subject: [PATCH 080/175] Adding monkey test for the admin --- .../Tests/AdminMonkeyTests.cs | 65 +++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 test/OrchardCore.Tests.UI/Tests/AdminMonkeyTests.cs diff --git a/test/OrchardCore.Tests.UI/Tests/AdminMonkeyTests.cs b/test/OrchardCore.Tests.UI/Tests/AdminMonkeyTests.cs new file mode 100644 index 00000000000..2aa269c0765 --- /dev/null +++ b/test/OrchardCore.Tests.UI/Tests/AdminMonkeyTests.cs @@ -0,0 +1,65 @@ +using System; +using System.Linq; +using System.Threading.Tasks; +using Atata; +using Lombiq.Tests.UI.Attributes; +using Lombiq.Tests.UI.Extensions; +using Lombiq.Tests.UI.MonkeyTesting; +using Lombiq.Tests.UI.Pages; +using Lombiq.Tests.UI.Services; +using OpenQA.Selenium; +using Shouldly; +using Xunit; +using Xunit.Abstractions; + +namespace OrchardCore.Tests.UI.Tests +{ + public class AdminMonkeyTests : UITestBase + { + public AdminMonkeyTests(ITestOutputHelper testOutputHelper) + : base(testOutputHelper) + { + } + + [Theory, Chrome] + public Task TestAdminPagesAsMonkeyRecursivelyShouldWorkWithAdminUser(Browser browser) => + ExecuteTestAsync( + async context => + { + await context.GoToSetupPageAndSetupOrchardCoreAsync( + new OrchardCoreSetupParameters(context) + { + SiteName = "Orchard Core - UI Testing", + RecipeId = "Blog.Tests", + TablePrefix = "default", + SiteTimeZoneValue = "America/New_York", + }); + + await context.TestAdminAsMonkeyRecursivelyAsync( + new MonkeyTestingOptions + { + PageTestTime = TimeSpan.FromSeconds(10) + }, + startingRelativeUrl: "/"); + }, + browser, + configuration => + { + configuration.AccessibilityCheckingConfiguration.RunAccessibilityCheckingAssertionOnAllPageChanges = false; + + // This is necessary to work around this bug: https://github.com/OrchardCMS/OrchardCore/issues/11420. + configuration.AssertBrowserLog = logEntries => logEntries.ShouldNotContain( + logEntry => IsValidAdminBrowserLogEntry(logEntry), + logEntries.Where(IsValidAdminBrowserLogEntry).ToFormattedString()); + + return Task.CompletedTask; + }); + + private static bool IsValidAdminBrowserLogEntry(LogEntry logEntry) + { + return OrchardCoreUITestExecutorConfiguration.IsValidBrowserLogEntry(logEntry) && + !logEntry.Message.ContainsOrdinalIgnoreCase( + "Blocked attempt to show a 'beforeunload' confirmation panel for a frame that never had a user gesture since its load."); + } + } +} From 5397c14958e3a87a9b990b9511a64a793cdc645b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Thu, 27 Oct 2022 01:47:52 +0200 Subject: [PATCH 081/175] Updating Lombiq.Tests.UI* packages --- src/OrchardCore.Build/Dependencies.props | 6 +++--- test/OrchardCore.Tests.UI/Tests/AdminMonkeyTests.cs | 3 +-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/OrchardCore.Build/Dependencies.props b/src/OrchardCore.Build/Dependencies.props index 8d4b0ae5651..b8a869b353b 100644 --- a/src/OrchardCore.Build/Dependencies.props +++ b/src/OrchardCore.Build/Dependencies.props @@ -26,9 +26,9 @@ - - - + + + diff --git a/test/OrchardCore.Tests.UI/Tests/AdminMonkeyTests.cs b/test/OrchardCore.Tests.UI/Tests/AdminMonkeyTests.cs index 2aa269c0765..e22301f2a65 100644 --- a/test/OrchardCore.Tests.UI/Tests/AdminMonkeyTests.cs +++ b/test/OrchardCore.Tests.UI/Tests/AdminMonkeyTests.cs @@ -39,8 +39,7 @@ await context.TestAdminAsMonkeyRecursivelyAsync( new MonkeyTestingOptions { PageTestTime = TimeSpan.FromSeconds(10) - }, - startingRelativeUrl: "/"); + }); }, browser, configuration => From 87698fff7ff8f0b56b52b6cec4bbe65bc7d600d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Thu, 27 Oct 2022 23:36:13 +0200 Subject: [PATCH 082/175] Removing BasicOrchardFeaturesTesting stuff for now; will probably need to re-add later, at an updated state --- ...dFeaturesTestingUITestContextExtensions.cs | 476 ------------------ .../Pages/OrchardCoreAdminPage.cs | 28 -- .../Pages/OrchardCoreContentItemsPage.cs | 41 -- .../Pages/OrchardCoreDashboardPage.cs | 14 - .../Pages/OrchardCoreFeaturesPage.cs | 66 --- .../Pages/OrchardCoreLoginPage.cs | 53 -- .../Pages/OrchardCoreNewPageItemPage.cs | 18 - .../Pages/OrchardCoreRegistrationPage.cs | 64 --- .../Pages/OrchardCoreSetupPage.cs | 126 ----- .../Pages/OrchardCoreSetupParameters.cs | 34 -- 10 files changed, 920 deletions(-) delete mode 100644 test/OrchardCore.Tests.UI/Extensions/BasicOrchardFeaturesTestingUITestContextExtensions.cs delete mode 100644 test/OrchardCore.Tests.UI/Pages/OrchardCoreAdminPage.cs delete mode 100644 test/OrchardCore.Tests.UI/Pages/OrchardCoreContentItemsPage.cs delete mode 100644 test/OrchardCore.Tests.UI/Pages/OrchardCoreDashboardPage.cs delete mode 100644 test/OrchardCore.Tests.UI/Pages/OrchardCoreFeaturesPage.cs delete mode 100644 test/OrchardCore.Tests.UI/Pages/OrchardCoreLoginPage.cs delete mode 100644 test/OrchardCore.Tests.UI/Pages/OrchardCoreNewPageItemPage.cs delete mode 100644 test/OrchardCore.Tests.UI/Pages/OrchardCoreRegistrationPage.cs delete mode 100644 test/OrchardCore.Tests.UI/Pages/OrchardCoreSetupPage.cs delete mode 100644 test/OrchardCore.Tests.UI/Pages/OrchardCoreSetupParameters.cs diff --git a/test/OrchardCore.Tests.UI/Extensions/BasicOrchardFeaturesTestingUITestContextExtensions.cs b/test/OrchardCore.Tests.UI/Extensions/BasicOrchardFeaturesTestingUITestContextExtensions.cs deleted file mode 100644 index f09b2dff099..00000000000 --- a/test/OrchardCore.Tests.UI/Extensions/BasicOrchardFeaturesTestingUITestContextExtensions.cs +++ /dev/null @@ -1,476 +0,0 @@ -using System; -using System.Threading.Tasks; -using Atata; -using Lombiq.Tests.UI.Constants; -using Lombiq.Tests.UI.Extensions; -using Lombiq.Tests.UI.Models; -using Lombiq.Tests.UI.Services; -using OrchardCore.Tests.UI.Pages; -using Shouldly; - -namespace OrchardCore.Tests.UI.Extensions -{ - /// - /// Provides a set of extension methods for basic Orchard features testing. - /// - public static class BasicOrchardFeaturesTestingUITestContextExtensions - { - /// - /// - /// Tests all the basic Orchard features. At first sets up Orchard with the recipe with the specified - /// . - /// - /// - /// The test method assumes that the site is not set up. - /// - /// - /// The ID of the recipe to be used to set up the site. - /// The same instance. - public static Task TestBasicOrchardFeaturesInternalAsync(this UITestContext context, string setupRecipeId) => - context.TestBasicOrchardFeaturesInternalAsync(new OrchardCoreSetupParameters(context) - { - RecipeId = setupRecipeId, - }); - - /// - /// - /// Tests all the basic Orchard features. At first sets up Orchard with optionally specified - /// . By default uses new instance - /// with "SaaS" value. - /// - /// - /// The test method assumes that the site is not set up. - /// - /// - /// The setup parameters. - /// The same instance. - public static async Task TestBasicOrchardFeaturesInternalAsync( - this UITestContext context, - OrchardCoreSetupParameters setupParameters = null) - { - await context.TestSetupWithInvalidDataInternalAsync(); - await context.TestSetupInternalAsync(setupParameters); - await context.TestRegistrationWithInvalidDataInternalAsync(); - await context.TestRegistrationInternalAsync(); - await context.TestRegistrationWithAlreadyRegisteredEmailInternalAsync(); - await context.TestLoginWithInvalidDataInternalAsync(); - await context.TestLoginInternalAsync(); - await context.TestContentOperationsInternalAsync(); - await context.TestTurningFeatureOnAndOffInternalAsync(); - await context.TestLogoutInternalAsync(); - } - - /// - /// - /// Tests all the basic Orchard features except for registration. At first sets up Orchard with the recipe with - /// the specified . - /// - /// - /// The test method assumes that the site is not set up. - /// - /// - /// The ID of the recipe to be used to set up the site. - /// The same instance. - public static Task TestBasicOrchardFeaturesExceptRegistrationInternalAsync(this UITestContext context, string setupRecipeId) => - context.TestBasicOrchardFeaturesExceptRegistrationInternalAsync(new OrchardCoreSetupParameters(context) - { - RecipeId = setupRecipeId, - }); - - /// - /// - /// Tests all the basic Orchard features except for registration. At first sets up Orchard with optionally - /// specified . By default uses new - /// instance with "SaaS" value. - /// - /// - /// The test method assumes that the site is not set up. - /// - /// - /// The setup parameters. - /// The same instance. - public static async Task TestBasicOrchardFeaturesExceptRegistrationInternalAsync( - this UITestContext context, - OrchardCoreSetupParameters setupParameters = null) - { - await context.TestSetupWithInvalidDataInternalAsync(); - await context.TestSetupInternalAsync(setupParameters); - await context.TestLoginWithInvalidDataInternalAsync(); - await context.TestLoginInternalAsync(); - await context.TestContentOperationsInternalAsync(); - await context.TestTurningFeatureOnAndOffInternalAsync(); - await context.TestLogoutInternalAsync(); - } - - /// - /// - /// Tests the site setup with the recipe with the specified . - /// - /// - /// The test method assumes that the site is not set up. - /// - /// - /// The ID of the recipe to be used to set up the site. - /// The same instance. - public static Task TestSetupInternalAsync(this UITestContext context, string setupRecipeId) => - context.TestSetupInternalAsync(new OrchardCoreSetupParameters(context) - { - RecipeId = setupRecipeId, - }); - - /// - /// - /// Tests the site setup with optionally set . - /// By default uses new instance - /// with "SaaS" value. - /// - /// - /// The test method assumes that the site is not set up. - /// - /// - /// The setup parameters. - /// The same instance. - public static Task TestSetupInternalAsync(this UITestContext context, OrchardCoreSetupParameters setupParameters = null) - { - setupParameters ??= new OrchardCoreSetupParameters(context); - - return context.ExecuteTestInternalAsync( - "Test setup", - async () => - { - var setupPage = await context.GoToPageAsync(); - (await setupPage.SetupOrchardCoreAsync(context, setupParameters)).ShouldLeaveSetupPage(); - }); - } - - /// - /// - /// Tests the site setup negatively with optionally set . - /// By default uses new instance - /// with empty values of properties: , - /// , - /// and . - /// - /// - /// The test method assumes that the site is not set up. - /// - /// - /// The setup parameters. - /// The same instance. - public static Task TestSetupWithInvalidDataInternalAsync( - this UITestContext context, - OrchardCoreSetupParameters setupParameters = null) - { - setupParameters ??= new OrchardCoreSetupParameters(context) - { - SiteName = string.Empty, - UserName = string.Empty, - Email = string.Empty, - Password = string.Empty, - }; - - return context.ExecuteTestInternalAsync( - "Test setup with invalid data", - async () => - { - var setupPage = await context.GoToPageAsync(); - (await setupPage.SetupOrchardCoreAsync(context, setupParameters)).ShouldStayOnSetupPage(); - }); - } - - /// - /// - /// Tests the login with the specified and values. - /// - /// - /// The test method assumes that there is a registered user with the given credentials. - /// - /// - /// The user name. - /// The password. - /// The same instance. - public static Task TestLoginInternalAsync( - this UITestContext context, - string userName = DefaultUser.UserName, - string password = DefaultUser.Password) => - context.ExecuteTestInternalAsync( - "Test login", - async () => - { - var loginPage = await context.GoToPageAsync(); - (await loginPage.LogInWithAsync(context, userName, password)).ShouldLeaveLoginPage(); - - (await context.GetCurrentUserNameAsync()).ShouldBe(userName); - }); - - /// - /// - /// Tests the login negatively with the specified and values. - /// - /// - /// The test method assumes that there is no registered user with the given credentials. - /// - /// - /// The user name. - /// The password. - /// The same instance. - public static Task TestLoginWithInvalidDataInternalAsync( - this UITestContext context, - string userName = DefaultUser.UserName, - string password = "WrongPass!") => - context.ExecuteTestInternalAsync( - "Test login with invalid data", - async () => - { - await context.SignOutDirectlyAsync(); - - var loginPage = await context.GoToPageAsync(); - (await loginPage.LogInWithAsync(context, userName, password)) - .ShouldStayOnLoginPage() - .ValidationSummaryErrors.Should.Not.BeEmpty(); - - (await context.GetCurrentUserNameAsync()).ShouldBeEmpty(); - }); - - /// - /// - /// Tests the logout. - /// - /// - /// The test method assumes that there is currently a logged in admin user session. - /// - /// - /// The same instance. - public static Task TestLogoutInternalAsync(this UITestContext context) => - context.ExecuteTestAsync( - "Test logout", - async () => - { - var dashboard = await context.GoToPageAsync(); - - context.RefreshCurrentAtataContext(); - - dashboard - .TopNavbar.Account.LogOff.Click() - .ShouldLeaveAdminPage(); - - await context.TriggerAfterPageChangeEventAsync(); - - (await context.GetCurrentUserNameAsync()).ShouldBeNullOrEmpty(); - }); - - /// - /// - /// Tests the user registration with optionally specified . After the user is - /// registered, the test performs login with the user credentials, then logout. - /// - /// - /// The test method assumes that the "Users Registration" Orchard feature is enabled and there is no registered - /// user with the given values of or . - /// - /// - /// The user registration parameters. - /// The same instance. - public static Task TestRegistrationInternalAsync(this UITestContext context, UserRegistrationParameters parameters = null) - { - parameters ??= UserRegistrationParameters.CreateDefault(); - - return context.ExecuteTestAsync( - "Test registration", - async () => - { - var loginPage = await context.GoToPageAsync(); - context.RefreshCurrentAtataContext(); - var registrationPage = await loginPage - .RegisterAsNewUser.Should.BeVisible() - .RegisterAsNewUser.ClickAndGo() - .RegisterWithAsync(context, parameters); - registrationPage.ShouldLeaveRegistrationPage(); - - (await context.GetCurrentUserNameAsync()).ShouldBe(parameters.UserName); - await context.SignOutDirectlyAsync(); - - loginPage = await context.GoToPageAsync(); - await loginPage.LogInWithAsync(context, parameters.UserName, parameters.Password); - await context.TriggerAfterPageChangeEventAsync(); - (await context.GetCurrentUserNameAsync()).ShouldBe(parameters.UserName); - await context.SignOutDirectlyAsync(); - }); - } - - /// - /// - /// Tests the user registration negatively with optionally specified invalid . - /// Fills user registration fields with on registration page, clicks "Register" - /// button and verifies that there are validation messages on the page. - /// - /// - /// The test method assumes that the "Users Registration" Orchard feature is enabled. - /// - /// - /// The user registration parameters. - /// The same instance. - public static Task TestRegistrationWithInvalidDataInternalAsync( - this UITestContext context, UserRegistrationParameters parameters = null) - { - parameters ??= new() - { - UserName = "InvalidUser", - Email = Randomizer.GetString("{0}@example.org", 25), - Password = "short", - ConfirmPassword = "short", - }; - - return context.ExecuteTestInternalAsync( - "Test registration with invalid data", - async () => - { - var registrationPage = await context.GoToPageAsync(); - registrationPage = await registrationPage.RegisterWithAsync(context, parameters); - registrationPage.ShouldStayOnRegistrationPage().ValidationMessages.Should.Not.BeEmpty(); - }); - } - - /// - /// - /// Tests the user registration negatively with optionally specified that uses - /// email of the already registered user. Fills user registration fields with on - /// registration page, clicks "Register" button and verifies that there is a validation message near "Email" - /// field on the page. - /// - /// - /// The test method assumes that the "Users Registration" Orchard feature is enabled and there is an already - /// registered user with the given value. - /// - /// - /// The user registration parameters. - /// The same instance. - public static Task TestRegistrationWithAlreadyRegisteredEmailInternalAsync( - this UITestContext context, - UserRegistrationParameters parameters = null) - { - parameters ??= UserRegistrationParameters.CreateDefault(); - - return context.ExecuteTestInternalAsync( - "Test registration with already registered email", - async () => - { - var registrationPage = await context.GoToPageAsync(); - registrationPage = await registrationPage.RegisterWithAsync(context, parameters); - context.RefreshCurrentAtataContext(); - registrationPage - .ShouldStayOnRegistrationPage() - .ValidationMessages[page => page.Email].Should.BeVisible(); - }); - } - - /// - /// - /// Tests content operations. The test executes the following steps: - /// - /// - /// Navigate to the "Content / Content Items" page. - /// Create the page with the given . - /// Publish the page. - /// Verify that the page is created. - /// Navigate to view the published page. - /// Verify the page title and header. - /// - /// - /// The test method assumes that there is currently a logged in admin user session. - /// - /// - /// The page title to enter. - /// The same instance. - public static Task TestContentOperationsInternalAsync(this UITestContext context, string pageTitle = "Test page") => - context.ExecuteTestAsync( - "Test content operations", - async () => - { - var contentItemsPage = await context.GoToPageAsync(); - context.RefreshCurrentAtataContext(); - contentItemsPage - .CreateNewPage() - .Title.Set(pageTitle) - .Publish.ClickAndGo() - .AlertMessages.Should.Contain(message => message.IsSuccess) - .Items[item => item.Title == pageTitle].View.Click(); - - await context.TriggerAfterPageChangeEventAsync(); - - context.Scope.AtataContext.Go.ToNextWindow(new OrdinaryPage(pageTitle)) - .AggregateAssert(page => page - .PageTitle.Should.Contain(pageTitle) - .Find>().Should.Equal(pageTitle)) - .CloseWindow(); - }); - - /// - /// - /// Tests turning feature on and off. The test executes the following steps: - /// - /// - /// Navigate to the "Configuration / Features" page. - /// Search the feature with the given . - /// Read current feature enabled/disabled state. - /// Toggle the feature state. - /// Verify that the feature state is changed. - /// Toggle the feature state again. - /// Verify that the feature state is changed to the original. - /// - /// - /// The test method assumes that there is currently a logged in admin user session. - /// - /// - /// The name of the feature to use. - /// The same instance. - public static Task TestTurningFeatureOnAndOffInternalAsync( - this UITestContext context, string featureName = "Background Tasks") => - context.ExecuteTestInternalAsync( - "Test turning feature on and off", - async () => - { - var featuresPage = await context.GoToPageAsync(); - - context.RefreshCurrentAtataContext(); - - featuresPage - .SearchForFeature(featureName).IsEnabled.Get(out bool originalEnabledState) - .Features[featureName].CheckBox.Check() - .BulkActions.Toggle.Click() - - .AggregateAssert(page => page - .ShouldContainSuccessAlertMessage(TermMatch.Contains, featureName) - .AdminMenu.FindMenuItem(featureName).IsPresent.Should.Equal(!originalEnabledState) - .SearchForFeature(featureName).IsEnabled.Should.Equal(!originalEnabledState)) - .Features[featureName].CheckBox.Check() - .BulkActions.Toggle.Click() - - .AggregateAssert(page => page - .ShouldContainSuccessAlertMessage(TermMatch.Contains, featureName) - .AdminMenu.FindMenuItem(featureName).IsPresent.Should.Equal(originalEnabledState) - .SearchForFeature(featureName).IsEnabled.Should.Equal(originalEnabledState)); - }); - - /// - /// Executes the with the specified . - /// - /// The test name. - /// The test action. - /// The same instance. - public static Task ExecuteTestInternalAsync( - this UITestContext context, string testName, Func testFunctionAsync) - { - if (context is null) throw new ArgumentNullException(nameof(context)); - if (testName is null) throw new ArgumentNullException(nameof(testName)); - if (testFunctionAsync is null) throw new ArgumentNullException(nameof(testFunctionAsync)); - - return ExecuteTestInnerAsync(context, testName, testFunctionAsync); - } - - private static Task ExecuteTestInnerAsync( - UITestContext context, string testName, Func testFunctionAsync) => - context.ExecuteLoggedAsync(testName, testFunctionAsync); - } -} diff --git a/test/OrchardCore.Tests.UI/Pages/OrchardCoreAdminPage.cs b/test/OrchardCore.Tests.UI/Pages/OrchardCoreAdminPage.cs deleted file mode 100644 index 149f3a7e632..00000000000 --- a/test/OrchardCore.Tests.UI/Pages/OrchardCoreAdminPage.cs +++ /dev/null @@ -1,28 +0,0 @@ -using Atata; -using Lombiq.Tests.UI.Components; - -namespace OrchardCore.Tests.UI.Pages -{ - public abstract class OrchardCoreAdminPage : Page - where TOwner : OrchardCoreAdminPage - { - public OrchardCoreAdminTopNavbar TopNavbar { get; private set; } - - public OrchardCoreAdminMenu AdminMenu { get; private set; } - - public ControlList, TOwner> AlertMessages { get; private set; } - - public TOwner ShouldStayOnAdminPage() => AdminMenu.Should.Exist(); - - public TOwner ShouldLeaveAdminPage() => AdminMenu.Should.Not.Exist(); - - protected override void OnVerify() - { - base.OnVerify(); - ShouldStayOnAdminPage(); - } - - public TOwner ShouldContainSuccessAlertMessage(TermMatch expectedMatch, string expectedText) => - AlertMessages.Should.Contain(message => message.IsSuccess && expectedMatch.IsMatch(message.Text.Value, expectedText)); - } -} diff --git a/test/OrchardCore.Tests.UI/Pages/OrchardCoreContentItemsPage.cs b/test/OrchardCore.Tests.UI/Pages/OrchardCoreContentItemsPage.cs deleted file mode 100644 index 80919088ba1..00000000000 --- a/test/OrchardCore.Tests.UI/Pages/OrchardCoreContentItemsPage.cs +++ /dev/null @@ -1,41 +0,0 @@ -using Atata; -using Atata.Bootstrap; - -namespace OrchardCore.Tests.UI.Pages -{ - // Atata convention. -#pragma warning disable IDE0065 // Misplaced using directive - using _ = OrchardCoreContentItemsPage; -#pragma warning restore IDE0065 // Misplaced using directive - - [Url("Admin/Contents/ContentItems")] - public class OrchardCoreContentItemsPage : OrchardCoreAdminPage<_> - { - [FindById("new-dropdown")] - public NewItemDropdown NewDropdown { get; private set; } - - public Link<_> NewPageLink { get; private set; } - - [FindById("items-form")] - public UnorderedList Items { get; private set; } - - public OrchardCoreNewPageItemPage CreateNewPage() => - (NewPageLink.IsVisible ? NewPageLink : NewDropdown.Page) - .ClickAndGo(); - - public sealed class NewItemDropdown : BSDropdownToggle<_> - { - public Link<_> Page { get; private set; } - } - - [ControlDefinition("li[position() > 1]", ComponentTypeName = "item")] - public sealed class ContentListItem : ListItem<_> - { - [FindByXPath("a")] - public Text<_> Title { get; private set; } - - [FindByClass] - public Link<_> View { get; private set; } - } - } -} diff --git a/test/OrchardCore.Tests.UI/Pages/OrchardCoreDashboardPage.cs b/test/OrchardCore.Tests.UI/Pages/OrchardCoreDashboardPage.cs deleted file mode 100644 index 0ef0e26094f..00000000000 --- a/test/OrchardCore.Tests.UI/Pages/OrchardCoreDashboardPage.cs +++ /dev/null @@ -1,14 +0,0 @@ -using Atata; - -namespace OrchardCore.Tests.UI.Pages -{ - // Atata convention. -#pragma warning disable IDE0065 // Misplaced using directive - using _ = OrchardCoreDashboardPage; -#pragma warning restore IDE0065 // Misplaced using directive - - [Url("Admin")] - public sealed class OrchardCoreDashboardPage : OrchardCoreAdminPage<_> - { - } -} diff --git a/test/OrchardCore.Tests.UI/Pages/OrchardCoreFeaturesPage.cs b/test/OrchardCore.Tests.UI/Pages/OrchardCoreFeaturesPage.cs deleted file mode 100644 index f3cdb944a4a..00000000000 --- a/test/OrchardCore.Tests.UI/Pages/OrchardCoreFeaturesPage.cs +++ /dev/null @@ -1,66 +0,0 @@ -using Atata; -using Atata.Bootstrap; -using Lombiq.Tests.UI.Components; - -namespace OrchardCore.Tests.UI.Pages -{ - // Atata convention. -#pragma warning disable IDE0065 // Misplaced using directive - using _ = OrchardCoreFeaturesPage; -#pragma warning restore IDE0065 // Misplaced using directive - - [Url("Admin/Features")] - public sealed class OrchardCoreFeaturesPage : OrchardCoreAdminPage<_> - { - [FindById] - public SearchInput<_> SearchBox { get; private set; } - - [FindById("bulk-action-menu-button")] - public BulkActionsDropdown BulkActions { get; private set; } - - public FeatureItemList Features { get; private set; } - - public FeatureItem SearchForFeature(string featureName) => - SearchBox.Set(featureName) - .Features[featureName]; - - public sealed class BulkActionsDropdown : BSDropdownToggle<_> - { - public Link<_> Enable { get; private set; } - - public Link<_> Disable { get; private set; } - - public Link<_> Toggle { get; private set; } - } - - [ControlDefinition("li[not(contains(@class, 'd-none'))]", ContainingClass = "list-group-item", ComponentTypeName = "feature")] - public sealed class FeatureItem : Control<_> - { - [FindFirst(Visibility = Visibility.Any)] - [ClicksUsingActions] - public CheckBox<_> CheckBox { get; private set; } - - [FindByXPath("h6", "label")] - public Text<_> Name { get; private set; } - - [FindById(TermMatch.StartsWith, "btn-enable")] - public Link<_> Enable { get; private set; } - - [FindById(TermMatch.StartsWith, "btn-disable")] - [GoTemporarily] - public Link, _> Disable { get; private set; } - - public _ DisableWithConfirmation() => - Disable.ClickAndGo() - .Yes.ClickAndGo(); - - protected override bool GetIsEnabled() => !Enable.IsVisible; - } - - public sealed class FeatureItemList : ControlList - { - public FeatureItem this[string featureName] => - GetItem(featureName, item => item.Name == featureName); - } - } -} diff --git a/test/OrchardCore.Tests.UI/Pages/OrchardCoreLoginPage.cs b/test/OrchardCore.Tests.UI/Pages/OrchardCoreLoginPage.cs deleted file mode 100644 index 83a547854b5..00000000000 --- a/test/OrchardCore.Tests.UI/Pages/OrchardCoreLoginPage.cs +++ /dev/null @@ -1,53 +0,0 @@ -using System.Threading.Tasks; -using Atata; -using Lombiq.Tests.UI.Components; -using Lombiq.Tests.UI.Extensions; -using Lombiq.Tests.UI.Services; - -namespace OrchardCore.Tests.UI.Pages -{ - // Atata convention. -#pragma warning disable IDE0065 // Misplaced using directive - using _ = OrchardCoreLoginPage; -#pragma warning restore IDE0065 // Misplaced using directive - - [Url(DefaultUrl)] - [TermFindSettings(Case = TermCase.Pascal, TargetAllChildren = true, TargetAttributeType = typeof(FindByIdAttribute))] - public class OrchardCoreLoginPage : Page<_> - { - private const string DefaultUrl = "Login"; - - [FindById] - public TextInput<_> UserName { get; private set; } - - [FindById] - public PasswordInput<_> Password { get; private set; } - - [FindByAttribute("type", "submit")] - public Button<_> LogIn { get; private set; } - - [FindByAttribute("href", TermMatch.StartsWith, "/" + OrchardCoreRegistrationPage.DefaultUrl)] - public Link RegisterAsNewUser { get; private set; } - - public ValidationSummaryErrorList<_> ValidationSummaryErrors { get; private set; } - - public _ ShouldStayOnLoginPage() => - PageUrl.Should.StartWith(Context.BaseUrl + DefaultUrl); - - public _ ShouldLeaveLoginPage() => - PageUrl.Should.Not.StartWith(Context.BaseUrl + DefaultUrl); - - public async Task<_> LogInWithAsync(UITestContext context, string userName, string password) - { - var page = UserName.Set(userName) - .Password.Set(password) - .LogIn.Click(); - - await context.TriggerAfterPageChangeEventAndRefreshAtataContextAsync(); - - context.RefreshCurrentAtataContext(); - - return page; - } - } -} diff --git a/test/OrchardCore.Tests.UI/Pages/OrchardCoreNewPageItemPage.cs b/test/OrchardCore.Tests.UI/Pages/OrchardCoreNewPageItemPage.cs deleted file mode 100644 index 1ec01c7fbb5..00000000000 --- a/test/OrchardCore.Tests.UI/Pages/OrchardCoreNewPageItemPage.cs +++ /dev/null @@ -1,18 +0,0 @@ -using Atata; - -namespace OrchardCore.Tests.UI.Pages -{ - // Atata convention. -#pragma warning disable IDE0065 // Misplaced using directive - using _ = OrchardCoreNewPageItemPage; -#pragma warning restore IDE0065 // Misplaced using directive - - public class OrchardCoreNewPageItemPage : OrchardCoreAdminPage<_> - { - [FindByName("TitlePart.Title")] - public TextInput<_> Title { get; private set; } - - [FindByName("submit.Publish")] - public Button Publish { get; private set; } - } -} diff --git a/test/OrchardCore.Tests.UI/Pages/OrchardCoreRegistrationPage.cs b/test/OrchardCore.Tests.UI/Pages/OrchardCoreRegistrationPage.cs deleted file mode 100644 index ee15ef35a7c..00000000000 --- a/test/OrchardCore.Tests.UI/Pages/OrchardCoreRegistrationPage.cs +++ /dev/null @@ -1,64 +0,0 @@ -using System.Threading.Tasks; -using Atata; -using Lombiq.Tests.UI.Attributes.Behaviors; -using Lombiq.Tests.UI.Components; -using Lombiq.Tests.UI.Extensions; -using Lombiq.Tests.UI.Models; -using Lombiq.Tests.UI.Services; - -namespace OrchardCore.Tests.UI.Pages -{ - // Atata convention. -#pragma warning disable IDE0065 // Misplaced using directive - using _ = OrchardCoreRegistrationPage; -#pragma warning restore IDE0065 // Misplaced using directive - - [Url(DefaultUrl)] - [TermFindSettings(Case = TermCase.Pascal, TargetAllChildren = true, TargetAttributeType = typeof(FindByNameAttribute))] - public class OrchardCoreRegistrationPage : Page<_> - { - public const string DefaultUrl = "Register"; - - [FindByName] - public TextInput<_> UserName { get; private set; } - - [FindByName] - [SetsValueReliably] - public TextInput<_> Email { get; private set; } - - [FindByName] - public PasswordInput<_> Password { get; private set; } - - [FindByName] - public PasswordInput<_> ConfirmPassword { get; private set; } - - [FindByName("RegistrationCheckbox")] - public CheckBox<_> PrivacyPolicyAgreement { get; private set; } - - [FindByAttribute("type", "submit")] - public Button<_> Register { get; private set; } - - public ValidationMessageList<_> ValidationMessages { get; private set; } - - public _ ShouldStayOnRegistrationPage() => - PageUrl.Should.StartWith(Context.BaseUrl + DefaultUrl); - - public _ ShouldLeaveRegistrationPage() => - PageUrl.Should.Not.StartWith(Context.BaseUrl + DefaultUrl); - - public async Task<_> RegisterWithAsync(UITestContext context, UserRegistrationParameters parameters) - { - UserName.Set(parameters.UserName); - Email.Set(parameters.Email); - Password.Set(parameters.Password); - ConfirmPassword.Set(parameters.ConfirmPassword); - Register.Click(); - - await context.TriggerAfterPageChangeEventAndRefreshAtataContextAsync(); - - context.RefreshCurrentAtataContext(); - - return this; - } - } -} diff --git a/test/OrchardCore.Tests.UI/Pages/OrchardCoreSetupPage.cs b/test/OrchardCore.Tests.UI/Pages/OrchardCoreSetupPage.cs deleted file mode 100644 index 1df620491ca..00000000000 --- a/test/OrchardCore.Tests.UI/Pages/OrchardCoreSetupPage.cs +++ /dev/null @@ -1,126 +0,0 @@ -using System; -using System.Threading.Tasks; -using Atata; -using Atata.Bootstrap; -using Lombiq.Tests.UI.Attributes.Behaviors; -using Lombiq.Tests.UI.Extensions; -using Lombiq.Tests.UI.Services; - -namespace OrchardCore.Tests.UI.Pages -{ - // Atata convention. -#pragma warning disable IDE0065 // Misplaced using directive - using _ = OrchardCoreSetupPage; -#pragma warning restore IDE0065 // Misplaced using directive - - [VerifyTitle(values: new[] { DefaultPageTitle, OlderPageTitle }, Format = "{0}")] - [VerifyH1(values: new[] { DefaultPageTitle, OlderPageTitle })] - [TermFindSettings( - Case = TermCase.Pascal, - TargetAllChildren = true, - TargetAttributeTypes = new[] { typeof(FindByIdAttribute), typeof(FindByNameAttribute) })] - public sealed class OrchardCoreSetupPage : Page<_> - { - public const string DefaultPageTitle = "Setup"; - public const string OlderPageTitle = "Orchard Setup"; - - public enum DatabaseType - { - [Term("Sql Server")] - SqlServer, - Sqlite, - MySql, - Postgres, - } - - [FindById("culturesList")] - [SelectsOptionByValue] - public Select<_> Language { get; private set; } - - [FindByName] - public TextInput<_> SiteName { get; private set; } - - [FindById("recipeButton")] - public BSDropdownToggle<_> Recipe { get; private set; } - - [FindById] - [SelectsOptionByValue] - public Select<_> SiteTimeZone { get; private set; } - - [FindById] - public Select DatabaseProvider { get; private set; } - - [FindById] - public PasswordInput<_> ConnectionString { get; private set; } - - [FindById] - public TextInput<_> TablePrefix { get; private set; } - - [FindByName] - public TextInput<_> UserName { get; private set; } - - [FindByName] - [SetsValueReliably] - public EmailInput<_> Email { get; private set; } - - [FindByName] - public PasswordInput<_> Password { get; private set; } - - [FindByName] - public PasswordInput<_> PasswordConfirmation { get; private set; } - - public Button<_> FinishSetup { get; private set; } - - public _ ShouldStayOnSetupPage() => PageTitle.Should.Satisfy(title => IsExpectedTitle(title)); - - public _ ShouldLeaveSetupPage() => PageTitle.Should.Not.Satisfy(title => IsExpectedTitle(title)); - - public async Task<_> SetupOrchardCoreAsync(UITestContext context, OrchardCoreSetupParameters parameters = null) - { - parameters ??= new OrchardCoreSetupParameters(); - - Language.Set(parameters.LanguageValue); - SiteName.Set(parameters.SiteName); - // If there are a lot of recipes and "headless" mode is disabled, the recipe can become unclickable because - // the list of recipes is too long and it's off the screen, so we need to use JavaScript for clicking it. - context - .ExecuteScript("document.querySelectorAll(\"a[data-recipe-name='" + parameters.RecipeId + "']\")[0]" + - ".click()"); - DatabaseProvider.Set(parameters.DatabaseProvider); - - if (!string.IsNullOrWhiteSpace(parameters.SiteTimeZoneValue)) - { - SiteTimeZone.Set(parameters.SiteTimeZoneValue); - } - - if (parameters.DatabaseProvider != DatabaseType.Sqlite) - { - if (string.IsNullOrEmpty(parameters.ConnectionString)) - { - throw new InvalidOperationException( - $"{nameof(OrchardCoreSetupParameters)}.{nameof(parameters.DatabaseProvider)}: " + - "If the selected database provider is other than SQLite a connection string must be provided."); - } - - if (!string.IsNullOrEmpty(parameters.TablePrefix)) TablePrefix.Set(parameters.TablePrefix); - ConnectionString.Set(parameters.ConnectionString); - } - - Email.Set(parameters.Email); - UserName.Set(parameters.UserName); - Password.Set(parameters.Password); - PasswordConfirmation.Set(parameters.Password); - - FinishSetup.Click(); - - await context.TriggerAfterPageChangeEventAndRefreshAtataContextAsync(); - - context.RefreshCurrentAtataContext(); - - return this; - } - - private static bool IsExpectedTitle(string title) => - title.EqualsOrdinalIgnoreCase(DefaultPageTitle) || title.EqualsOrdinalIgnoreCase(OlderPageTitle); - } -} diff --git a/test/OrchardCore.Tests.UI/Pages/OrchardCoreSetupParameters.cs b/test/OrchardCore.Tests.UI/Pages/OrchardCoreSetupParameters.cs deleted file mode 100644 index ee2778a8d84..00000000000 --- a/test/OrchardCore.Tests.UI/Pages/OrchardCoreSetupParameters.cs +++ /dev/null @@ -1,34 +0,0 @@ -using Lombiq.Tests.UI.Constants; -using Lombiq.Tests.UI.Services; - -namespace OrchardCore.Tests.UI.Pages -{ - public class OrchardCoreSetupParameters - { - public string LanguageValue { get; set; } = "en"; - public string SiteName { get; set; } = "Test Site"; - public string RecipeId { get; set; } = "SaaS"; - public string SiteTimeZoneValue { get; set; } - public OrchardCoreSetupPage.DatabaseType DatabaseProvider { get; set; } = OrchardCoreSetupPage.DatabaseType.Sqlite; - public string ConnectionString { get; set; } - public string TablePrefix { get; set; } - public string UserName { get; set; } = DefaultUser.UserName; - public string Email { get; set; } = DefaultUser.Email; - public string Password { get; set; } = DefaultUser.Password; - - public OrchardCoreSetupParameters() - { - } - - public OrchardCoreSetupParameters(UITestContext context) - { - DatabaseProvider = context.Configuration.UseSqlServer - ? OrchardCoreSetupPage.DatabaseType.SqlServer - : OrchardCoreSetupPage.DatabaseType.Sqlite; - - ConnectionString = context.Configuration.UseSqlServer - ? context.SqlServerRunningContext.ConnectionString - : null; - } - } -} From 6eb18cd60df215193dc3a153e7ffa096e440ec32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Thu, 27 Oct 2022 23:52:17 +0200 Subject: [PATCH 083/175] Only testing setup with invalid data in BlogRecipeTests since that doesn't depend on the recipe --- test/OrchardCore.Tests.UI/Tests/AgencyRecipeTests.cs | 2 +- test/OrchardCore.Tests.UI/Tests/BlankRecipeTests.cs | 2 +- test/OrchardCore.Tests.UI/Tests/ComingSoonRecipeTests.cs | 2 +- test/OrchardCore.Tests.UI/Tests/HeadlessRecipeTests.cs | 2 +- test/OrchardCore.Tests.UI/Tests/SaaSRecipeTests.cs | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/test/OrchardCore.Tests.UI/Tests/AgencyRecipeTests.cs b/test/OrchardCore.Tests.UI/Tests/AgencyRecipeTests.cs index b53068f0253..448c3a4553c 100644 --- a/test/OrchardCore.Tests.UI/Tests/AgencyRecipeTests.cs +++ b/test/OrchardCore.Tests.UI/Tests/AgencyRecipeTests.cs @@ -22,7 +22,7 @@ public Task BasicOrchardFeaturesShouldWorkWithAgency(Browser browser) => ExecuteTestAsync( async context => { - await context.TestSetupWithInvalidAndValidDataAsync(new OrchardCoreSetupParameters(context) + await context.TestSetupAsync(new OrchardCoreSetupParameters(context) { RecipeId = "Agency.Tests", }); diff --git a/test/OrchardCore.Tests.UI/Tests/BlankRecipeTests.cs b/test/OrchardCore.Tests.UI/Tests/BlankRecipeTests.cs index 45356ebe9c4..3aeeb6c6bb0 100644 --- a/test/OrchardCore.Tests.UI/Tests/BlankRecipeTests.cs +++ b/test/OrchardCore.Tests.UI/Tests/BlankRecipeTests.cs @@ -23,7 +23,7 @@ public Task BasicOrchardFeaturesShouldWorkWithBlank(Browser browser) => ExecuteTestAsync( async context => { - await context.TestSetupWithInvalidAndValidDataAsync(new OrchardCoreSetupParameters(context) + await context.TestSetupAsync(new OrchardCoreSetupParameters(context) { RecipeId = "Blank.Tests", }); diff --git a/test/OrchardCore.Tests.UI/Tests/ComingSoonRecipeTests.cs b/test/OrchardCore.Tests.UI/Tests/ComingSoonRecipeTests.cs index 9f19a6ada4d..ce2e694cb96 100644 --- a/test/OrchardCore.Tests.UI/Tests/ComingSoonRecipeTests.cs +++ b/test/OrchardCore.Tests.UI/Tests/ComingSoonRecipeTests.cs @@ -20,7 +20,7 @@ public Task BasicOrchardFeaturesShouldWorkWithComingSoon(Browser browser) => ExecuteTestAsync( async context => { - await context.TestSetupWithInvalidAndValidDataAsync(new OrchardCoreSetupParameters(context) + await context.TestSetupAsync(new OrchardCoreSetupParameters(context) { RecipeId = "ComingSoon.Tests", }); diff --git a/test/OrchardCore.Tests.UI/Tests/HeadlessRecipeTests.cs b/test/OrchardCore.Tests.UI/Tests/HeadlessRecipeTests.cs index 42a39050ea9..f417fe28629 100644 --- a/test/OrchardCore.Tests.UI/Tests/HeadlessRecipeTests.cs +++ b/test/OrchardCore.Tests.UI/Tests/HeadlessRecipeTests.cs @@ -20,7 +20,7 @@ public Task BasicOrchardFeaturesShouldWorkWithHeadless(Browser browser) => ExecuteTestAsync( async context => { - await context.TestSetupWithInvalidAndValidDataAsync(new OrchardCoreSetupParameters(context) + await context.TestSetupAsync(new OrchardCoreSetupParameters(context) { RecipeId = "Headless.Tests", }); diff --git a/test/OrchardCore.Tests.UI/Tests/SaaSRecipeTests.cs b/test/OrchardCore.Tests.UI/Tests/SaaSRecipeTests.cs index f53102f4de1..d14a63597d3 100644 --- a/test/OrchardCore.Tests.UI/Tests/SaaSRecipeTests.cs +++ b/test/OrchardCore.Tests.UI/Tests/SaaSRecipeTests.cs @@ -20,7 +20,7 @@ public Task BasicOrchardFeaturesShouldWorkWithSaaS(Browser browser) => ExecuteTestAsync( async context => { - await context.TestSetupWithInvalidAndValidDataAsync(new OrchardCoreSetupParameters(context) + await context.TestSetupAsync(new OrchardCoreSetupParameters(context) { RecipeId = "SaaS.Tests", }); From 5dedbd0a4c15bf65b6775b6376a0f513c6ce2a6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Fri, 28 Oct 2022 15:24:51 +0200 Subject: [PATCH 084/175] Updating Lombiq.Tests.UI* with new config access --- src/OrchardCore.Build/Dependencies.props | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/OrchardCore.Build/Dependencies.props b/src/OrchardCore.Build/Dependencies.props index b8a869b353b..933b15e9b48 100644 --- a/src/OrchardCore.Build/Dependencies.props +++ b/src/OrchardCore.Build/Dependencies.props @@ -26,9 +26,9 @@ - - - + + + From f2ac898af47460d312f7ebb3a34a7b9853ba32bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Tue, 1 Nov 2022 23:42:29 +0100 Subject: [PATCH 085/175] Removing now unneeded issue branch reference --- .github/workflows/pr_ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr_ci.yml b/.github/workflows/pr_ci.yml index 122b3771791..07ef0e07bb2 100644 --- a/.github/workflows/pr_ci.yml +++ b/.github/workflows/pr_ci.yml @@ -29,7 +29,7 @@ jobs: run: | dotnet test -c Release --no-restore --no-build ./test/OrchardCore.Tests/OrchardCore.Tests.csproj - name: MVC UI Tests - uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@issue/OSOE-407 + uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@dev with: build-directory: test/OrchardCore.Tests.UI.Mvc - name: Set up Azurite @@ -37,6 +37,6 @@ jobs: with: location: test/OrchardCore.Tests.UI - name: CMS UI Tests - SQLite - uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@issue/OSOE-407 + uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@dev with: build-directory: test/OrchardCore.Tests.UI From 3eaac468917bbcedb94550face79d78b8c5ae489 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Tue, 1 Nov 2022 23:47:45 +0100 Subject: [PATCH 086/175] Temporarily skipping tests not needed for multi-DB testing for now --- test/OrchardCore.Tests.UI/Tests/AdminMonkeyTests.cs | 2 +- test/OrchardCore.Tests.UI/Tests/AgencyRecipeTests.cs | 2 +- test/OrchardCore.Tests.UI/Tests/AzureBlobStorageTests.cs | 2 +- test/OrchardCore.Tests.UI/Tests/BlankRecipeTests.cs | 2 +- test/OrchardCore.Tests.UI/Tests/ComingSoonRecipeTests.cs | 2 +- test/OrchardCore.Tests.UI/Tests/HeadlessRecipeTests.cs | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/test/OrchardCore.Tests.UI/Tests/AdminMonkeyTests.cs b/test/OrchardCore.Tests.UI/Tests/AdminMonkeyTests.cs index e22301f2a65..9d72ff823c1 100644 --- a/test/OrchardCore.Tests.UI/Tests/AdminMonkeyTests.cs +++ b/test/OrchardCore.Tests.UI/Tests/AdminMonkeyTests.cs @@ -21,7 +21,7 @@ public AdminMonkeyTests(ITestOutputHelper testOutputHelper) { } - [Theory, Chrome] + [Theory(Skip = "Minimal test suite for multi-DB testing."), Chrome] public Task TestAdminPagesAsMonkeyRecursivelyShouldWorkWithAdminUser(Browser browser) => ExecuteTestAsync( async context => diff --git a/test/OrchardCore.Tests.UI/Tests/AgencyRecipeTests.cs b/test/OrchardCore.Tests.UI/Tests/AgencyRecipeTests.cs index 448c3a4553c..4f978b02120 100644 --- a/test/OrchardCore.Tests.UI/Tests/AgencyRecipeTests.cs +++ b/test/OrchardCore.Tests.UI/Tests/AgencyRecipeTests.cs @@ -17,7 +17,7 @@ public AgencyRecipeTests(ITestOutputHelper testOutputHelper) { } - [Theory, Chrome] + [Theory(Skip = "Minimal test suite for multi-DB testing."), Chrome] public Task BasicOrchardFeaturesShouldWorkWithAgency(Browser browser) => ExecuteTestAsync( async context => diff --git a/test/OrchardCore.Tests.UI/Tests/AzureBlobStorageTests.cs b/test/OrchardCore.Tests.UI/Tests/AzureBlobStorageTests.cs index c77d76ff982..c65ffe5e5d3 100644 --- a/test/OrchardCore.Tests.UI/Tests/AzureBlobStorageTests.cs +++ b/test/OrchardCore.Tests.UI/Tests/AzureBlobStorageTests.cs @@ -14,7 +14,7 @@ public AzureBlobStorageTests(ITestOutputHelper testOutputHelper) { } - [Theory, Chrome] + [Theory(Skip = "Minimal test suite for multi-DB testing."), Chrome] public Task BasicOrchardFeaturesShouldWorkWithBlogAndAzureBlobStorage(Browser browser) => ExecuteTestAsync( context => context.TestBasicOrchardFeaturesAsync("Blog.Tests"), diff --git a/test/OrchardCore.Tests.UI/Tests/BlankRecipeTests.cs b/test/OrchardCore.Tests.UI/Tests/BlankRecipeTests.cs index 3aeeb6c6bb0..b4185348fde 100644 --- a/test/OrchardCore.Tests.UI/Tests/BlankRecipeTests.cs +++ b/test/OrchardCore.Tests.UI/Tests/BlankRecipeTests.cs @@ -18,7 +18,7 @@ public BlankRecipeTests(ITestOutputHelper testOutputHelper) { } - [Theory, Chrome] + [Theory(Skip = "Minimal test suite for multi-DB testing."), Chrome] public Task BasicOrchardFeaturesShouldWorkWithBlank(Browser browser) => ExecuteTestAsync( async context => diff --git a/test/OrchardCore.Tests.UI/Tests/ComingSoonRecipeTests.cs b/test/OrchardCore.Tests.UI/Tests/ComingSoonRecipeTests.cs index ce2e694cb96..3e7acdd0e3c 100644 --- a/test/OrchardCore.Tests.UI/Tests/ComingSoonRecipeTests.cs +++ b/test/OrchardCore.Tests.UI/Tests/ComingSoonRecipeTests.cs @@ -15,7 +15,7 @@ public ComingSoonRecipeTests(ITestOutputHelper testOutputHelper) { } - [Theory, Chrome] + [Theory(Skip = "Minimal test suite for multi-DB testing."), Chrome] public Task BasicOrchardFeaturesShouldWorkWithComingSoon(Browser browser) => ExecuteTestAsync( async context => diff --git a/test/OrchardCore.Tests.UI/Tests/HeadlessRecipeTests.cs b/test/OrchardCore.Tests.UI/Tests/HeadlessRecipeTests.cs index f417fe28629..f23f0afbf4d 100644 --- a/test/OrchardCore.Tests.UI/Tests/HeadlessRecipeTests.cs +++ b/test/OrchardCore.Tests.UI/Tests/HeadlessRecipeTests.cs @@ -15,7 +15,7 @@ public HeadlessRecipeTests(ITestOutputHelper testOutputHelper) { } - [Theory, Chrome] + [Theory(Skip = "Minimal test suite for multi-DB testing."), Chrome] public Task BasicOrchardFeaturesShouldWorkWithHeadless(Browser browser) => ExecuteTestAsync( async context => From 7c55f46e979e54651e234651be5a815b9ec9153d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Wed, 2 Nov 2022 00:00:05 +0100 Subject: [PATCH 087/175] Enabling SQL Server usage but only for SQL Server tests --- .github/workflows/pr_ci.yml | 8 ++++++++ test/OrchardCore.Tests.UI/UITestBase.cs | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/.github/workflows/pr_ci.yml b/.github/workflows/pr_ci.yml index 07ef0e07bb2..3a5e1620123 100644 --- a/.github/workflows/pr_ci.yml +++ b/.github/workflows/pr_ci.yml @@ -40,3 +40,11 @@ jobs: uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@dev with: build-directory: test/OrchardCore.Tests.UI + - name: Set up SQL Server + uses: Lombiq/GitHub-Actions/.github/actions/setup-sql-server@dev + - name: CMS UI Tests - SQL Server + uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@dev + env: + OrchardCore__UseSqlServerForUITesting: true + with: + build-directory: test/OrchardCore.Tests.UI diff --git a/test/OrchardCore.Tests.UI/UITestBase.cs b/test/OrchardCore.Tests.UI/UITestBase.cs index c13b2875100..455b9ac3048 100644 --- a/test/OrchardCore.Tests.UI/UITestBase.cs +++ b/test/OrchardCore.Tests.UI/UITestBase.cs @@ -2,6 +2,7 @@ using System.Threading.Tasks; using Lombiq.Tests.UI; using Lombiq.Tests.UI.Services; +using Microsoft.Extensions.Configuration; using Xunit.Abstractions; namespace OrchardCore.Tests.UI @@ -37,6 +38,9 @@ protected override Task ExecuteTestAsync( { configuration.AccessibilityCheckingConfiguration.RunAccessibilityCheckingAssertionOnAllPageChanges = true; + var section = TestConfigurationManager.RootConfiguration.GetSection("OrchardCore"); + configuration.UseSqlServer = section.GetValue("UseSqlServerForUITesting"); + if (changeConfigurationAsync != null) await changeConfigurationAsync(configuration); }); } From e9c6b82f66cd85370cc7a4ec4dd98edf88431c99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Wed, 2 Nov 2022 00:02:41 +0100 Subject: [PATCH 088/175] Temporarily disabling non-SQL Server tests and unit tests --- .github/workflows/pr_ci.yml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/pr_ci.yml b/.github/workflows/pr_ci.yml index 3a5e1620123..8892d8e752b 100644 --- a/.github/workflows/pr_ci.yml +++ b/.github/workflows/pr_ci.yml @@ -25,21 +25,21 @@ jobs: - name: Build run: | dotnet build --configuration Release --framework net6.0 - - name: Unit Tests - run: | - dotnet test -c Release --no-restore --no-build ./test/OrchardCore.Tests/OrchardCore.Tests.csproj - - name: MVC UI Tests - uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@dev - with: - build-directory: test/OrchardCore.Tests.UI.Mvc + #- name: Unit Tests + # run: | + # dotnet test -c Release --no-restore --no-build ./test/OrchardCore.Tests/OrchardCore.Tests.csproj + #- name: MVC UI Tests + # uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@dev + # with: + # build-directory: test/OrchardCore.Tests.UI.Mvc - name: Set up Azurite uses: Lombiq/GitHub-Actions/.github/actions/setup-azurite@dev with: location: test/OrchardCore.Tests.UI - - name: CMS UI Tests - SQLite - uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@dev - with: - build-directory: test/OrchardCore.Tests.UI + #- name: CMS UI Tests - SQLite + # uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@dev + # with: + # build-directory: test/OrchardCore.Tests.UI - name: Set up SQL Server uses: Lombiq/GitHub-Actions/.github/actions/setup-sql-server@dev - name: CMS UI Tests - SQL Server From 20a485cc07b9abd9c4d29688231c0bfd7210b3e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Wed, 2 Nov 2022 00:04:19 +0100 Subject: [PATCH 089/175] Revert "Temporarily disabling non-SQL Server tests and unit tests" This reverts commit e9c6b82f66cd85370cc7a4ec4dd98edf88431c99. --- .github/workflows/pr_ci.yml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/pr_ci.yml b/.github/workflows/pr_ci.yml index 8892d8e752b..3a5e1620123 100644 --- a/.github/workflows/pr_ci.yml +++ b/.github/workflows/pr_ci.yml @@ -25,21 +25,21 @@ jobs: - name: Build run: | dotnet build --configuration Release --framework net6.0 - #- name: Unit Tests - # run: | - # dotnet test -c Release --no-restore --no-build ./test/OrchardCore.Tests/OrchardCore.Tests.csproj - #- name: MVC UI Tests - # uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@dev - # with: - # build-directory: test/OrchardCore.Tests.UI.Mvc + - name: Unit Tests + run: | + dotnet test -c Release --no-restore --no-build ./test/OrchardCore.Tests/OrchardCore.Tests.csproj + - name: MVC UI Tests + uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@dev + with: + build-directory: test/OrchardCore.Tests.UI.Mvc - name: Set up Azurite uses: Lombiq/GitHub-Actions/.github/actions/setup-azurite@dev with: location: test/OrchardCore.Tests.UI - #- name: CMS UI Tests - SQLite - # uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@dev - # with: - # build-directory: test/OrchardCore.Tests.UI + - name: CMS UI Tests - SQLite + uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@dev + with: + build-directory: test/OrchardCore.Tests.UI - name: Set up SQL Server uses: Lombiq/GitHub-Actions/.github/actions/setup-sql-server@dev - name: CMS UI Tests - SQL Server From acc169904b2136fabcc44f3be314c909d7a7e347 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Wed, 2 Nov 2022 00:05:00 +0100 Subject: [PATCH 090/175] Temporarily disabling unit tests --- .github/workflows/pr_ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pr_ci.yml b/.github/workflows/pr_ci.yml index 3a5e1620123..a9f91eb36cc 100644 --- a/.github/workflows/pr_ci.yml +++ b/.github/workflows/pr_ci.yml @@ -25,9 +25,9 @@ jobs: - name: Build run: | dotnet build --configuration Release --framework net6.0 - - name: Unit Tests - run: | - dotnet test -c Release --no-restore --no-build ./test/OrchardCore.Tests/OrchardCore.Tests.csproj + #- name: Unit Tests + # run: | + # dotnet test -c Release --no-restore --no-build ./test/OrchardCore.Tests/OrchardCore.Tests.csproj - name: MVC UI Tests uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@dev with: From 3f4b18b0a992e8d54a4d4808babfa2e06ef10f5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Wed, 2 Nov 2022 00:05:47 +0100 Subject: [PATCH 091/175] Temporarily disabling non-SQL Server tests --- .github/workflows/pr_ci.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/pr_ci.yml b/.github/workflows/pr_ci.yml index a9f91eb36cc..8892d8e752b 100644 --- a/.github/workflows/pr_ci.yml +++ b/.github/workflows/pr_ci.yml @@ -28,18 +28,18 @@ jobs: #- name: Unit Tests # run: | # dotnet test -c Release --no-restore --no-build ./test/OrchardCore.Tests/OrchardCore.Tests.csproj - - name: MVC UI Tests - uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@dev - with: - build-directory: test/OrchardCore.Tests.UI.Mvc + #- name: MVC UI Tests + # uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@dev + # with: + # build-directory: test/OrchardCore.Tests.UI.Mvc - name: Set up Azurite uses: Lombiq/GitHub-Actions/.github/actions/setup-azurite@dev with: location: test/OrchardCore.Tests.UI - - name: CMS UI Tests - SQLite - uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@dev - with: - build-directory: test/OrchardCore.Tests.UI + #- name: CMS UI Tests - SQLite + # uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@dev + # with: + # build-directory: test/OrchardCore.Tests.UI - name: Set up SQL Server uses: Lombiq/GitHub-Actions/.github/actions/setup-sql-server@dev - name: CMS UI Tests - SQL Server From ea2cc0271b5e1d551c40d10b607df344dca7f8fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Wed, 2 Nov 2022 00:30:31 +0100 Subject: [PATCH 092/175] Trying to upgrade SqlManagementObjects (it can't be upgraded in UITT until that's upgraded to OC 1.5) --- test/OrchardCore.Tests.UI/OrchardCore.Tests.UI.csproj | 1 + 1 file changed, 1 insertion(+) diff --git a/test/OrchardCore.Tests.UI/OrchardCore.Tests.UI.csproj b/test/OrchardCore.Tests.UI/OrchardCore.Tests.UI.csproj index d4e44f8a82c..44eca4381a3 100644 --- a/test/OrchardCore.Tests.UI/OrchardCore.Tests.UI.csproj +++ b/test/OrchardCore.Tests.UI/OrchardCore.Tests.UI.csproj @@ -49,6 +49,7 @@ + From 78c2539cdb5d67d7f6a12abdd7f26526397423b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Wed, 2 Nov 2022 00:34:24 +0100 Subject: [PATCH 093/175] Encrypt=False;TrustServerCertificate=True for test SQL Servers --- test/OrchardCore.Tests.UI/UITestBase.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/test/OrchardCore.Tests.UI/UITestBase.cs b/test/OrchardCore.Tests.UI/UITestBase.cs index 455b9ac3048..9e55aea1b02 100644 --- a/test/OrchardCore.Tests.UI/UITestBase.cs +++ b/test/OrchardCore.Tests.UI/UITestBase.cs @@ -2,7 +2,6 @@ using System.Threading.Tasks; using Lombiq.Tests.UI; using Lombiq.Tests.UI.Services; -using Microsoft.Extensions.Configuration; using Xunit.Abstractions; namespace OrchardCore.Tests.UI @@ -41,6 +40,13 @@ protected override Task ExecuteTestAsync( var section = TestConfigurationManager.RootConfiguration.GetSection("OrchardCore"); configuration.UseSqlServer = section.GetValue("UseSqlServerForUITesting"); + if (configuration.UseSqlServer) + { + configuration.SqlServerDatabaseConfiguration.ConnectionStringTemplate = + configuration.SqlServerDatabaseConfiguration.ConnectionStringTemplate + + ";Encrypt=False;TrustServerCertificate=True"; + } + if (changeConfigurationAsync != null) await changeConfigurationAsync(configuration); }); } From 4d755861a5974e27f64987dc1fc0a86b205beacc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Wed, 2 Nov 2022 00:34:41 +0100 Subject: [PATCH 094/175] Revert "Trying to upgrade SqlManagementObjects (it can't be upgraded in UITT until that's upgraded to OC 1.5)" This reverts commit ea2cc0271b5e1d551c40d10b607df344dca7f8fe. --- test/OrchardCore.Tests.UI/OrchardCore.Tests.UI.csproj | 1 - 1 file changed, 1 deletion(-) diff --git a/test/OrchardCore.Tests.UI/OrchardCore.Tests.UI.csproj b/test/OrchardCore.Tests.UI/OrchardCore.Tests.UI.csproj index 44eca4381a3..d4e44f8a82c 100644 --- a/test/OrchardCore.Tests.UI/OrchardCore.Tests.UI.csproj +++ b/test/OrchardCore.Tests.UI/OrchardCore.Tests.UI.csproj @@ -49,7 +49,6 @@ - From 9e1d1a302c7e877deba731c4a393ea9902483717 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Wed, 2 Nov 2022 00:39:24 +0100 Subject: [PATCH 095/175] Revert "Revert "Trying to upgrade SqlManagementObjects (it can't be upgraded in UITT until that's upgraded to OC 1.5)"" This reverts commit 4d755861a5974e27f64987dc1fc0a86b205beacc. --- test/OrchardCore.Tests.UI/OrchardCore.Tests.UI.csproj | 1 + 1 file changed, 1 insertion(+) diff --git a/test/OrchardCore.Tests.UI/OrchardCore.Tests.UI.csproj b/test/OrchardCore.Tests.UI/OrchardCore.Tests.UI.csproj index d4e44f8a82c..44eca4381a3 100644 --- a/test/OrchardCore.Tests.UI/OrchardCore.Tests.UI.csproj +++ b/test/OrchardCore.Tests.UI/OrchardCore.Tests.UI.csproj @@ -49,6 +49,7 @@ + From 841c2faff1b01bfdcf78009c0d5f6edef08a4c5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Wed, 2 Nov 2022 00:39:49 +0100 Subject: [PATCH 096/175] Fixing build error --- test/OrchardCore.Tests.UI/UITestBase.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/test/OrchardCore.Tests.UI/UITestBase.cs b/test/OrchardCore.Tests.UI/UITestBase.cs index 9e55aea1b02..c469f218054 100644 --- a/test/OrchardCore.Tests.UI/UITestBase.cs +++ b/test/OrchardCore.Tests.UI/UITestBase.cs @@ -2,6 +2,7 @@ using System.Threading.Tasks; using Lombiq.Tests.UI; using Lombiq.Tests.UI.Services; +using Microsoft.Extensions.Configuration; using Xunit.Abstractions; namespace OrchardCore.Tests.UI From 7fedb67a5d42103b22ae68d9f9887f38b130792f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Wed, 2 Nov 2022 00:39:59 +0100 Subject: [PATCH 097/175] Revert "Trying to upgrade SqlManagementObjects (it can't be upgraded in UITT until that's upgraded to OC 1.5)" This reverts commit ea2cc0271b5e1d551c40d10b607df344dca7f8fe. --- test/OrchardCore.Tests.UI/OrchardCore.Tests.UI.csproj | 1 - 1 file changed, 1 deletion(-) diff --git a/test/OrchardCore.Tests.UI/OrchardCore.Tests.UI.csproj b/test/OrchardCore.Tests.UI/OrchardCore.Tests.UI.csproj index 44eca4381a3..d4e44f8a82c 100644 --- a/test/OrchardCore.Tests.UI/OrchardCore.Tests.UI.csproj +++ b/test/OrchardCore.Tests.UI/OrchardCore.Tests.UI.csproj @@ -49,7 +49,6 @@ - From 3b002a00e22ff4dae171ad89b267b5eaf99eac39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Wed, 2 Nov 2022 00:48:58 +0100 Subject: [PATCH 098/175] Revert "Revert "Trying to upgrade SqlManagementObjects (it can't be upgraded in UITT until that's upgraded to OC 1.5)"" This reverts commit 7fedb67a5d42103b22ae68d9f9887f38b130792f. --- test/OrchardCore.Tests.UI/OrchardCore.Tests.UI.csproj | 1 + 1 file changed, 1 insertion(+) diff --git a/test/OrchardCore.Tests.UI/OrchardCore.Tests.UI.csproj b/test/OrchardCore.Tests.UI/OrchardCore.Tests.UI.csproj index d4e44f8a82c..44eca4381a3 100644 --- a/test/OrchardCore.Tests.UI/OrchardCore.Tests.UI.csproj +++ b/test/OrchardCore.Tests.UI/OrchardCore.Tests.UI.csproj @@ -49,6 +49,7 @@ + From b0f0e9ecd586ec834935404392a007220ca83b7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Wed, 2 Nov 2022 00:51:57 +0100 Subject: [PATCH 099/175] PostgreSQL UI tests --- .github/workflows/pr_ci.yml | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pr_ci.yml b/.github/workflows/pr_ci.yml index 8892d8e752b..4d5b68f7f6f 100644 --- a/.github/workflows/pr_ci.yml +++ b/.github/workflows/pr_ci.yml @@ -14,6 +14,9 @@ jobs: os: [ubuntu-latest, windows-latest] name: Build & Test steps: + - name: Start PostgreSQL + # v1.4.0 + uses: dentarg/postgres@3ab3e1c502a120b43f4e7c1e6650db6b0c95cdcc - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: @@ -40,11 +43,18 @@ jobs: # uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@dev # with: # build-directory: test/OrchardCore.Tests.UI - - name: Set up SQL Server - uses: Lombiq/GitHub-Actions/.github/actions/setup-sql-server@dev - - name: CMS UI Tests - SQL Server + #- name: Set up SQL Server + # uses: Lombiq/GitHub-Actions/.github/actions/setup-sql-server@dev + #- name: CMS UI Tests - SQL Server + # uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@dev + # env: + # OrchardCore__UseSqlServerForUITesting: true + # with: + # build-directory: test/OrchardCore.Tests.UI + - name: CMS UI Tests - PostgreSQL uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@dev env: - OrchardCore__UseSqlServerForUITesting: true + OrchardCore__ConnectionString: "User ID=postgres;Password=root;Host=postgres;Port=5432;Database=app;" + OrchardCore__DatabaseProvider: "Postgres" with: build-directory: test/OrchardCore.Tests.UI From bbb710f5d930e0a636218fe06d83bfffbea277cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Wed, 2 Nov 2022 01:01:54 +0100 Subject: [PATCH 100/175] Different PostgreSQL setup --- .github/workflows/pr_ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pr_ci.yml b/.github/workflows/pr_ci.yml index 4d5b68f7f6f..0954c3b739d 100644 --- a/.github/workflows/pr_ci.yml +++ b/.github/workflows/pr_ci.yml @@ -15,8 +15,8 @@ jobs: name: Build & Test steps: - name: Start PostgreSQL - # v1.4.0 - uses: dentarg/postgres@3ab3e1c502a120b43f4e7c1e6650db6b0c95cdcc + # v3 + - uses: ikalnytskyi/action-setup-postgres@e5b77936cf3f9d1a079ac5e8c1787fc657924809 - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: @@ -54,7 +54,7 @@ jobs: - name: CMS UI Tests - PostgreSQL uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@dev env: - OrchardCore__ConnectionString: "User ID=postgres;Password=root;Host=postgres;Port=5432;Database=app;" + OrchardCore__ConnectionString: "User ID=postgres;Password=postgres;Host=localhost;Port=5432;Database=postgres;" OrchardCore__DatabaseProvider: "Postgres" with: build-directory: test/OrchardCore.Tests.UI From 1f2cd9c58fbb3d65f4bd02757a8f743ad535bcef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Wed, 2 Nov 2022 01:05:04 +0100 Subject: [PATCH 101/175] Workflow syntax fix --- .github/workflows/pr_ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr_ci.yml b/.github/workflows/pr_ci.yml index 0954c3b739d..03d257d5733 100644 --- a/.github/workflows/pr_ci.yml +++ b/.github/workflows/pr_ci.yml @@ -16,7 +16,7 @@ jobs: steps: - name: Start PostgreSQL # v3 - - uses: ikalnytskyi/action-setup-postgres@e5b77936cf3f9d1a079ac5e8c1787fc657924809 + uses: ikalnytskyi/action-setup-postgres@e5b77936cf3f9d1a079ac5e8c1787fc657924809 - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: From c3ada4bd0178364abdf1d5ef09d4fa03eb795b62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Wed, 2 Nov 2022 01:09:57 +0100 Subject: [PATCH 102/175] Moving Start PostgreSQL step to its actual suitable location --- .github/workflows/pr_ci.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pr_ci.yml b/.github/workflows/pr_ci.yml index 03d257d5733..bda3f0d3d6a 100644 --- a/.github/workflows/pr_ci.yml +++ b/.github/workflows/pr_ci.yml @@ -14,9 +14,6 @@ jobs: os: [ubuntu-latest, windows-latest] name: Build & Test steps: - - name: Start PostgreSQL - # v3 - uses: ikalnytskyi/action-setup-postgres@e5b77936cf3f9d1a079ac5e8c1787fc657924809 - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: @@ -51,6 +48,10 @@ jobs: # OrchardCore__UseSqlServerForUITesting: true # with: # build-directory: test/OrchardCore.Tests.UI + - name: Start PostgreSQL + # v3 + # This will cause warnings until this is fixed: https://github.com/ikalnytskyi/action-setup-postgres/issues/6. + uses: ikalnytskyi/action-setup-postgres@e5b77936cf3f9d1a079ac5e8c1787fc657924809 - name: CMS UI Tests - PostgreSQL uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@dev env: From 1011d61cbd8d87635460624cbcc7ee88e95b88fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Wed, 2 Nov 2022 01:23:10 +0100 Subject: [PATCH 103/175] Loading the DatabaseProvider from the environment for OrchardCoreSetupParameters --- .../OrchardCoreSetupParametersExtensions.cs | 22 +++++++++++++++++++ .../Tests/AdminMonkeyTests.cs | 2 +- .../Tests/AgencyRecipeTests.cs | 2 +- .../Tests/BlankRecipeTests.cs | 2 +- .../Tests/ComingSoonRecipeTests.cs | 2 +- .../Tests/HeadlessRecipeTests.cs | 2 +- .../Tests/SaaSRecipeTests.cs | 6 ++--- 7 files changed, 30 insertions(+), 8 deletions(-) create mode 100644 test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs diff --git a/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs b/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs new file mode 100644 index 00000000000..7aff6e33492 --- /dev/null +++ b/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs @@ -0,0 +1,22 @@ +using Lombiq.Tests.UI.Services; +using Microsoft.Extensions.Configuration; + +namespace Lombiq.Tests.UI.Pages +{ + public static class OrchardCoreSetupParametersExtensions + { + public static OrchardCoreSetupParameters DatabaseProviderFromEnvironmentIfAvailable( + this OrchardCoreSetupParameters setupParameters) + { + var section = TestConfigurationManager.RootConfiguration.GetSection("OrchardCore"); + var databaseProvider = section.GetValue("OrchardCore__DatabaseProvider"); + + if (!string.IsNullOrEmpty(databaseProvider) && (databaseProvider is "Postgres" or "MySql")) + { + setupParameters.DatabaseProvider = OrchardCoreSetupPage.DatabaseType.ProvidedByEnvironment; + } + + return setupParameters; + } + } +} diff --git a/test/OrchardCore.Tests.UI/Tests/AdminMonkeyTests.cs b/test/OrchardCore.Tests.UI/Tests/AdminMonkeyTests.cs index 9d72ff823c1..2972d63c646 100644 --- a/test/OrchardCore.Tests.UI/Tests/AdminMonkeyTests.cs +++ b/test/OrchardCore.Tests.UI/Tests/AdminMonkeyTests.cs @@ -33,7 +33,7 @@ await context.GoToSetupPageAndSetupOrchardCoreAsync( RecipeId = "Blog.Tests", TablePrefix = "default", SiteTimeZoneValue = "America/New_York", - }); + }.DatabaseProviderFromEnvironmentIfAvailable()); await context.TestAdminAsMonkeyRecursivelyAsync( new MonkeyTestingOptions diff --git a/test/OrchardCore.Tests.UI/Tests/AgencyRecipeTests.cs b/test/OrchardCore.Tests.UI/Tests/AgencyRecipeTests.cs index 4f978b02120..206f64513a8 100644 --- a/test/OrchardCore.Tests.UI/Tests/AgencyRecipeTests.cs +++ b/test/OrchardCore.Tests.UI/Tests/AgencyRecipeTests.cs @@ -25,7 +25,7 @@ public Task BasicOrchardFeaturesShouldWorkWithAgency(Browser browser) => await context.TestSetupAsync(new OrchardCoreSetupParameters(context) { RecipeId = "Agency.Tests", - }); + }.DatabaseProviderFromEnvironmentIfAvailable()); await context.TestRegistrationWithInvalidDataAsync(); await context.TestRegistrationAsync(); diff --git a/test/OrchardCore.Tests.UI/Tests/BlankRecipeTests.cs b/test/OrchardCore.Tests.UI/Tests/BlankRecipeTests.cs index b4185348fde..db3eaf06a4c 100644 --- a/test/OrchardCore.Tests.UI/Tests/BlankRecipeTests.cs +++ b/test/OrchardCore.Tests.UI/Tests/BlankRecipeTests.cs @@ -26,7 +26,7 @@ public Task BasicOrchardFeaturesShouldWorkWithBlank(Browser browser) => await context.TestSetupAsync(new OrchardCoreSetupParameters(context) { RecipeId = "Blank.Tests", - }); + }.DatabaseProviderFromEnvironmentIfAvailable()); await context.TestLoginWithInvalidDataAsync(); await context.TestLoginAsync(); diff --git a/test/OrchardCore.Tests.UI/Tests/ComingSoonRecipeTests.cs b/test/OrchardCore.Tests.UI/Tests/ComingSoonRecipeTests.cs index 3e7acdd0e3c..41b5972df1c 100644 --- a/test/OrchardCore.Tests.UI/Tests/ComingSoonRecipeTests.cs +++ b/test/OrchardCore.Tests.UI/Tests/ComingSoonRecipeTests.cs @@ -23,7 +23,7 @@ public Task BasicOrchardFeaturesShouldWorkWithComingSoon(Browser browser) => await context.TestSetupAsync(new OrchardCoreSetupParameters(context) { RecipeId = "ComingSoon.Tests", - }); + }.DatabaseProviderFromEnvironmentIfAvailable()); await context.TestRegistrationWithInvalidDataAsync(); await context.TestRegistrationAsync(); diff --git a/test/OrchardCore.Tests.UI/Tests/HeadlessRecipeTests.cs b/test/OrchardCore.Tests.UI/Tests/HeadlessRecipeTests.cs index f23f0afbf4d..42b24313571 100644 --- a/test/OrchardCore.Tests.UI/Tests/HeadlessRecipeTests.cs +++ b/test/OrchardCore.Tests.UI/Tests/HeadlessRecipeTests.cs @@ -23,7 +23,7 @@ public Task BasicOrchardFeaturesShouldWorkWithHeadless(Browser browser) => await context.TestSetupAsync(new OrchardCoreSetupParameters(context) { RecipeId = "Headless.Tests", - }); + }.DatabaseProviderFromEnvironmentIfAvailable()); await context.TestLoginWithInvalidDataAsync(); await context.TestLoginAsync(); diff --git a/test/OrchardCore.Tests.UI/Tests/SaaSRecipeTests.cs b/test/OrchardCore.Tests.UI/Tests/SaaSRecipeTests.cs index d14a63597d3..36d416f486c 100644 --- a/test/OrchardCore.Tests.UI/Tests/SaaSRecipeTests.cs +++ b/test/OrchardCore.Tests.UI/Tests/SaaSRecipeTests.cs @@ -23,7 +23,7 @@ public Task BasicOrchardFeaturesShouldWorkWithSaaS(Browser browser) => await context.TestSetupAsync(new OrchardCoreSetupParameters(context) { RecipeId = "SaaS.Tests", - }); + }.DatabaseProviderFromEnvironmentIfAvailable()); await context.TestRegistrationWithInvalidDataAsync(); await context.TestRegistrationAsync(); @@ -47,7 +47,7 @@ await context.GoToSetupPageAndSetupOrchardCoreAsync( RecipeId = "SaaS.Tests", TablePrefix = "default", SiteTimeZoneValue = "America/New_York", - }); + }.DatabaseProviderFromEnvironmentIfAvailable()); await context.SignInDirectlyAsync(); @@ -60,7 +60,7 @@ await context.GoToSetupPageAndSetupOrchardCoreAsync( RecipeId = "Blog.Tests", TablePrefix = "test", RunSetupOnCurrentPage = true, - }); + }.DatabaseProviderFromEnvironmentIfAvailable()); await context.TestBasicOrchardFeaturesExceptSetupAsync(); }, From e2b81f1f1c69589527b1d42ba6f0271d8d3b4616 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Wed, 2 Nov 2022 01:32:08 +0100 Subject: [PATCH 104/175] Fixing config retrieval --- .../Extensions/OrchardCoreSetupParametersExtensions.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs b/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs index 7aff6e33492..e8a20a8eefa 100644 --- a/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs +++ b/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs @@ -9,7 +9,7 @@ public static OrchardCoreSetupParameters DatabaseProviderFromEnvironmentIfAvaila this OrchardCoreSetupParameters setupParameters) { var section = TestConfigurationManager.RootConfiguration.GetSection("OrchardCore"); - var databaseProvider = section.GetValue("OrchardCore__DatabaseProvider"); + var databaseProvider = section.GetValue("DatabaseProvider"); if (!string.IsNullOrEmpty(databaseProvider) && (databaseProvider is "Postgres" or "MySql")) { From 80deb0c8f87ca95753be4b28cb6bd430d71bf32b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Wed, 2 Nov 2022 01:38:10 +0100 Subject: [PATCH 105/175] Unique table prefix for tests that all run with a single DB --- .../Extensions/OrchardCoreSetupParametersExtensions.cs | 3 ++- test/OrchardCore.Tests.UI/Tests/AdminMonkeyTests.cs | 2 +- test/OrchardCore.Tests.UI/Tests/AgencyRecipeTests.cs | 2 +- test/OrchardCore.Tests.UI/Tests/BlankRecipeTests.cs | 2 +- test/OrchardCore.Tests.UI/Tests/ComingSoonRecipeTests.cs | 2 +- test/OrchardCore.Tests.UI/Tests/HeadlessRecipeTests.cs | 2 +- test/OrchardCore.Tests.UI/Tests/SaaSRecipeTests.cs | 6 +++--- 7 files changed, 10 insertions(+), 9 deletions(-) diff --git a/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs b/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs index e8a20a8eefa..7fdee71ec38 100644 --- a/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs +++ b/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs @@ -6,7 +6,7 @@ namespace Lombiq.Tests.UI.Pages public static class OrchardCoreSetupParametersExtensions { public static OrchardCoreSetupParameters DatabaseProviderFromEnvironmentIfAvailable( - this OrchardCoreSetupParameters setupParameters) + this OrchardCoreSetupParameters setupParameters, UITestContext context) { var section = TestConfigurationManager.RootConfiguration.GetSection("OrchardCore"); var databaseProvider = section.GetValue("DatabaseProvider"); @@ -14,6 +14,7 @@ public static OrchardCoreSetupParameters DatabaseProviderFromEnvironmentIfAvaila if (!string.IsNullOrEmpty(databaseProvider) && (databaseProvider is "Postgres" or "MySql")) { setupParameters.DatabaseProvider = OrchardCoreSetupPage.DatabaseType.ProvidedByEnvironment; + setupParameters.TablePrefix = context.Id; } return setupParameters; diff --git a/test/OrchardCore.Tests.UI/Tests/AdminMonkeyTests.cs b/test/OrchardCore.Tests.UI/Tests/AdminMonkeyTests.cs index 2972d63c646..f308ddceb1c 100644 --- a/test/OrchardCore.Tests.UI/Tests/AdminMonkeyTests.cs +++ b/test/OrchardCore.Tests.UI/Tests/AdminMonkeyTests.cs @@ -33,7 +33,7 @@ await context.GoToSetupPageAndSetupOrchardCoreAsync( RecipeId = "Blog.Tests", TablePrefix = "default", SiteTimeZoneValue = "America/New_York", - }.DatabaseProviderFromEnvironmentIfAvailable()); + }.DatabaseProviderFromEnvironmentIfAvailable(context)); await context.TestAdminAsMonkeyRecursivelyAsync( new MonkeyTestingOptions diff --git a/test/OrchardCore.Tests.UI/Tests/AgencyRecipeTests.cs b/test/OrchardCore.Tests.UI/Tests/AgencyRecipeTests.cs index 206f64513a8..d3c81440970 100644 --- a/test/OrchardCore.Tests.UI/Tests/AgencyRecipeTests.cs +++ b/test/OrchardCore.Tests.UI/Tests/AgencyRecipeTests.cs @@ -25,7 +25,7 @@ public Task BasicOrchardFeaturesShouldWorkWithAgency(Browser browser) => await context.TestSetupAsync(new OrchardCoreSetupParameters(context) { RecipeId = "Agency.Tests", - }.DatabaseProviderFromEnvironmentIfAvailable()); + }.DatabaseProviderFromEnvironmentIfAvailable(context)); await context.TestRegistrationWithInvalidDataAsync(); await context.TestRegistrationAsync(); diff --git a/test/OrchardCore.Tests.UI/Tests/BlankRecipeTests.cs b/test/OrchardCore.Tests.UI/Tests/BlankRecipeTests.cs index db3eaf06a4c..dddc41cecce 100644 --- a/test/OrchardCore.Tests.UI/Tests/BlankRecipeTests.cs +++ b/test/OrchardCore.Tests.UI/Tests/BlankRecipeTests.cs @@ -26,7 +26,7 @@ public Task BasicOrchardFeaturesShouldWorkWithBlank(Browser browser) => await context.TestSetupAsync(new OrchardCoreSetupParameters(context) { RecipeId = "Blank.Tests", - }.DatabaseProviderFromEnvironmentIfAvailable()); + }.DatabaseProviderFromEnvironmentIfAvailable(context)); await context.TestLoginWithInvalidDataAsync(); await context.TestLoginAsync(); diff --git a/test/OrchardCore.Tests.UI/Tests/ComingSoonRecipeTests.cs b/test/OrchardCore.Tests.UI/Tests/ComingSoonRecipeTests.cs index 41b5972df1c..805b5dcada9 100644 --- a/test/OrchardCore.Tests.UI/Tests/ComingSoonRecipeTests.cs +++ b/test/OrchardCore.Tests.UI/Tests/ComingSoonRecipeTests.cs @@ -23,7 +23,7 @@ public Task BasicOrchardFeaturesShouldWorkWithComingSoon(Browser browser) => await context.TestSetupAsync(new OrchardCoreSetupParameters(context) { RecipeId = "ComingSoon.Tests", - }.DatabaseProviderFromEnvironmentIfAvailable()); + }.DatabaseProviderFromEnvironmentIfAvailable(context)); await context.TestRegistrationWithInvalidDataAsync(); await context.TestRegistrationAsync(); diff --git a/test/OrchardCore.Tests.UI/Tests/HeadlessRecipeTests.cs b/test/OrchardCore.Tests.UI/Tests/HeadlessRecipeTests.cs index 42b24313571..665cbd9817c 100644 --- a/test/OrchardCore.Tests.UI/Tests/HeadlessRecipeTests.cs +++ b/test/OrchardCore.Tests.UI/Tests/HeadlessRecipeTests.cs @@ -23,7 +23,7 @@ public Task BasicOrchardFeaturesShouldWorkWithHeadless(Browser browser) => await context.TestSetupAsync(new OrchardCoreSetupParameters(context) { RecipeId = "Headless.Tests", - }.DatabaseProviderFromEnvironmentIfAvailable()); + }.DatabaseProviderFromEnvironmentIfAvailable(context)); await context.TestLoginWithInvalidDataAsync(); await context.TestLoginAsync(); diff --git a/test/OrchardCore.Tests.UI/Tests/SaaSRecipeTests.cs b/test/OrchardCore.Tests.UI/Tests/SaaSRecipeTests.cs index 36d416f486c..2eb4027f2fd 100644 --- a/test/OrchardCore.Tests.UI/Tests/SaaSRecipeTests.cs +++ b/test/OrchardCore.Tests.UI/Tests/SaaSRecipeTests.cs @@ -23,7 +23,7 @@ public Task BasicOrchardFeaturesShouldWorkWithSaaS(Browser browser) => await context.TestSetupAsync(new OrchardCoreSetupParameters(context) { RecipeId = "SaaS.Tests", - }.DatabaseProviderFromEnvironmentIfAvailable()); + }.DatabaseProviderFromEnvironmentIfAvailable(context)); await context.TestRegistrationWithInvalidDataAsync(); await context.TestRegistrationAsync(); @@ -47,7 +47,7 @@ await context.GoToSetupPageAndSetupOrchardCoreAsync( RecipeId = "SaaS.Tests", TablePrefix = "default", SiteTimeZoneValue = "America/New_York", - }.DatabaseProviderFromEnvironmentIfAvailable()); + }.DatabaseProviderFromEnvironmentIfAvailable(context)); await context.SignInDirectlyAsync(); @@ -60,7 +60,7 @@ await context.GoToSetupPageAndSetupOrchardCoreAsync( RecipeId = "Blog.Tests", TablePrefix = "test", RunSetupOnCurrentPage = true, - }.DatabaseProviderFromEnvironmentIfAvailable()); + }.DatabaseProviderFromEnvironmentIfAvailable(context)); await context.TestBasicOrchardFeaturesExceptSetupAsync(); }, From e57f59009006108be32f9915f813343d44b8b892 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Wed, 2 Nov 2022 01:40:14 +0100 Subject: [PATCH 106/175] Alternative Postgres setup --- .github/workflows/pr_ci.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pr_ci.yml b/.github/workflows/pr_ci.yml index bda3f0d3d6a..22a1ddd93c2 100644 --- a/.github/workflows/pr_ci.yml +++ b/.github/workflows/pr_ci.yml @@ -14,6 +14,11 @@ jobs: os: [ubuntu-latest, windows-latest] name: Build & Test steps: + - name: Start PostgreSQL + # v3 + uses: ankane/setup-postgres@d13a84e814666d5ad6d52c8b67019fbdcb45ebe3 + with: + database: postgres - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: @@ -48,10 +53,6 @@ jobs: # OrchardCore__UseSqlServerForUITesting: true # with: # build-directory: test/OrchardCore.Tests.UI - - name: Start PostgreSQL - # v3 - # This will cause warnings until this is fixed: https://github.com/ikalnytskyi/action-setup-postgres/issues/6. - uses: ikalnytskyi/action-setup-postgres@e5b77936cf3f9d1a079ac5e8c1787fc657924809 - name: CMS UI Tests - PostgreSQL uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@dev env: From bf7064aa8053d6f35c59fe64c28be070bb2167af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Wed, 2 Nov 2022 01:41:40 +0100 Subject: [PATCH 107/175] Different DB name --- .github/workflows/pr_ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr_ci.yml b/.github/workflows/pr_ci.yml index 22a1ddd93c2..edd2744f639 100644 --- a/.github/workflows/pr_ci.yml +++ b/.github/workflows/pr_ci.yml @@ -18,7 +18,7 @@ jobs: # v3 uses: ankane/setup-postgres@d13a84e814666d5ad6d52c8b67019fbdcb45ebe3 with: - database: postgres + database: uitests - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: @@ -56,7 +56,7 @@ jobs: - name: CMS UI Tests - PostgreSQL uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@dev env: - OrchardCore__ConnectionString: "User ID=postgres;Password=postgres;Host=localhost;Port=5432;Database=postgres;" + OrchardCore__ConnectionString: "User ID=postgres;Password=postgres;Host=localhost;Port=5432;Database=uitests;" OrchardCore__DatabaseProvider: "Postgres" with: build-directory: test/OrchardCore.Tests.UI From eb9b117c670133a75c6bb1219b1d891fc3fee7dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Wed, 2 Nov 2022 01:43:54 +0100 Subject: [PATCH 108/175] Back to the previous Postgres setup --- .github/workflows/pr_ci.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/pr_ci.yml b/.github/workflows/pr_ci.yml index edd2744f639..bda3f0d3d6a 100644 --- a/.github/workflows/pr_ci.yml +++ b/.github/workflows/pr_ci.yml @@ -14,11 +14,6 @@ jobs: os: [ubuntu-latest, windows-latest] name: Build & Test steps: - - name: Start PostgreSQL - # v3 - uses: ankane/setup-postgres@d13a84e814666d5ad6d52c8b67019fbdcb45ebe3 - with: - database: uitests - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: @@ -53,10 +48,14 @@ jobs: # OrchardCore__UseSqlServerForUITesting: true # with: # build-directory: test/OrchardCore.Tests.UI + - name: Start PostgreSQL + # v3 + # This will cause warnings until this is fixed: https://github.com/ikalnytskyi/action-setup-postgres/issues/6. + uses: ikalnytskyi/action-setup-postgres@e5b77936cf3f9d1a079ac5e8c1787fc657924809 - name: CMS UI Tests - PostgreSQL uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@dev env: - OrchardCore__ConnectionString: "User ID=postgres;Password=postgres;Host=localhost;Port=5432;Database=uitests;" + OrchardCore__ConnectionString: "User ID=postgres;Password=postgres;Host=localhost;Port=5432;Database=postgres;" OrchardCore__DatabaseProvider: "Postgres" with: build-directory: test/OrchardCore.Tests.UI From 35d5422bded3acdb1358aa8e1ce84a8232a5436e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Wed, 2 Nov 2022 01:49:06 +0100 Subject: [PATCH 109/175] Fixing remaining wrong setup configs --- test/OrchardCore.Tests.UI/Tests/AzureBlobStorageTests.cs | 6 +++++- test/OrchardCore.Tests.UI/Tests/BlogRecipeTests.cs | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/test/OrchardCore.Tests.UI/Tests/AzureBlobStorageTests.cs b/test/OrchardCore.Tests.UI/Tests/AzureBlobStorageTests.cs index c65ffe5e5d3..6d4b0f6edf9 100644 --- a/test/OrchardCore.Tests.UI/Tests/AzureBlobStorageTests.cs +++ b/test/OrchardCore.Tests.UI/Tests/AzureBlobStorageTests.cs @@ -1,6 +1,7 @@ using System.Threading.Tasks; using Lombiq.Tests.UI.Attributes; using Lombiq.Tests.UI.Extensions; +using Lombiq.Tests.UI.Pages; using Lombiq.Tests.UI.Services; using Xunit; using Xunit.Abstractions; @@ -17,7 +18,10 @@ public AzureBlobStorageTests(ITestOutputHelper testOutputHelper) [Theory(Skip = "Minimal test suite for multi-DB testing."), Chrome] public Task BasicOrchardFeaturesShouldWorkWithBlogAndAzureBlobStorage(Browser browser) => ExecuteTestAsync( - context => context.TestBasicOrchardFeaturesAsync("Blog.Tests"), + context => context.TestBasicOrchardFeaturesAsync(new OrchardCoreSetupParameters(context) + { + RecipeId = "Blog.Tests", + }.DatabaseProviderFromEnvironmentIfAvailable(context)), browser, configuration => { diff --git a/test/OrchardCore.Tests.UI/Tests/BlogRecipeTests.cs b/test/OrchardCore.Tests.UI/Tests/BlogRecipeTests.cs index c49c4e3f9d1..33b9e328a4d 100644 --- a/test/OrchardCore.Tests.UI/Tests/BlogRecipeTests.cs +++ b/test/OrchardCore.Tests.UI/Tests/BlogRecipeTests.cs @@ -1,6 +1,7 @@ using System.Threading.Tasks; using Lombiq.Tests.UI.Attributes; using Lombiq.Tests.UI.Extensions; +using Lombiq.Tests.UI.Pages; using Lombiq.Tests.UI.Services; using OpenQA.Selenium; using Xunit; @@ -18,7 +19,10 @@ public BlogRecipeTests(ITestOutputHelper testOutputHelper) [Theory, Chrome] public Task BasicOrchardFeaturesShouldWorkWithBlog(Browser browser) => ExecuteTestAsync( - context => context.TestBasicOrchardFeaturesAsync("Blog.Tests"), + context => context.TestBasicOrchardFeaturesAsync(new OrchardCoreSetupParameters(context) + { + RecipeId = "Blog.Tests", + }.DatabaseProviderFromEnvironmentIfAvailable(context)), browser, configuration => { From 19d8711268365f928e0037db97b32e8c7bc3de7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Wed, 2 Nov 2022 02:08:14 +0100 Subject: [PATCH 110/175] Fixing that invalid setup testing failed the tests --- .../Tests/AzureBlobStorageTests.cs | 11 +++++--- .../Tests/BlogRecipeTests.cs | 11 +++++--- .../Tests/InvalidSetupTests.cs | 26 +++++++++++++++++++ 3 files changed, 42 insertions(+), 6 deletions(-) create mode 100644 test/OrchardCore.Tests.UI/Tests/InvalidSetupTests.cs diff --git a/test/OrchardCore.Tests.UI/Tests/AzureBlobStorageTests.cs b/test/OrchardCore.Tests.UI/Tests/AzureBlobStorageTests.cs index 6d4b0f6edf9..087d8ca5e81 100644 --- a/test/OrchardCore.Tests.UI/Tests/AzureBlobStorageTests.cs +++ b/test/OrchardCore.Tests.UI/Tests/AzureBlobStorageTests.cs @@ -18,10 +18,15 @@ public AzureBlobStorageTests(ITestOutputHelper testOutputHelper) [Theory(Skip = "Minimal test suite for multi-DB testing."), Chrome] public Task BasicOrchardFeaturesShouldWorkWithBlogAndAzureBlobStorage(Browser browser) => ExecuteTestAsync( - context => context.TestBasicOrchardFeaturesAsync(new OrchardCoreSetupParameters(context) + async context => { - RecipeId = "Blog.Tests", - }.DatabaseProviderFromEnvironmentIfAvailable(context)), + await context.TestSetupAsync(new OrchardCoreSetupParameters(context) + { + RecipeId = "Blog.Tests", + }.DatabaseProviderFromEnvironmentIfAvailable(context)); + + await context.TestBasicOrchardFeaturesExceptSetupAsync(); + }, browser, configuration => { diff --git a/test/OrchardCore.Tests.UI/Tests/BlogRecipeTests.cs b/test/OrchardCore.Tests.UI/Tests/BlogRecipeTests.cs index 33b9e328a4d..7d29c521fce 100644 --- a/test/OrchardCore.Tests.UI/Tests/BlogRecipeTests.cs +++ b/test/OrchardCore.Tests.UI/Tests/BlogRecipeTests.cs @@ -19,10 +19,15 @@ public BlogRecipeTests(ITestOutputHelper testOutputHelper) [Theory, Chrome] public Task BasicOrchardFeaturesShouldWorkWithBlog(Browser browser) => ExecuteTestAsync( - context => context.TestBasicOrchardFeaturesAsync(new OrchardCoreSetupParameters(context) + async context => { - RecipeId = "Blog.Tests", - }.DatabaseProviderFromEnvironmentIfAvailable(context)), + await context.TestSetupAsync(new OrchardCoreSetupParameters(context) + { + RecipeId = "Blog.Tests", + }.DatabaseProviderFromEnvironmentIfAvailable(context)); + + await context.TestBasicOrchardFeaturesExceptSetupAsync(); + }, browser, configuration => { diff --git a/test/OrchardCore.Tests.UI/Tests/InvalidSetupTests.cs b/test/OrchardCore.Tests.UI/Tests/InvalidSetupTests.cs new file mode 100644 index 00000000000..f2af22cba4d --- /dev/null +++ b/test/OrchardCore.Tests.UI/Tests/InvalidSetupTests.cs @@ -0,0 +1,26 @@ +using System.Threading.Tasks; +using Lombiq.Tests.UI.Attributes; +using Lombiq.Tests.UI.Extensions; +using Lombiq.Tests.UI.Pages; +using Lombiq.Tests.UI.Services; +using Xunit; +using Xunit.Abstractions; + +namespace OrchardCore.Tests.UI.Tests +{ + public class InvalidSetupTests : UITestBase + { + public InvalidSetupTests(ITestOutputHelper testOutputHelper) + : base(testOutputHelper) + { + } + + [Theory(Skip = "Minimal test suite for multi-DB testing."), Chrome] + public Task SetupWithInvalidDataShouldFail(Browser browser) => + ExecuteTestAsync( + context => context.TestSetupWithInvalidDataAsync( + new OrchardCoreSetupParameters(context).DatabaseProviderFromEnvironmentIfAvailable(context)), + browser); + } +} + From fd62ab59c67e2eb9de9011ab040dfd1d5a15aba7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Wed, 2 Nov 2022 23:50:52 +0100 Subject: [PATCH 111/175] Pointing test-dotnet to an issue branch --- .github/workflows/pr_ci.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/pr_ci.yml b/.github/workflows/pr_ci.yml index bda3f0d3d6a..ea78ba8a1f8 100644 --- a/.github/workflows/pr_ci.yml +++ b/.github/workflows/pr_ci.yml @@ -29,21 +29,21 @@ jobs: # run: | # dotnet test -c Release --no-restore --no-build ./test/OrchardCore.Tests/OrchardCore.Tests.csproj #- name: MVC UI Tests - # uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@dev + # uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@issue/OSOE-424 # with: # build-directory: test/OrchardCore.Tests.UI.Mvc - name: Set up Azurite - uses: Lombiq/GitHub-Actions/.github/actions/setup-azurite@dev + uses: Lombiq/GitHub-Actions/.github/actions/setup-azurite@issue/OSOE-424 with: location: test/OrchardCore.Tests.UI #- name: CMS UI Tests - SQLite - # uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@dev + # uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@issue/OSOE-424 # with: # build-directory: test/OrchardCore.Tests.UI #- name: Set up SQL Server - # uses: Lombiq/GitHub-Actions/.github/actions/setup-sql-server@dev + # uses: Lombiq/GitHub-Actions/.github/actions/setup-sql-server@issue/OSOE-424 #- name: CMS UI Tests - SQL Server - # uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@dev + # uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@issue/OSOE-424 # env: # OrchardCore__UseSqlServerForUITesting: true # with: @@ -53,7 +53,7 @@ jobs: # This will cause warnings until this is fixed: https://github.com/ikalnytskyi/action-setup-postgres/issues/6. uses: ikalnytskyi/action-setup-postgres@e5b77936cf3f9d1a079ac5e8c1787fc657924809 - name: CMS UI Tests - PostgreSQL - uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@dev + uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@issue/OSOE-424 env: OrchardCore__ConnectionString: "User ID=postgres;Password=postgres;Host=localhost;Port=5432;Database=postgres;" OrchardCore__DatabaseProvider: "Postgres" From 3836bbf060ea91e5a77968a4d3f65151466420d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Thu, 3 Nov 2022 01:22:58 +0100 Subject: [PATCH 112/175] Debug test execution --- .github/workflows/pr_ci.yml | 40 +------------------------------------ 1 file changed, 1 insertion(+), 39 deletions(-) diff --git a/.github/workflows/pr_ci.yml b/.github/workflows/pr_ci.yml index ea78ba8a1f8..b62c7f1e2b4 100644 --- a/.github/workflows/pr_ci.yml +++ b/.github/workflows/pr_ci.yml @@ -14,45 +14,7 @@ jobs: os: [ubuntu-latest, windows-latest] name: Build & Test steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 - with: - node-version: "15" - - name: Setup .NET 6.0 - uses: actions/setup-dotnet@v3 - with: - dotnet-version: 6.0.x - - name: Build - run: | - dotnet build --configuration Release --framework net6.0 - #- name: Unit Tests - # run: | - # dotnet test -c Release --no-restore --no-build ./test/OrchardCore.Tests/OrchardCore.Tests.csproj - #- name: MVC UI Tests - # uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@issue/OSOE-424 - # with: - # build-directory: test/OrchardCore.Tests.UI.Mvc - - name: Set up Azurite - uses: Lombiq/GitHub-Actions/.github/actions/setup-azurite@issue/OSOE-424 - with: - location: test/OrchardCore.Tests.UI - #- name: CMS UI Tests - SQLite - # uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@issue/OSOE-424 - # with: - # build-directory: test/OrchardCore.Tests.UI - #- name: Set up SQL Server - # uses: Lombiq/GitHub-Actions/.github/actions/setup-sql-server@issue/OSOE-424 - #- name: CMS UI Tests - SQL Server - # uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@issue/OSOE-424 - # env: - # OrchardCore__UseSqlServerForUITesting: true - # with: - # build-directory: test/OrchardCore.Tests.UI - - name: Start PostgreSQL - # v3 - # This will cause warnings until this is fixed: https://github.com/ikalnytskyi/action-setup-postgres/issues/6. - uses: ikalnytskyi/action-setup-postgres@e5b77936cf3f9d1a079ac5e8c1787fc657924809 - - name: CMS UI Tests - PostgreSQL + - name: Test execution debug uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@issue/OSOE-424 env: OrchardCore__ConnectionString: "User ID=postgres;Password=postgres;Host=localhost;Port=5432;Database=postgres;" From d462e1f6ddb86299cbadecef8728d8e88b3757a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Thu, 3 Nov 2022 01:35:49 +0100 Subject: [PATCH 113/175] Dummy change to kick off build --- .../Extensions/OrchardCoreSetupParametersExtensions.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs b/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs index 7fdee71ec38..e16a6d43bee 100644 --- a/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs +++ b/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs @@ -15,6 +15,7 @@ public static OrchardCoreSetupParameters DatabaseProviderFromEnvironmentIfAvaila { setupParameters.DatabaseProvider = OrchardCoreSetupPage.DatabaseType.ProvidedByEnvironment; setupParameters.TablePrefix = context.Id; + } return setupParameters; From 10b84b5e579cc756065e94a07899b36f5f064c58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Thu, 3 Nov 2022 01:35:55 +0100 Subject: [PATCH 114/175] Revert "Dummy change to kick off build" This reverts commit d462e1f6ddb86299cbadecef8728d8e88b3757a4. --- .../Extensions/OrchardCoreSetupParametersExtensions.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs b/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs index e16a6d43bee..7fdee71ec38 100644 --- a/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs +++ b/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs @@ -15,7 +15,6 @@ public static OrchardCoreSetupParameters DatabaseProviderFromEnvironmentIfAvaila { setupParameters.DatabaseProvider = OrchardCoreSetupPage.DatabaseType.ProvidedByEnvironment; setupParameters.TablePrefix = context.Id; - } return setupParameters; From b123bdec683a9fcaa7d6771a7eab907eb733070e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Thu, 3 Nov 2022 01:46:34 +0100 Subject: [PATCH 115/175] Revert "Debug test execution" This reverts commit 3836bbf060ea91e5a77968a4d3f65151466420d0. --- .github/workflows/pr_ci.yml | 40 ++++++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pr_ci.yml b/.github/workflows/pr_ci.yml index b62c7f1e2b4..ea78ba8a1f8 100644 --- a/.github/workflows/pr_ci.yml +++ b/.github/workflows/pr_ci.yml @@ -14,7 +14,45 @@ jobs: os: [ubuntu-latest, windows-latest] name: Build & Test steps: - - name: Test execution debug + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: "15" + - name: Setup .NET 6.0 + uses: actions/setup-dotnet@v3 + with: + dotnet-version: 6.0.x + - name: Build + run: | + dotnet build --configuration Release --framework net6.0 + #- name: Unit Tests + # run: | + # dotnet test -c Release --no-restore --no-build ./test/OrchardCore.Tests/OrchardCore.Tests.csproj + #- name: MVC UI Tests + # uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@issue/OSOE-424 + # with: + # build-directory: test/OrchardCore.Tests.UI.Mvc + - name: Set up Azurite + uses: Lombiq/GitHub-Actions/.github/actions/setup-azurite@issue/OSOE-424 + with: + location: test/OrchardCore.Tests.UI + #- name: CMS UI Tests - SQLite + # uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@issue/OSOE-424 + # with: + # build-directory: test/OrchardCore.Tests.UI + #- name: Set up SQL Server + # uses: Lombiq/GitHub-Actions/.github/actions/setup-sql-server@issue/OSOE-424 + #- name: CMS UI Tests - SQL Server + # uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@issue/OSOE-424 + # env: + # OrchardCore__UseSqlServerForUITesting: true + # with: + # build-directory: test/OrchardCore.Tests.UI + - name: Start PostgreSQL + # v3 + # This will cause warnings until this is fixed: https://github.com/ikalnytskyi/action-setup-postgres/issues/6. + uses: ikalnytskyi/action-setup-postgres@e5b77936cf3f9d1a079ac5e8c1787fc657924809 + - name: CMS UI Tests - PostgreSQL uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@issue/OSOE-424 env: OrchardCore__ConnectionString: "User ID=postgres;Password=postgres;Host=localhost;Port=5432;Database=postgres;" From a151302317039d985894f5774342c44c3ce658df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Thu, 3 Nov 2022 02:05:45 +0100 Subject: [PATCH 116/175] Code styling --- .../Extensions/OrchardCoreSetupParametersExtensions.cs | 6 ++++-- test/OrchardCore.Tests.UI/UITestBase.cs | 5 +++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs b/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs index 7fdee71ec38..093112b8308 100644 --- a/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs +++ b/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs @@ -8,9 +8,11 @@ public static class OrchardCoreSetupParametersExtensions public static OrchardCoreSetupParameters DatabaseProviderFromEnvironmentIfAvailable( this OrchardCoreSetupParameters setupParameters, UITestContext context) { - var section = TestConfigurationManager.RootConfiguration.GetSection("OrchardCore"); - var databaseProvider = section.GetValue("DatabaseProvider"); + var databaseProvider = TestConfigurationManager.RootConfiguration + .GetSection("OrchardCore") + .GetValue("DatabaseProvider"); + setupParameters.TablePrefix = context.Id; if (!string.IsNullOrEmpty(databaseProvider) && (databaseProvider is "Postgres" or "MySql")) { setupParameters.DatabaseProvider = OrchardCoreSetupPage.DatabaseType.ProvidedByEnvironment; diff --git a/test/OrchardCore.Tests.UI/UITestBase.cs b/test/OrchardCore.Tests.UI/UITestBase.cs index c469f218054..095eac8c2d0 100644 --- a/test/OrchardCore.Tests.UI/UITestBase.cs +++ b/test/OrchardCore.Tests.UI/UITestBase.cs @@ -38,8 +38,9 @@ protected override Task ExecuteTestAsync( { configuration.AccessibilityCheckingConfiguration.RunAccessibilityCheckingAssertionOnAllPageChanges = true; - var section = TestConfigurationManager.RootConfiguration.GetSection("OrchardCore"); - configuration.UseSqlServer = section.GetValue("UseSqlServerForUITesting"); + configuration.UseSqlServer = TestConfigurationManager.RootConfiguration + .GetSection("OrchardCore") + .GetValue("UseSqlServerForUITesting"); if (configuration.UseSqlServer) { From 119d8d75eff6866eeb92cc7d718c173acea06f74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Thu, 3 Nov 2022 02:08:09 +0100 Subject: [PATCH 117/175] Removing debug code --- .../Extensions/OrchardCoreSetupParametersExtensions.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs b/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs index 093112b8308..be6fea169b2 100644 --- a/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs +++ b/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs @@ -12,7 +12,6 @@ public static OrchardCoreSetupParameters DatabaseProviderFromEnvironmentIfAvaila .GetSection("OrchardCore") .GetValue("DatabaseProvider"); - setupParameters.TablePrefix = context.Id; if (!string.IsNullOrEmpty(databaseProvider) && (databaseProvider is "Postgres" or "MySql")) { setupParameters.DatabaseProvider = OrchardCoreSetupPage.DatabaseType.ProvidedByEnvironment; From 320d173a917d26ff2555f04f0166bef3e89d3288 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Thu, 3 Nov 2022 02:26:41 +0100 Subject: [PATCH 118/175] Setting the table prefix from the environment as well, since it can't be set on the setup screen --- .../OrchardCoreSetupParametersExtensions.cs | 9 ++------- .../Helpers/DatabaseProviderHelper.cs | 17 +++++++++++++++++ test/OrchardCore.Tests.UI/UITestBase.cs | 15 +++++++++++++++ 3 files changed, 34 insertions(+), 7 deletions(-) create mode 100644 test/OrchardCore.Tests.UI/Helpers/DatabaseProviderHelper.cs diff --git a/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs b/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs index be6fea169b2..5ff4439dfd7 100644 --- a/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs +++ b/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs @@ -1,5 +1,5 @@ using Lombiq.Tests.UI.Services; -using Microsoft.Extensions.Configuration; +using OrchardCore.Tests.UI.Helpers; namespace Lombiq.Tests.UI.Pages { @@ -8,14 +8,9 @@ public static class OrchardCoreSetupParametersExtensions public static OrchardCoreSetupParameters DatabaseProviderFromEnvironmentIfAvailable( this OrchardCoreSetupParameters setupParameters, UITestContext context) { - var databaseProvider = TestConfigurationManager.RootConfiguration - .GetSection("OrchardCore") - .GetValue("DatabaseProvider"); - - if (!string.IsNullOrEmpty(databaseProvider) && (databaseProvider is "Postgres" or "MySql")) + if (DatabaseProviderHelper.IsDatabaseProviderProvidedByEnvironment()) { setupParameters.DatabaseProvider = OrchardCoreSetupPage.DatabaseType.ProvidedByEnvironment; - setupParameters.TablePrefix = context.Id; } return setupParameters; diff --git a/test/OrchardCore.Tests.UI/Helpers/DatabaseProviderHelper.cs b/test/OrchardCore.Tests.UI/Helpers/DatabaseProviderHelper.cs new file mode 100644 index 00000000000..8b50b3615e0 --- /dev/null +++ b/test/OrchardCore.Tests.UI/Helpers/DatabaseProviderHelper.cs @@ -0,0 +1,17 @@ +using Lombiq.Tests.UI.Services; +using Microsoft.Extensions.Configuration; + +namespace OrchardCore.Tests.UI.Helpers +{ + internal static class DatabaseProviderHelper + { + public static bool IsDatabaseProviderProvidedByEnvironment() + { + var databaseProvider = TestConfigurationManager.RootConfiguration + .GetSection("OrchardCore") + .GetValue("DatabaseProvider"); + + return !string.IsNullOrEmpty(databaseProvider) && (databaseProvider is "Postgres" or "MySql"); + } + } +} diff --git a/test/OrchardCore.Tests.UI/UITestBase.cs b/test/OrchardCore.Tests.UI/UITestBase.cs index 095eac8c2d0..87f1ff4062d 100644 --- a/test/OrchardCore.Tests.UI/UITestBase.cs +++ b/test/OrchardCore.Tests.UI/UITestBase.cs @@ -1,8 +1,10 @@ using System; +using System.IO; using System.Threading.Tasks; using Lombiq.Tests.UI; using Lombiq.Tests.UI.Services; using Microsoft.Extensions.Configuration; +using OrchardCore.Tests.UI.Helpers; using Xunit.Abstractions; namespace OrchardCore.Tests.UI @@ -49,6 +51,19 @@ protected override Task ExecuteTestAsync( ";Encrypt=False;TrustServerCertificate=True"; } + configuration.OrchardCoreConfiguration.BeforeAppStart += + (contentRootPath, argumentsBuilder) => + { + if (DatabaseProviderHelper.IsDatabaseProviderProvidedByEnvironment()) + { + var contextId = Path.GetFileName(Path.GetDirectoryName(contentRootPath)); + + argumentsBuilder.AddWithValue("OrchardCore:TablePrefix", contextId); + } + + return Task.CompletedTask; + }; + if (changeConfigurationAsync != null) await changeConfigurationAsync(configuration); }); } From 9399474d7bd9413116a8339505183c56496ea816 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Thu, 3 Nov 2022 02:48:06 +0100 Subject: [PATCH 119/175] No hyphens in DB table prefixes --- test/OrchardCore.Tests.UI/UITestBase.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/OrchardCore.Tests.UI/UITestBase.cs b/test/OrchardCore.Tests.UI/UITestBase.cs index 87f1ff4062d..38bcadf870d 100644 --- a/test/OrchardCore.Tests.UI/UITestBase.cs +++ b/test/OrchardCore.Tests.UI/UITestBase.cs @@ -57,8 +57,7 @@ protected override Task ExecuteTestAsync( if (DatabaseProviderHelper.IsDatabaseProviderProvidedByEnvironment()) { var contextId = Path.GetFileName(Path.GetDirectoryName(contentRootPath)); - - argumentsBuilder.AddWithValue("OrchardCore:TablePrefix", contextId); + argumentsBuilder.AddWithValue("OrchardCore:TablePrefix", contextId.Replace('-', '_')); } return Task.CompletedTask; From 9515fa853701db63d645bddd796569f7a5e124ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Thu, 3 Nov 2022 18:58:49 +0100 Subject: [PATCH 120/175] Docs --- test/OrchardCore.Tests.UI/UITestBase.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/OrchardCore.Tests.UI/UITestBase.cs b/test/OrchardCore.Tests.UI/UITestBase.cs index 38bcadf870d..ed2fe936c92 100644 --- a/test/OrchardCore.Tests.UI/UITestBase.cs +++ b/test/OrchardCore.Tests.UI/UITestBase.cs @@ -54,6 +54,8 @@ protected override Task ExecuteTestAsync( configuration.OrchardCoreConfiguration.BeforeAppStart += (contentRootPath, argumentsBuilder) => { + // When DatabaseProvider comes from the environment then TablePrefix needs to, too, since + // the setup screen won't have a corresponding text field. if (DatabaseProviderHelper.IsDatabaseProviderProvidedByEnvironment()) { var contextId = Path.GetFileName(Path.GetDirectoryName(contentRootPath)); From 95179cc23608d56536f57e12797ae28fb4ae73ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Thu, 3 Nov 2022 18:59:06 +0100 Subject: [PATCH 121/175] Removing unnecessary table prefix setting --- test/OrchardCore.Tests.UI/Tests/AdminMonkeyTests.cs | 1 - test/OrchardCore.Tests.UI/Tests/SaaSRecipeTests.cs | 2 -- 2 files changed, 3 deletions(-) diff --git a/test/OrchardCore.Tests.UI/Tests/AdminMonkeyTests.cs b/test/OrchardCore.Tests.UI/Tests/AdminMonkeyTests.cs index f308ddceb1c..756231627a0 100644 --- a/test/OrchardCore.Tests.UI/Tests/AdminMonkeyTests.cs +++ b/test/OrchardCore.Tests.UI/Tests/AdminMonkeyTests.cs @@ -31,7 +31,6 @@ await context.GoToSetupPageAndSetupOrchardCoreAsync( { SiteName = "Orchard Core - UI Testing", RecipeId = "Blog.Tests", - TablePrefix = "default", SiteTimeZoneValue = "America/New_York", }.DatabaseProviderFromEnvironmentIfAvailable(context)); diff --git a/test/OrchardCore.Tests.UI/Tests/SaaSRecipeTests.cs b/test/OrchardCore.Tests.UI/Tests/SaaSRecipeTests.cs index 2eb4027f2fd..e64f9785be7 100644 --- a/test/OrchardCore.Tests.UI/Tests/SaaSRecipeTests.cs +++ b/test/OrchardCore.Tests.UI/Tests/SaaSRecipeTests.cs @@ -45,7 +45,6 @@ await context.GoToSetupPageAndSetupOrchardCoreAsync( { SiteName = "Orchard Core - UI Testing", RecipeId = "SaaS.Tests", - TablePrefix = "default", SiteTimeZoneValue = "America/New_York", }.DatabaseProviderFromEnvironmentIfAvailable(context)); @@ -58,7 +57,6 @@ await context.GoToSetupPageAndSetupOrchardCoreAsync( { SiteName = "Test Tenant", RecipeId = "Blog.Tests", - TablePrefix = "test", RunSetupOnCurrentPage = true, }.DatabaseProviderFromEnvironmentIfAvailable(context)); From 8b9da4de4357cc98ba3442bdb257d75db4fc640d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Thu, 3 Nov 2022 19:15:53 +0100 Subject: [PATCH 122/175] Setting the DB connection strings on the setup screen instead of the environment --- .github/workflows/pr_ci.yml | 5 ++--- .../OrchardCoreSetupParametersExtensions.cs | 8 ++++--- .../Helpers/DatabaseProviderHelper.cs | 9 ++++---- .../Tests/AdminMonkeyTests.cs | 2 +- .../Tests/AgencyRecipeTests.cs | 2 +- .../Tests/AzureBlobStorageTests.cs | 2 +- .../Tests/BlankRecipeTests.cs | 2 +- .../Tests/BlogRecipeTests.cs | 2 +- .../Tests/ComingSoonRecipeTests.cs | 2 +- .../Tests/HeadlessRecipeTests.cs | 2 +- .../Tests/InvalidSetupTests.cs | 2 +- .../Tests/SaaSRecipeTests.cs | 6 ++--- test/OrchardCore.Tests.UI/UITestBase.cs | 22 +++---------------- 13 files changed, 25 insertions(+), 41 deletions(-) diff --git a/.github/workflows/pr_ci.yml b/.github/workflows/pr_ci.yml index ea78ba8a1f8..a3fc3b69097 100644 --- a/.github/workflows/pr_ci.yml +++ b/.github/workflows/pr_ci.yml @@ -45,7 +45,7 @@ jobs: #- name: CMS UI Tests - SQL Server # uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@issue/OSOE-424 # env: - # OrchardCore__UseSqlServerForUITesting: true + # OrchardCore__UITestingCIDatabaseProvider: "SqlServer" # with: # build-directory: test/OrchardCore.Tests.UI - name: Start PostgreSQL @@ -55,7 +55,6 @@ jobs: - name: CMS UI Tests - PostgreSQL uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@issue/OSOE-424 env: - OrchardCore__ConnectionString: "User ID=postgres;Password=postgres;Host=localhost;Port=5432;Database=postgres;" - OrchardCore__DatabaseProvider: "Postgres" + OrchardCore__UITestingCIDatabaseProvider: "Postgres" with: build-directory: test/OrchardCore.Tests.UI diff --git a/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs b/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs index 5ff4439dfd7..4c5077438ee 100644 --- a/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs +++ b/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs @@ -5,12 +5,14 @@ namespace Lombiq.Tests.UI.Pages { public static class OrchardCoreSetupParametersExtensions { - public static OrchardCoreSetupParameters DatabaseProviderFromEnvironmentIfAvailable( + public static OrchardCoreSetupParameters ConfigureDatabaseSettings( this OrchardCoreSetupParameters setupParameters, UITestContext context) { - if (DatabaseProviderHelper.IsDatabaseProviderProvidedByEnvironment()) + if (DatabaseProviderHelper.GetCIDatabaseProvider() == OrchardCoreSetupPage.DatabaseType.Postgres) { - setupParameters.DatabaseProvider = OrchardCoreSetupPage.DatabaseType.ProvidedByEnvironment; + setupParameters.DatabaseProvider = OrchardCoreSetupPage.DatabaseType.Postgres; + setupParameters.ConnectionString = "User ID=postgres;Password=postgres;Host=localhost;Port=5432;Database=postgres;"; + setupParameters.TablePrefix = context.Id.Replace('-', '_'); } return setupParameters; diff --git a/test/OrchardCore.Tests.UI/Helpers/DatabaseProviderHelper.cs b/test/OrchardCore.Tests.UI/Helpers/DatabaseProviderHelper.cs index 8b50b3615e0..deb352cd262 100644 --- a/test/OrchardCore.Tests.UI/Helpers/DatabaseProviderHelper.cs +++ b/test/OrchardCore.Tests.UI/Helpers/DatabaseProviderHelper.cs @@ -1,3 +1,4 @@ +using Lombiq.Tests.UI.Pages; using Lombiq.Tests.UI.Services; using Microsoft.Extensions.Configuration; @@ -5,13 +6,11 @@ namespace OrchardCore.Tests.UI.Helpers { internal static class DatabaseProviderHelper { - public static bool IsDatabaseProviderProvidedByEnvironment() + public static OrchardCoreSetupPage.DatabaseType GetCIDatabaseProvider() { - var databaseProvider = TestConfigurationManager.RootConfiguration + return TestConfigurationManager.RootConfiguration .GetSection("OrchardCore") - .GetValue("DatabaseProvider"); - - return !string.IsNullOrEmpty(databaseProvider) && (databaseProvider is "Postgres" or "MySql"); + .GetValue("UITestingCIDatabaseProvider", OrchardCoreSetupPage.DatabaseType.Sqlite); } } } diff --git a/test/OrchardCore.Tests.UI/Tests/AdminMonkeyTests.cs b/test/OrchardCore.Tests.UI/Tests/AdminMonkeyTests.cs index 756231627a0..d9ae86696aa 100644 --- a/test/OrchardCore.Tests.UI/Tests/AdminMonkeyTests.cs +++ b/test/OrchardCore.Tests.UI/Tests/AdminMonkeyTests.cs @@ -32,7 +32,7 @@ await context.GoToSetupPageAndSetupOrchardCoreAsync( SiteName = "Orchard Core - UI Testing", RecipeId = "Blog.Tests", SiteTimeZoneValue = "America/New_York", - }.DatabaseProviderFromEnvironmentIfAvailable(context)); + }.ConfigureDatabaseSettings(context)); await context.TestAdminAsMonkeyRecursivelyAsync( new MonkeyTestingOptions diff --git a/test/OrchardCore.Tests.UI/Tests/AgencyRecipeTests.cs b/test/OrchardCore.Tests.UI/Tests/AgencyRecipeTests.cs index d3c81440970..15cdc6a8923 100644 --- a/test/OrchardCore.Tests.UI/Tests/AgencyRecipeTests.cs +++ b/test/OrchardCore.Tests.UI/Tests/AgencyRecipeTests.cs @@ -25,7 +25,7 @@ public Task BasicOrchardFeaturesShouldWorkWithAgency(Browser browser) => await context.TestSetupAsync(new OrchardCoreSetupParameters(context) { RecipeId = "Agency.Tests", - }.DatabaseProviderFromEnvironmentIfAvailable(context)); + }.ConfigureDatabaseSettings(context)); await context.TestRegistrationWithInvalidDataAsync(); await context.TestRegistrationAsync(); diff --git a/test/OrchardCore.Tests.UI/Tests/AzureBlobStorageTests.cs b/test/OrchardCore.Tests.UI/Tests/AzureBlobStorageTests.cs index 087d8ca5e81..704287df6b4 100644 --- a/test/OrchardCore.Tests.UI/Tests/AzureBlobStorageTests.cs +++ b/test/OrchardCore.Tests.UI/Tests/AzureBlobStorageTests.cs @@ -23,7 +23,7 @@ public Task BasicOrchardFeaturesShouldWorkWithBlogAndAzureBlobStorage(Browser br await context.TestSetupAsync(new OrchardCoreSetupParameters(context) { RecipeId = "Blog.Tests", - }.DatabaseProviderFromEnvironmentIfAvailable(context)); + }.ConfigureDatabaseSettings(context)); await context.TestBasicOrchardFeaturesExceptSetupAsync(); }, diff --git a/test/OrchardCore.Tests.UI/Tests/BlankRecipeTests.cs b/test/OrchardCore.Tests.UI/Tests/BlankRecipeTests.cs index dddc41cecce..9fbe4816e09 100644 --- a/test/OrchardCore.Tests.UI/Tests/BlankRecipeTests.cs +++ b/test/OrchardCore.Tests.UI/Tests/BlankRecipeTests.cs @@ -26,7 +26,7 @@ public Task BasicOrchardFeaturesShouldWorkWithBlank(Browser browser) => await context.TestSetupAsync(new OrchardCoreSetupParameters(context) { RecipeId = "Blank.Tests", - }.DatabaseProviderFromEnvironmentIfAvailable(context)); + }.ConfigureDatabaseSettings(context)); await context.TestLoginWithInvalidDataAsync(); await context.TestLoginAsync(); diff --git a/test/OrchardCore.Tests.UI/Tests/BlogRecipeTests.cs b/test/OrchardCore.Tests.UI/Tests/BlogRecipeTests.cs index 7d29c521fce..24a346a3da0 100644 --- a/test/OrchardCore.Tests.UI/Tests/BlogRecipeTests.cs +++ b/test/OrchardCore.Tests.UI/Tests/BlogRecipeTests.cs @@ -24,7 +24,7 @@ public Task BasicOrchardFeaturesShouldWorkWithBlog(Browser browser) => await context.TestSetupAsync(new OrchardCoreSetupParameters(context) { RecipeId = "Blog.Tests", - }.DatabaseProviderFromEnvironmentIfAvailable(context)); + }.ConfigureDatabaseSettings(context)); await context.TestBasicOrchardFeaturesExceptSetupAsync(); }, diff --git a/test/OrchardCore.Tests.UI/Tests/ComingSoonRecipeTests.cs b/test/OrchardCore.Tests.UI/Tests/ComingSoonRecipeTests.cs index 805b5dcada9..365a850aec4 100644 --- a/test/OrchardCore.Tests.UI/Tests/ComingSoonRecipeTests.cs +++ b/test/OrchardCore.Tests.UI/Tests/ComingSoonRecipeTests.cs @@ -23,7 +23,7 @@ public Task BasicOrchardFeaturesShouldWorkWithComingSoon(Browser browser) => await context.TestSetupAsync(new OrchardCoreSetupParameters(context) { RecipeId = "ComingSoon.Tests", - }.DatabaseProviderFromEnvironmentIfAvailable(context)); + }.ConfigureDatabaseSettings(context)); await context.TestRegistrationWithInvalidDataAsync(); await context.TestRegistrationAsync(); diff --git a/test/OrchardCore.Tests.UI/Tests/HeadlessRecipeTests.cs b/test/OrchardCore.Tests.UI/Tests/HeadlessRecipeTests.cs index 665cbd9817c..2db773c9404 100644 --- a/test/OrchardCore.Tests.UI/Tests/HeadlessRecipeTests.cs +++ b/test/OrchardCore.Tests.UI/Tests/HeadlessRecipeTests.cs @@ -23,7 +23,7 @@ public Task BasicOrchardFeaturesShouldWorkWithHeadless(Browser browser) => await context.TestSetupAsync(new OrchardCoreSetupParameters(context) { RecipeId = "Headless.Tests", - }.DatabaseProviderFromEnvironmentIfAvailable(context)); + }.ConfigureDatabaseSettings(context)); await context.TestLoginWithInvalidDataAsync(); await context.TestLoginAsync(); diff --git a/test/OrchardCore.Tests.UI/Tests/InvalidSetupTests.cs b/test/OrchardCore.Tests.UI/Tests/InvalidSetupTests.cs index f2af22cba4d..1e8b30638d8 100644 --- a/test/OrchardCore.Tests.UI/Tests/InvalidSetupTests.cs +++ b/test/OrchardCore.Tests.UI/Tests/InvalidSetupTests.cs @@ -19,7 +19,7 @@ public InvalidSetupTests(ITestOutputHelper testOutputHelper) public Task SetupWithInvalidDataShouldFail(Browser browser) => ExecuteTestAsync( context => context.TestSetupWithInvalidDataAsync( - new OrchardCoreSetupParameters(context).DatabaseProviderFromEnvironmentIfAvailable(context)), + new OrchardCoreSetupParameters(context).ConfigureDatabaseSettings(context)), browser); } } diff --git a/test/OrchardCore.Tests.UI/Tests/SaaSRecipeTests.cs b/test/OrchardCore.Tests.UI/Tests/SaaSRecipeTests.cs index e64f9785be7..8ff3963daa2 100644 --- a/test/OrchardCore.Tests.UI/Tests/SaaSRecipeTests.cs +++ b/test/OrchardCore.Tests.UI/Tests/SaaSRecipeTests.cs @@ -23,7 +23,7 @@ public Task BasicOrchardFeaturesShouldWorkWithSaaS(Browser browser) => await context.TestSetupAsync(new OrchardCoreSetupParameters(context) { RecipeId = "SaaS.Tests", - }.DatabaseProviderFromEnvironmentIfAvailable(context)); + }.ConfigureDatabaseSettings(context)); await context.TestRegistrationWithInvalidDataAsync(); await context.TestRegistrationAsync(); @@ -46,7 +46,7 @@ await context.GoToSetupPageAndSetupOrchardCoreAsync( SiteName = "Orchard Core - UI Testing", RecipeId = "SaaS.Tests", SiteTimeZoneValue = "America/New_York", - }.DatabaseProviderFromEnvironmentIfAvailable(context)); + }.ConfigureDatabaseSettings(context)); await context.SignInDirectlyAsync(); @@ -58,7 +58,7 @@ await context.GoToSetupPageAndSetupOrchardCoreAsync( SiteName = "Test Tenant", RecipeId = "Blog.Tests", RunSetupOnCurrentPage = true, - }.DatabaseProviderFromEnvironmentIfAvailable(context)); + }.ConfigureDatabaseSettings(context)); await context.TestBasicOrchardFeaturesExceptSetupAsync(); }, diff --git a/test/OrchardCore.Tests.UI/UITestBase.cs b/test/OrchardCore.Tests.UI/UITestBase.cs index ed2fe936c92..9c9e32943f6 100644 --- a/test/OrchardCore.Tests.UI/UITestBase.cs +++ b/test/OrchardCore.Tests.UI/UITestBase.cs @@ -1,9 +1,8 @@ using System; -using System.IO; using System.Threading.Tasks; using Lombiq.Tests.UI; +using Lombiq.Tests.UI.Pages; using Lombiq.Tests.UI.Services; -using Microsoft.Extensions.Configuration; using OrchardCore.Tests.UI.Helpers; using Xunit.Abstractions; @@ -40,9 +39,8 @@ protected override Task ExecuteTestAsync( { configuration.AccessibilityCheckingConfiguration.RunAccessibilityCheckingAssertionOnAllPageChanges = true; - configuration.UseSqlServer = TestConfigurationManager.RootConfiguration - .GetSection("OrchardCore") - .GetValue("UseSqlServerForUITesting"); + configuration.UseSqlServer = + DatabaseProviderHelper.GetCIDatabaseProvider() == OrchardCoreSetupPage.DatabaseType.SqlServer; if (configuration.UseSqlServer) { @@ -51,20 +49,6 @@ protected override Task ExecuteTestAsync( ";Encrypt=False;TrustServerCertificate=True"; } - configuration.OrchardCoreConfiguration.BeforeAppStart += - (contentRootPath, argumentsBuilder) => - { - // When DatabaseProvider comes from the environment then TablePrefix needs to, too, since - // the setup screen won't have a corresponding text field. - if (DatabaseProviderHelper.IsDatabaseProviderProvidedByEnvironment()) - { - var contextId = Path.GetFileName(Path.GetDirectoryName(contentRootPath)); - argumentsBuilder.AddWithValue("OrchardCore:TablePrefix", contextId.Replace('-', '_')); - } - - return Task.CompletedTask; - }; - if (changeConfigurationAsync != null) await changeConfigurationAsync(configuration); }); } From f3c0588a8902c0e8ba74605ef0c9a8b1263d1149 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Thu, 3 Nov 2022 19:34:33 +0100 Subject: [PATCH 123/175] Temporarily disabling Windows builds for faster feedback --- .github/workflows/pr_ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr_ci.yml b/.github/workflows/pr_ci.yml index a3fc3b69097..9fc199d22c2 100644 --- a/.github/workflows/pr_ci.yml +++ b/.github/workflows/pr_ci.yml @@ -11,7 +11,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest, windows-latest] + os: [ubuntu-latest] name: Build & Test steps: - uses: actions/checkout@v3 From 40b6bee6e446bc06a6d332de8cd7ab2f17267106 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Thu, 3 Nov 2022 19:55:47 +0100 Subject: [PATCH 124/175] Attempting to fix Postgres table prefix generation --- .../OrchardCoreSetupParametersExtensions.cs | 3 ++- .../Tests/SaaSRecipeTests.cs | 17 ++++++++++------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs b/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs index 4c5077438ee..dc3287b88c8 100644 --- a/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs +++ b/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs @@ -12,7 +12,8 @@ public static OrchardCoreSetupParameters ConfigureDatabaseSettings( { setupParameters.DatabaseProvider = OrchardCoreSetupPage.DatabaseType.Postgres; setupParameters.ConnectionString = "User ID=postgres;Password=postgres;Host=localhost;Port=5432;Database=postgres;"; - setupParameters.TablePrefix = context.Id.Replace('-', '_'); + // Table names in PostgreSQL should begin with a letter and mustn't contain hyphens. + setupParameters.TablePrefix = "test_" + context.Id.Replace('-', '_'); } return setupParameters; diff --git a/test/OrchardCore.Tests.UI/Tests/SaaSRecipeTests.cs b/test/OrchardCore.Tests.UI/Tests/SaaSRecipeTests.cs index 8ff3963daa2..dd2db08a51a 100644 --- a/test/OrchardCore.Tests.UI/Tests/SaaSRecipeTests.cs +++ b/test/OrchardCore.Tests.UI/Tests/SaaSRecipeTests.cs @@ -52,13 +52,16 @@ await context.GoToSetupPageAndSetupOrchardCoreAsync( await context.CreateAndSwitchToTenantManuallyAsync("test", "test"); - await context.GoToSetupPageAndSetupOrchardCoreAsync( - new OrchardCoreSetupParameters(context) - { - SiteName = "Test Tenant", - RecipeId = "Blog.Tests", - RunSetupOnCurrentPage = true, - }.ConfigureDatabaseSettings(context)); + var tenantSetupParameters = new OrchardCoreSetupParameters(context) + { + SiteName = "Test Tenant", + RecipeId = "Blog.Tests", + RunSetupOnCurrentPage = true, + }.ConfigureDatabaseSettings(context); + + tenantSetupParameters.TablePrefix += "_tenant"; + + await context.GoToSetupPageAndSetupOrchardCoreAsync(tenantSetupParameters); await context.TestBasicOrchardFeaturesExceptSetupAsync(); }, From 9c2b48ad15c7a02f4b9cc81e2d95d746070f499d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Thu, 3 Nov 2022 20:10:28 +0100 Subject: [PATCH 125/175] DRY with MySQL config --- .../OrchardCoreSetupParametersExtensions.cs | 24 +++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs b/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs index dc3287b88c8..aeb7ad70271 100644 --- a/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs +++ b/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs @@ -8,12 +8,28 @@ public static class OrchardCoreSetupParametersExtensions public static OrchardCoreSetupParameters ConfigureDatabaseSettings( this OrchardCoreSetupParameters setupParameters, UITestContext context) { - if (DatabaseProviderHelper.GetCIDatabaseProvider() == OrchardCoreSetupPage.DatabaseType.Postgres) + var provider = DatabaseProviderHelper.GetCIDatabaseProvider(); + + if (provider is not (OrchardCoreSetupPage.DatabaseType.Postgres or OrchardCoreSetupPage.DatabaseType.MySql)) + { + return setupParameters; + } + + setupParameters.DatabaseProvider = provider; + + // Table names in PostgreSQL should begin with a letter and mustn't contain hyphens + // (https://www.postgresql.org/docs/7.0/syntax525.htm). In MariaDB the rules are similar (table names can + // start with numbers but it's safer if they don't), see https://mariadb.com/kb/en/identifier-names/. + setupParameters.TablePrefix = "test_" + context.Id.Replace('-', '_'); + + if (provider == OrchardCoreSetupPage.DatabaseType.Postgres) { - setupParameters.DatabaseProvider = OrchardCoreSetupPage.DatabaseType.Postgres; setupParameters.ConnectionString = "User ID=postgres;Password=postgres;Host=localhost;Port=5432;Database=postgres;"; - // Table names in PostgreSQL should begin with a letter and mustn't contain hyphens. - setupParameters.TablePrefix = "test_" + context.Id.Replace('-', '_'); + + } + else if (provider == OrchardCoreSetupPage.DatabaseType.MySql) + { + setupParameters.ConnectionString = "server=mariadb;uid=root;pwd=test123;database=test"; } return setupParameters; From 5adc68de0642159599de31e49d55c6e3108fe04a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Thu, 3 Nov 2022 20:11:08 +0100 Subject: [PATCH 126/175] Removing underscores from table names as that perhaps mixes up things --- .../Extensions/OrchardCoreSetupParametersExtensions.cs | 2 +- test/OrchardCore.Tests.UI/Tests/SaaSRecipeTests.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs b/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs index aeb7ad70271..f2047e160f8 100644 --- a/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs +++ b/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs @@ -20,7 +20,7 @@ public static OrchardCoreSetupParameters ConfigureDatabaseSettings( // Table names in PostgreSQL should begin with a letter and mustn't contain hyphens // (https://www.postgresql.org/docs/7.0/syntax525.htm). In MariaDB the rules are similar (table names can // start with numbers but it's safer if they don't), see https://mariadb.com/kb/en/identifier-names/. - setupParameters.TablePrefix = "test_" + context.Id.Replace('-', '_'); + setupParameters.TablePrefix = "test" + context.Id.Replace('-', ''); if (provider == OrchardCoreSetupPage.DatabaseType.Postgres) { diff --git a/test/OrchardCore.Tests.UI/Tests/SaaSRecipeTests.cs b/test/OrchardCore.Tests.UI/Tests/SaaSRecipeTests.cs index dd2db08a51a..274fa44b6ed 100644 --- a/test/OrchardCore.Tests.UI/Tests/SaaSRecipeTests.cs +++ b/test/OrchardCore.Tests.UI/Tests/SaaSRecipeTests.cs @@ -59,7 +59,7 @@ await context.GoToSetupPageAndSetupOrchardCoreAsync( RunSetupOnCurrentPage = true, }.ConfigureDatabaseSettings(context); - tenantSetupParameters.TablePrefix += "_tenant"; + tenantSetupParameters.TablePrefix += "tenant"; await context.GoToSetupPageAndSetupOrchardCoreAsync(tenantSetupParameters); From 00d0c0447365217a6c3ae25439c42110ebc144e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Thu, 3 Nov 2022 20:14:19 +0100 Subject: [PATCH 127/175] Dummy change to kick off build --- .../Extensions/OrchardCoreSetupParametersExtensions.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs b/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs index f2047e160f8..64d927c2a80 100644 --- a/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs +++ b/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs @@ -20,7 +20,7 @@ public static OrchardCoreSetupParameters ConfigureDatabaseSettings( // Table names in PostgreSQL should begin with a letter and mustn't contain hyphens // (https://www.postgresql.org/docs/7.0/syntax525.htm). In MariaDB the rules are similar (table names can // start with numbers but it's safer if they don't), see https://mariadb.com/kb/en/identifier-names/. - setupParameters.TablePrefix = "test" + context.Id.Replace('-', ''); + setupParameters.TablePrefix = "test" + context.Id.Replac e('-', ''); if (provider == OrchardCoreSetupPage.DatabaseType.Postgres) { From b8663eb23ad9195d81acf80a9f056a570b7be71f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Thu, 3 Nov 2022 20:14:23 +0100 Subject: [PATCH 128/175] Revert "Dummy change to kick off build" This reverts commit 00d0c0447365217a6c3ae25439c42110ebc144e7. --- .../Extensions/OrchardCoreSetupParametersExtensions.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs b/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs index 64d927c2a80..f2047e160f8 100644 --- a/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs +++ b/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs @@ -20,7 +20,7 @@ public static OrchardCoreSetupParameters ConfigureDatabaseSettings( // Table names in PostgreSQL should begin with a letter and mustn't contain hyphens // (https://www.postgresql.org/docs/7.0/syntax525.htm). In MariaDB the rules are similar (table names can // start with numbers but it's safer if they don't), see https://mariadb.com/kb/en/identifier-names/. - setupParameters.TablePrefix = "test" + context.Id.Replac e('-', ''); + setupParameters.TablePrefix = "test" + context.Id.Replace('-', ''); if (provider == OrchardCoreSetupPage.DatabaseType.Postgres) { From 21a6bd36bf22b80cedb2d277c4ac79e1671629a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Thu, 3 Nov 2022 20:18:31 +0100 Subject: [PATCH 129/175] Fixing build error --- .../Extensions/OrchardCoreSetupParametersExtensions.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs b/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs index f2047e160f8..532c68a2b1c 100644 --- a/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs +++ b/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs @@ -20,7 +20,7 @@ public static OrchardCoreSetupParameters ConfigureDatabaseSettings( // Table names in PostgreSQL should begin with a letter and mustn't contain hyphens // (https://www.postgresql.org/docs/7.0/syntax525.htm). In MariaDB the rules are similar (table names can // start with numbers but it's safer if they don't), see https://mariadb.com/kb/en/identifier-names/. - setupParameters.TablePrefix = "test" + context.Id.Replace('-', ''); + setupParameters.TablePrefix = "test" + context.Id.Replace("-", ""); if (provider == OrchardCoreSetupPage.DatabaseType.Postgres) { From 26e62e2b7f36bbcf6313647251b001a7285602e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Thu, 3 Nov 2022 20:30:35 +0100 Subject: [PATCH 130/175] MySQL testing --- .github/workflows/pr_ci.yml | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/.github/workflows/pr_ci.yml b/.github/workflows/pr_ci.yml index 9fc199d22c2..6464dab29a7 100644 --- a/.github/workflows/pr_ci.yml +++ b/.github/workflows/pr_ci.yml @@ -14,6 +14,17 @@ jobs: os: [ubuntu-latest] name: Build & Test steps: + # MariaDB is an open-source drop-in replacement of MySQL, so we can use it instead. + - name: Set up MariaDB + # v1.13.0 + uses: shogo82148/actions-setup-mysql@e9da98ba6e914131f3111105e445c06bc1629280 + with: + distribution: "mariadb" + root-password: "test123" + - name: Create MariaDB database + shell: pwsh + run: | + mysql --user=root --password=test123 -e "CREATE DATABASE mariadb" - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: @@ -48,13 +59,19 @@ jobs: # OrchardCore__UITestingCIDatabaseProvider: "SqlServer" # with: # build-directory: test/OrchardCore.Tests.UI - - name: Start PostgreSQL - # v3 - # This will cause warnings until this is fixed: https://github.com/ikalnytskyi/action-setup-postgres/issues/6. - uses: ikalnytskyi/action-setup-postgres@e5b77936cf3f9d1a079ac5e8c1787fc657924809 - - name: CMS UI Tests - PostgreSQL + #- name: Start PostgreSQL + # # v3 + # # This will cause warnings until this is fixed: https://github.com/ikalnytskyi/action-setup-postgres/issues/6. + # uses: ikalnytskyi/action-setup-postgres@e5b77936cf3f9d1a079ac5e8c1787fc657924809 + #- name: CMS UI Tests - PostgreSQL + # uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@issue/OSOE-424 + # env: + # OrchardCore__UITestingCIDatabaseProvider: "Postgres" + # with: + # build-directory: test/OrchardCore.Tests.UI + - name: CMS UI Tests - MySql uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@issue/OSOE-424 env: - OrchardCore__UITestingCIDatabaseProvider: "Postgres" + OrchardCore__UITestingCIDatabaseProvider: "MySql" with: build-directory: test/OrchardCore.Tests.UI From 57b771bd6615209e6c8298e3c6391dae029e85eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Thu, 3 Nov 2022 20:35:09 +0100 Subject: [PATCH 131/175] Configuring the host for the DB --- .github/workflows/pr_ci.yml | 2 +- .../Extensions/OrchardCoreSetupParametersExtensions.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr_ci.yml b/.github/workflows/pr_ci.yml index 6464dab29a7..24db6bc52c0 100644 --- a/.github/workflows/pr_ci.yml +++ b/.github/workflows/pr_ci.yml @@ -24,7 +24,7 @@ jobs: - name: Create MariaDB database shell: pwsh run: | - mysql --user=root --password=test123 -e "CREATE DATABASE mariadb" + mysql --user=root --password=test123 --host=127.0.0.1 -execute="CREATE DATABASE mariadb" - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: diff --git a/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs b/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs index 532c68a2b1c..7cc4fe232a7 100644 --- a/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs +++ b/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs @@ -29,7 +29,7 @@ public static OrchardCoreSetupParameters ConfigureDatabaseSettings( } else if (provider == OrchardCoreSetupPage.DatabaseType.MySql) { - setupParameters.ConnectionString = "server=mariadb;uid=root;pwd=test123;database=test"; + setupParameters.ConnectionString = "server=127.0.0.1;uid=root;pwd=test123;database=test"; } return setupParameters; From 55f4500d2b423cd7373e492a3f6475b1f0b4ab95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Thu, 3 Nov 2022 20:36:21 +0100 Subject: [PATCH 132/175] Syntax --- .github/workflows/pr_ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr_ci.yml b/.github/workflows/pr_ci.yml index 24db6bc52c0..37f30c12fca 100644 --- a/.github/workflows/pr_ci.yml +++ b/.github/workflows/pr_ci.yml @@ -24,7 +24,7 @@ jobs: - name: Create MariaDB database shell: pwsh run: | - mysql --user=root --password=test123 --host=127.0.0.1 -execute="CREATE DATABASE mariadb" + mysql --user=root --password=test123 --host=127.0.0.1 --execute="CREATE DATABASE mariadb" - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: From 9aca1fba0294e96589e3fde686472b3a55881708 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Thu, 3 Nov 2022 20:50:23 +0100 Subject: [PATCH 133/175] Moving MariaDB setup to its actual place in the workflow --- .github/workflows/pr_ci.yml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/pr_ci.yml b/.github/workflows/pr_ci.yml index 37f30c12fca..4327a7a6e9c 100644 --- a/.github/workflows/pr_ci.yml +++ b/.github/workflows/pr_ci.yml @@ -14,17 +14,6 @@ jobs: os: [ubuntu-latest] name: Build & Test steps: - # MariaDB is an open-source drop-in replacement of MySQL, so we can use it instead. - - name: Set up MariaDB - # v1.13.0 - uses: shogo82148/actions-setup-mysql@e9da98ba6e914131f3111105e445c06bc1629280 - with: - distribution: "mariadb" - root-password: "test123" - - name: Create MariaDB database - shell: pwsh - run: | - mysql --user=root --password=test123 --host=127.0.0.1 --execute="CREATE DATABASE mariadb" - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: @@ -69,6 +58,17 @@ jobs: # OrchardCore__UITestingCIDatabaseProvider: "Postgres" # with: # build-directory: test/OrchardCore.Tests.UI + # MariaDB is an open-source drop-in replacement of MySQL, so we can use it instead. + - name: Set up MariaDB + # v1.13.0 + uses: shogo82148/actions-setup-mysql@e9da98ba6e914131f3111105e445c06bc1629280 + with: + distribution: "mariadb" + root-password: "test123" + - name: Create MariaDB database + shell: pwsh + run: | + mysql --user=root --password=test123 --host=127.0.0.1 --execute="CREATE DATABASE mariadb" - name: CMS UI Tests - MySql uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@issue/OSOE-424 env: From 291364f3dfd4685a475135cc2db69a544c743a27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Thu, 3 Nov 2022 20:56:03 +0100 Subject: [PATCH 134/175] Updating Lombiq.Tests.UI* with fix for selecting MySQL during setup --- src/OrchardCore.Build/Dependencies.props | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/OrchardCore.Build/Dependencies.props b/src/OrchardCore.Build/Dependencies.props index 8dd0177d5dc..d3f490f8d26 100644 --- a/src/OrchardCore.Build/Dependencies.props +++ b/src/OrchardCore.Build/Dependencies.props @@ -26,9 +26,9 @@ - - - + + + From 9fb42a826e65682173f397063b3281695af10737 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Thu, 3 Nov 2022 21:40:32 +0100 Subject: [PATCH 135/175] Shortening table names --- .../OrchardCoreSetupParametersExtensions.cs | 14 +++++++++----- test/OrchardCore.Tests.UI/Tests/SaaSRecipeTests.cs | 2 +- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs b/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs index 7cc4fe232a7..9673abed941 100644 --- a/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs +++ b/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs @@ -17,15 +17,19 @@ public static OrchardCoreSetupParameters ConfigureDatabaseSettings( setupParameters.DatabaseProvider = provider; - // Table names in PostgreSQL should begin with a letter and mustn't contain hyphens - // (https://www.postgresql.org/docs/7.0/syntax525.htm). In MariaDB the rules are similar (table names can - // start with numbers but it's safer if they don't), see https://mariadb.com/kb/en/identifier-names/. - setupParameters.TablePrefix = "test" + context.Id.Replace("-", ""); + // Since apart from SQLite and SQL Server all the tests will use the same, single DB, each test and each of + // the executions (if repeated due to transient errors) should use a unique table prefix. + // Table names in PostgreSQL should begin with a letter mustn't contain hyphens + // (https://www.postgresql.org/docs/7.0/syntax525.htm), and can be at most 63 characters long. In + // MySQL/MariaDB the rules are similar (table names can start with numbers but it's safer if they don't, + // and the max table name length is 64 characters), see https://mariadb.com/kb/en/identifier-names/. With + // the leading "t" and the no-hyphen context ID it would be 34 characters, so we have to shorten it. With + // the hash it will be at most 12 characters. + setupParameters.TablePrefix = "t" + context.Id.Replace("-", "").GetHashCode(); if (provider == OrchardCoreSetupPage.DatabaseType.Postgres) { setupParameters.ConnectionString = "User ID=postgres;Password=postgres;Host=localhost;Port=5432;Database=postgres;"; - } else if (provider == OrchardCoreSetupPage.DatabaseType.MySql) { diff --git a/test/OrchardCore.Tests.UI/Tests/SaaSRecipeTests.cs b/test/OrchardCore.Tests.UI/Tests/SaaSRecipeTests.cs index 274fa44b6ed..215fcab63de 100644 --- a/test/OrchardCore.Tests.UI/Tests/SaaSRecipeTests.cs +++ b/test/OrchardCore.Tests.UI/Tests/SaaSRecipeTests.cs @@ -59,7 +59,7 @@ await context.GoToSetupPageAndSetupOrchardCoreAsync( RunSetupOnCurrentPage = true, }.ConfigureDatabaseSettings(context); - tenantSetupParameters.TablePrefix += "tenant"; + tenantSetupParameters.TablePrefix += "2"; await context.GoToSetupPageAndSetupOrchardCoreAsync(tenantSetupParameters); From a0f6501bc39d7e049849424efea4d566627f1f7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Thu, 3 Nov 2022 21:53:12 +0100 Subject: [PATCH 136/175] Re-enabling Windows builds --- .github/workflows/pr_ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr_ci.yml b/.github/workflows/pr_ci.yml index 4327a7a6e9c..0d39fd0f9f1 100644 --- a/.github/workflows/pr_ci.yml +++ b/.github/workflows/pr_ci.yml @@ -11,7 +11,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest] + os: [ubuntu-latest, windows-latest] name: Build & Test steps: - uses: actions/checkout@v3 From 4cc769c95b203edf822e69b07c24852fcd08da12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Thu, 3 Nov 2022 21:55:06 +0100 Subject: [PATCH 137/175] Re-enabling all tests --- test/OrchardCore.Tests.UI/Tests/AdminMonkeyTests.cs | 2 +- test/OrchardCore.Tests.UI/Tests/AgencyRecipeTests.cs | 2 +- test/OrchardCore.Tests.UI/Tests/AzureBlobStorageTests.cs | 2 +- test/OrchardCore.Tests.UI/Tests/BlankRecipeTests.cs | 2 +- test/OrchardCore.Tests.UI/Tests/ComingSoonRecipeTests.cs | 2 +- test/OrchardCore.Tests.UI/Tests/HeadlessRecipeTests.cs | 2 +- test/OrchardCore.Tests.UI/Tests/InvalidSetupTests.cs | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/test/OrchardCore.Tests.UI/Tests/AdminMonkeyTests.cs b/test/OrchardCore.Tests.UI/Tests/AdminMonkeyTests.cs index d9ae86696aa..15f4b992c22 100644 --- a/test/OrchardCore.Tests.UI/Tests/AdminMonkeyTests.cs +++ b/test/OrchardCore.Tests.UI/Tests/AdminMonkeyTests.cs @@ -21,7 +21,7 @@ public AdminMonkeyTests(ITestOutputHelper testOutputHelper) { } - [Theory(Skip = "Minimal test suite for multi-DB testing."), Chrome] + [Theory, Chrome] public Task TestAdminPagesAsMonkeyRecursivelyShouldWorkWithAdminUser(Browser browser) => ExecuteTestAsync( async context => diff --git a/test/OrchardCore.Tests.UI/Tests/AgencyRecipeTests.cs b/test/OrchardCore.Tests.UI/Tests/AgencyRecipeTests.cs index 15cdc6a8923..f346aeecae2 100644 --- a/test/OrchardCore.Tests.UI/Tests/AgencyRecipeTests.cs +++ b/test/OrchardCore.Tests.UI/Tests/AgencyRecipeTests.cs @@ -17,7 +17,7 @@ public AgencyRecipeTests(ITestOutputHelper testOutputHelper) { } - [Theory(Skip = "Minimal test suite for multi-DB testing."), Chrome] + [Theory, Chrome] public Task BasicOrchardFeaturesShouldWorkWithAgency(Browser browser) => ExecuteTestAsync( async context => diff --git a/test/OrchardCore.Tests.UI/Tests/AzureBlobStorageTests.cs b/test/OrchardCore.Tests.UI/Tests/AzureBlobStorageTests.cs index 704287df6b4..8e5ba1b2a81 100644 --- a/test/OrchardCore.Tests.UI/Tests/AzureBlobStorageTests.cs +++ b/test/OrchardCore.Tests.UI/Tests/AzureBlobStorageTests.cs @@ -15,7 +15,7 @@ public AzureBlobStorageTests(ITestOutputHelper testOutputHelper) { } - [Theory(Skip = "Minimal test suite for multi-DB testing."), Chrome] + [Theory, Chrome] public Task BasicOrchardFeaturesShouldWorkWithBlogAndAzureBlobStorage(Browser browser) => ExecuteTestAsync( async context => diff --git a/test/OrchardCore.Tests.UI/Tests/BlankRecipeTests.cs b/test/OrchardCore.Tests.UI/Tests/BlankRecipeTests.cs index 9fbe4816e09..61dade3bf1d 100644 --- a/test/OrchardCore.Tests.UI/Tests/BlankRecipeTests.cs +++ b/test/OrchardCore.Tests.UI/Tests/BlankRecipeTests.cs @@ -18,7 +18,7 @@ public BlankRecipeTests(ITestOutputHelper testOutputHelper) { } - [Theory(Skip = "Minimal test suite for multi-DB testing."), Chrome] + [Theory, Chrome] public Task BasicOrchardFeaturesShouldWorkWithBlank(Browser browser) => ExecuteTestAsync( async context => diff --git a/test/OrchardCore.Tests.UI/Tests/ComingSoonRecipeTests.cs b/test/OrchardCore.Tests.UI/Tests/ComingSoonRecipeTests.cs index 365a850aec4..12f76caa987 100644 --- a/test/OrchardCore.Tests.UI/Tests/ComingSoonRecipeTests.cs +++ b/test/OrchardCore.Tests.UI/Tests/ComingSoonRecipeTests.cs @@ -15,7 +15,7 @@ public ComingSoonRecipeTests(ITestOutputHelper testOutputHelper) { } - [Theory(Skip = "Minimal test suite for multi-DB testing."), Chrome] + [Theory, Chrome] public Task BasicOrchardFeaturesShouldWorkWithComingSoon(Browser browser) => ExecuteTestAsync( async context => diff --git a/test/OrchardCore.Tests.UI/Tests/HeadlessRecipeTests.cs b/test/OrchardCore.Tests.UI/Tests/HeadlessRecipeTests.cs index 2db773c9404..eee1cc02ef7 100644 --- a/test/OrchardCore.Tests.UI/Tests/HeadlessRecipeTests.cs +++ b/test/OrchardCore.Tests.UI/Tests/HeadlessRecipeTests.cs @@ -15,7 +15,7 @@ public HeadlessRecipeTests(ITestOutputHelper testOutputHelper) { } - [Theory(Skip = "Minimal test suite for multi-DB testing."), Chrome] + [Theory, Chrome] public Task BasicOrchardFeaturesShouldWorkWithHeadless(Browser browser) => ExecuteTestAsync( async context => diff --git a/test/OrchardCore.Tests.UI/Tests/InvalidSetupTests.cs b/test/OrchardCore.Tests.UI/Tests/InvalidSetupTests.cs index 1e8b30638d8..797716823c5 100644 --- a/test/OrchardCore.Tests.UI/Tests/InvalidSetupTests.cs +++ b/test/OrchardCore.Tests.UI/Tests/InvalidSetupTests.cs @@ -15,7 +15,7 @@ public InvalidSetupTests(ITestOutputHelper testOutputHelper) { } - [Theory(Skip = "Minimal test suite for multi-DB testing."), Chrome] + [Theory, Chrome] public Task SetupWithInvalidDataShouldFail(Browser browser) => ExecuteTestAsync( context => context.TestSetupWithInvalidDataAsync( From 8eea409ca6acbff112060cebb61ec59ffb3042a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Thu, 3 Nov 2022 21:56:35 +0100 Subject: [PATCH 138/175] Revert "Re-enabling all tests" This reverts commit 4cc769c95b203edf822e69b07c24852fcd08da12. --- test/OrchardCore.Tests.UI/Tests/AdminMonkeyTests.cs | 2 +- test/OrchardCore.Tests.UI/Tests/AgencyRecipeTests.cs | 2 +- test/OrchardCore.Tests.UI/Tests/AzureBlobStorageTests.cs | 2 +- test/OrchardCore.Tests.UI/Tests/BlankRecipeTests.cs | 2 +- test/OrchardCore.Tests.UI/Tests/ComingSoonRecipeTests.cs | 2 +- test/OrchardCore.Tests.UI/Tests/HeadlessRecipeTests.cs | 2 +- test/OrchardCore.Tests.UI/Tests/InvalidSetupTests.cs | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/test/OrchardCore.Tests.UI/Tests/AdminMonkeyTests.cs b/test/OrchardCore.Tests.UI/Tests/AdminMonkeyTests.cs index 15f4b992c22..d9ae86696aa 100644 --- a/test/OrchardCore.Tests.UI/Tests/AdminMonkeyTests.cs +++ b/test/OrchardCore.Tests.UI/Tests/AdminMonkeyTests.cs @@ -21,7 +21,7 @@ public AdminMonkeyTests(ITestOutputHelper testOutputHelper) { } - [Theory, Chrome] + [Theory(Skip = "Minimal test suite for multi-DB testing."), Chrome] public Task TestAdminPagesAsMonkeyRecursivelyShouldWorkWithAdminUser(Browser browser) => ExecuteTestAsync( async context => diff --git a/test/OrchardCore.Tests.UI/Tests/AgencyRecipeTests.cs b/test/OrchardCore.Tests.UI/Tests/AgencyRecipeTests.cs index f346aeecae2..15cdc6a8923 100644 --- a/test/OrchardCore.Tests.UI/Tests/AgencyRecipeTests.cs +++ b/test/OrchardCore.Tests.UI/Tests/AgencyRecipeTests.cs @@ -17,7 +17,7 @@ public AgencyRecipeTests(ITestOutputHelper testOutputHelper) { } - [Theory, Chrome] + [Theory(Skip = "Minimal test suite for multi-DB testing."), Chrome] public Task BasicOrchardFeaturesShouldWorkWithAgency(Browser browser) => ExecuteTestAsync( async context => diff --git a/test/OrchardCore.Tests.UI/Tests/AzureBlobStorageTests.cs b/test/OrchardCore.Tests.UI/Tests/AzureBlobStorageTests.cs index 8e5ba1b2a81..704287df6b4 100644 --- a/test/OrchardCore.Tests.UI/Tests/AzureBlobStorageTests.cs +++ b/test/OrchardCore.Tests.UI/Tests/AzureBlobStorageTests.cs @@ -15,7 +15,7 @@ public AzureBlobStorageTests(ITestOutputHelper testOutputHelper) { } - [Theory, Chrome] + [Theory(Skip = "Minimal test suite for multi-DB testing."), Chrome] public Task BasicOrchardFeaturesShouldWorkWithBlogAndAzureBlobStorage(Browser browser) => ExecuteTestAsync( async context => diff --git a/test/OrchardCore.Tests.UI/Tests/BlankRecipeTests.cs b/test/OrchardCore.Tests.UI/Tests/BlankRecipeTests.cs index 61dade3bf1d..9fbe4816e09 100644 --- a/test/OrchardCore.Tests.UI/Tests/BlankRecipeTests.cs +++ b/test/OrchardCore.Tests.UI/Tests/BlankRecipeTests.cs @@ -18,7 +18,7 @@ public BlankRecipeTests(ITestOutputHelper testOutputHelper) { } - [Theory, Chrome] + [Theory(Skip = "Minimal test suite for multi-DB testing."), Chrome] public Task BasicOrchardFeaturesShouldWorkWithBlank(Browser browser) => ExecuteTestAsync( async context => diff --git a/test/OrchardCore.Tests.UI/Tests/ComingSoonRecipeTests.cs b/test/OrchardCore.Tests.UI/Tests/ComingSoonRecipeTests.cs index 12f76caa987..365a850aec4 100644 --- a/test/OrchardCore.Tests.UI/Tests/ComingSoonRecipeTests.cs +++ b/test/OrchardCore.Tests.UI/Tests/ComingSoonRecipeTests.cs @@ -15,7 +15,7 @@ public ComingSoonRecipeTests(ITestOutputHelper testOutputHelper) { } - [Theory, Chrome] + [Theory(Skip = "Minimal test suite for multi-DB testing."), Chrome] public Task BasicOrchardFeaturesShouldWorkWithComingSoon(Browser browser) => ExecuteTestAsync( async context => diff --git a/test/OrchardCore.Tests.UI/Tests/HeadlessRecipeTests.cs b/test/OrchardCore.Tests.UI/Tests/HeadlessRecipeTests.cs index eee1cc02ef7..2db773c9404 100644 --- a/test/OrchardCore.Tests.UI/Tests/HeadlessRecipeTests.cs +++ b/test/OrchardCore.Tests.UI/Tests/HeadlessRecipeTests.cs @@ -15,7 +15,7 @@ public HeadlessRecipeTests(ITestOutputHelper testOutputHelper) { } - [Theory, Chrome] + [Theory(Skip = "Minimal test suite for multi-DB testing."), Chrome] public Task BasicOrchardFeaturesShouldWorkWithHeadless(Browser browser) => ExecuteTestAsync( async context => diff --git a/test/OrchardCore.Tests.UI/Tests/InvalidSetupTests.cs b/test/OrchardCore.Tests.UI/Tests/InvalidSetupTests.cs index 797716823c5..1e8b30638d8 100644 --- a/test/OrchardCore.Tests.UI/Tests/InvalidSetupTests.cs +++ b/test/OrchardCore.Tests.UI/Tests/InvalidSetupTests.cs @@ -15,7 +15,7 @@ public InvalidSetupTests(ITestOutputHelper testOutputHelper) { } - [Theory, Chrome] + [Theory(Skip = "Minimal test suite for multi-DB testing."), Chrome] public Task SetupWithInvalidDataShouldFail(Browser browser) => ExecuteTestAsync( context => context.TestSetupWithInvalidDataAsync( From 3ff08879a11f66718ada2662666b9227a0a6fc89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Thu, 3 Nov 2022 21:57:57 +0100 Subject: [PATCH 139/175] Making connection strings conventional --- .../Extensions/OrchardCoreSetupParametersExtensions.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs b/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs index 9673abed941..249bdf5ae52 100644 --- a/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs +++ b/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs @@ -29,11 +29,11 @@ public static OrchardCoreSetupParameters ConfigureDatabaseSettings( if (provider == OrchardCoreSetupPage.DatabaseType.Postgres) { - setupParameters.ConnectionString = "User ID=postgres;Password=postgres;Host=localhost;Port=5432;Database=postgres;"; + setupParameters.ConnectionString = "Host=localhost;Port=5432;User ID=postgres;Password=postgres;Database=postgres;"; } else if (provider == OrchardCoreSetupPage.DatabaseType.MySql) { - setupParameters.ConnectionString = "server=127.0.0.1;uid=root;pwd=test123;database=test"; + setupParameters.ConnectionString = "Server=127.0.0.1;User ID=root;Password=test123;Database=test"; } return setupParameters; From 07081041dd3e7fc2df899cc261cde25626823bfb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Thu, 3 Nov 2022 22:06:46 +0100 Subject: [PATCH 140/175] Fixing that table prefixes might include a hyphen --- .../Extensions/OrchardCoreSetupParametersExtensions.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs b/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs index 249bdf5ae52..664143c68ae 100644 --- a/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs +++ b/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs @@ -1,3 +1,4 @@ +using System; using Lombiq.Tests.UI.Services; using OrchardCore.Tests.UI.Helpers; @@ -24,8 +25,8 @@ public static OrchardCoreSetupParameters ConfigureDatabaseSettings( // MySQL/MariaDB the rules are similar (table names can start with numbers but it's safer if they don't, // and the max table name length is 64 characters), see https://mariadb.com/kb/en/identifier-names/. With // the leading "t" and the no-hyphen context ID it would be 34 characters, so we have to shorten it. With - // the hash it will be at most 12 characters. - setupParameters.TablePrefix = "t" + context.Id.Replace("-", "").GetHashCode(); + // the hash it will be at most 11 characters (since negative hash codes are disallowed). + setupParameters.TablePrefix = "t" + Math.Abs(context.Id.Replace("-", "").GetHashCode()); if (provider == OrchardCoreSetupPage.DatabaseType.Postgres) { From 61427f89b737f9be2567e472d82aa4688b4e3f69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Thu, 3 Nov 2022 22:15:20 +0100 Subject: [PATCH 141/175] Revert "Revert "Re-enabling all tests"" This reverts commit 8eea409ca6acbff112060cebb61ec59ffb3042a0. --- test/OrchardCore.Tests.UI/Tests/AdminMonkeyTests.cs | 2 +- test/OrchardCore.Tests.UI/Tests/AgencyRecipeTests.cs | 2 +- test/OrchardCore.Tests.UI/Tests/AzureBlobStorageTests.cs | 2 +- test/OrchardCore.Tests.UI/Tests/BlankRecipeTests.cs | 2 +- test/OrchardCore.Tests.UI/Tests/ComingSoonRecipeTests.cs | 2 +- test/OrchardCore.Tests.UI/Tests/HeadlessRecipeTests.cs | 2 +- test/OrchardCore.Tests.UI/Tests/InvalidSetupTests.cs | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/test/OrchardCore.Tests.UI/Tests/AdminMonkeyTests.cs b/test/OrchardCore.Tests.UI/Tests/AdminMonkeyTests.cs index d9ae86696aa..15f4b992c22 100644 --- a/test/OrchardCore.Tests.UI/Tests/AdminMonkeyTests.cs +++ b/test/OrchardCore.Tests.UI/Tests/AdminMonkeyTests.cs @@ -21,7 +21,7 @@ public AdminMonkeyTests(ITestOutputHelper testOutputHelper) { } - [Theory(Skip = "Minimal test suite for multi-DB testing."), Chrome] + [Theory, Chrome] public Task TestAdminPagesAsMonkeyRecursivelyShouldWorkWithAdminUser(Browser browser) => ExecuteTestAsync( async context => diff --git a/test/OrchardCore.Tests.UI/Tests/AgencyRecipeTests.cs b/test/OrchardCore.Tests.UI/Tests/AgencyRecipeTests.cs index 15cdc6a8923..f346aeecae2 100644 --- a/test/OrchardCore.Tests.UI/Tests/AgencyRecipeTests.cs +++ b/test/OrchardCore.Tests.UI/Tests/AgencyRecipeTests.cs @@ -17,7 +17,7 @@ public AgencyRecipeTests(ITestOutputHelper testOutputHelper) { } - [Theory(Skip = "Minimal test suite for multi-DB testing."), Chrome] + [Theory, Chrome] public Task BasicOrchardFeaturesShouldWorkWithAgency(Browser browser) => ExecuteTestAsync( async context => diff --git a/test/OrchardCore.Tests.UI/Tests/AzureBlobStorageTests.cs b/test/OrchardCore.Tests.UI/Tests/AzureBlobStorageTests.cs index 704287df6b4..8e5ba1b2a81 100644 --- a/test/OrchardCore.Tests.UI/Tests/AzureBlobStorageTests.cs +++ b/test/OrchardCore.Tests.UI/Tests/AzureBlobStorageTests.cs @@ -15,7 +15,7 @@ public AzureBlobStorageTests(ITestOutputHelper testOutputHelper) { } - [Theory(Skip = "Minimal test suite for multi-DB testing."), Chrome] + [Theory, Chrome] public Task BasicOrchardFeaturesShouldWorkWithBlogAndAzureBlobStorage(Browser browser) => ExecuteTestAsync( async context => diff --git a/test/OrchardCore.Tests.UI/Tests/BlankRecipeTests.cs b/test/OrchardCore.Tests.UI/Tests/BlankRecipeTests.cs index 9fbe4816e09..61dade3bf1d 100644 --- a/test/OrchardCore.Tests.UI/Tests/BlankRecipeTests.cs +++ b/test/OrchardCore.Tests.UI/Tests/BlankRecipeTests.cs @@ -18,7 +18,7 @@ public BlankRecipeTests(ITestOutputHelper testOutputHelper) { } - [Theory(Skip = "Minimal test suite for multi-DB testing."), Chrome] + [Theory, Chrome] public Task BasicOrchardFeaturesShouldWorkWithBlank(Browser browser) => ExecuteTestAsync( async context => diff --git a/test/OrchardCore.Tests.UI/Tests/ComingSoonRecipeTests.cs b/test/OrchardCore.Tests.UI/Tests/ComingSoonRecipeTests.cs index 365a850aec4..12f76caa987 100644 --- a/test/OrchardCore.Tests.UI/Tests/ComingSoonRecipeTests.cs +++ b/test/OrchardCore.Tests.UI/Tests/ComingSoonRecipeTests.cs @@ -15,7 +15,7 @@ public ComingSoonRecipeTests(ITestOutputHelper testOutputHelper) { } - [Theory(Skip = "Minimal test suite for multi-DB testing."), Chrome] + [Theory, Chrome] public Task BasicOrchardFeaturesShouldWorkWithComingSoon(Browser browser) => ExecuteTestAsync( async context => diff --git a/test/OrchardCore.Tests.UI/Tests/HeadlessRecipeTests.cs b/test/OrchardCore.Tests.UI/Tests/HeadlessRecipeTests.cs index 2db773c9404..eee1cc02ef7 100644 --- a/test/OrchardCore.Tests.UI/Tests/HeadlessRecipeTests.cs +++ b/test/OrchardCore.Tests.UI/Tests/HeadlessRecipeTests.cs @@ -15,7 +15,7 @@ public HeadlessRecipeTests(ITestOutputHelper testOutputHelper) { } - [Theory(Skip = "Minimal test suite for multi-DB testing."), Chrome] + [Theory, Chrome] public Task BasicOrchardFeaturesShouldWorkWithHeadless(Browser browser) => ExecuteTestAsync( async context => diff --git a/test/OrchardCore.Tests.UI/Tests/InvalidSetupTests.cs b/test/OrchardCore.Tests.UI/Tests/InvalidSetupTests.cs index 1e8b30638d8..797716823c5 100644 --- a/test/OrchardCore.Tests.UI/Tests/InvalidSetupTests.cs +++ b/test/OrchardCore.Tests.UI/Tests/InvalidSetupTests.cs @@ -15,7 +15,7 @@ public InvalidSetupTests(ITestOutputHelper testOutputHelper) { } - [Theory(Skip = "Minimal test suite for multi-DB testing."), Chrome] + [Theory, Chrome] public Task SetupWithInvalidDataShouldFail(Browser browser) => ExecuteTestAsync( context => context.TestSetupWithInvalidDataAsync( From 97b061359a28e187ad8c72a541e81f761f6fa389 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Thu, 3 Nov 2022 22:16:30 +0100 Subject: [PATCH 142/175] MVC and SQLite tests --- .github/workflows/pr_ci.yml | 48 ++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/.github/workflows/pr_ci.yml b/.github/workflows/pr_ci.yml index 0d39fd0f9f1..1967eb2511c 100644 --- a/.github/workflows/pr_ci.yml +++ b/.github/workflows/pr_ci.yml @@ -28,18 +28,18 @@ jobs: #- name: Unit Tests # run: | # dotnet test -c Release --no-restore --no-build ./test/OrchardCore.Tests/OrchardCore.Tests.csproj - #- name: MVC UI Tests - # uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@issue/OSOE-424 - # with: - # build-directory: test/OrchardCore.Tests.UI.Mvc + - name: MVC UI Tests + uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@issue/OSOE-424 + with: + build-directory: test/OrchardCore.Tests.UI.Mvc - name: Set up Azurite uses: Lombiq/GitHub-Actions/.github/actions/setup-azurite@issue/OSOE-424 with: location: test/OrchardCore.Tests.UI - #- name: CMS UI Tests - SQLite - # uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@issue/OSOE-424 - # with: - # build-directory: test/OrchardCore.Tests.UI + - name: CMS UI Tests - SQLite + uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@issue/OSOE-424 + with: + build-directory: test/OrchardCore.Tests.UI #- name: Set up SQL Server # uses: Lombiq/GitHub-Actions/.github/actions/setup-sql-server@issue/OSOE-424 #- name: CMS UI Tests - SQL Server @@ -59,19 +59,19 @@ jobs: # with: # build-directory: test/OrchardCore.Tests.UI # MariaDB is an open-source drop-in replacement of MySQL, so we can use it instead. - - name: Set up MariaDB - # v1.13.0 - uses: shogo82148/actions-setup-mysql@e9da98ba6e914131f3111105e445c06bc1629280 - with: - distribution: "mariadb" - root-password: "test123" - - name: Create MariaDB database - shell: pwsh - run: | - mysql --user=root --password=test123 --host=127.0.0.1 --execute="CREATE DATABASE mariadb" - - name: CMS UI Tests - MySql - uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@issue/OSOE-424 - env: - OrchardCore__UITestingCIDatabaseProvider: "MySql" - with: - build-directory: test/OrchardCore.Tests.UI + #- name: Set up MariaDB + # # v1.13.0 + # uses: shogo82148/actions-setup-mysql@e9da98ba6e914131f3111105e445c06bc1629280 + # with: + # distribution: "mariadb" + # root-password: "test123" + #- name: Create MariaDB database + # shell: pwsh + # run: | + # mysql --user=root --password=test123 --host=127.0.0.1 --execute="CREATE DATABASE mariadb" + #- name: CMS UI Tests - MySql + # uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@issue/OSOE-424 + # env: + # OrchardCore__UITestingCIDatabaseProvider: "MySql" + # with: + # build-directory: test/OrchardCore.Tests.UI From 8ae3845908aa7e80db2bf7fa015f5425f14effb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Thu, 3 Nov 2022 22:17:11 +0100 Subject: [PATCH 143/175] SQL Server tests --- .github/workflows/pr_ci.yml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/pr_ci.yml b/.github/workflows/pr_ci.yml index 1967eb2511c..9c2400994fe 100644 --- a/.github/workflows/pr_ci.yml +++ b/.github/workflows/pr_ci.yml @@ -28,26 +28,26 @@ jobs: #- name: Unit Tests # run: | # dotnet test -c Release --no-restore --no-build ./test/OrchardCore.Tests/OrchardCore.Tests.csproj - - name: MVC UI Tests - uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@issue/OSOE-424 - with: - build-directory: test/OrchardCore.Tests.UI.Mvc + #- name: MVC UI Tests + # uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@issue/OSOE-424 + # with: + # build-directory: test/OrchardCore.Tests.UI.Mvc - name: Set up Azurite uses: Lombiq/GitHub-Actions/.github/actions/setup-azurite@issue/OSOE-424 with: location: test/OrchardCore.Tests.UI - - name: CMS UI Tests - SQLite - uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@issue/OSOE-424 - with: - build-directory: test/OrchardCore.Tests.UI - #- name: Set up SQL Server - # uses: Lombiq/GitHub-Actions/.github/actions/setup-sql-server@issue/OSOE-424 - #- name: CMS UI Tests - SQL Server + #- name: CMS UI Tests - SQLite # uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@issue/OSOE-424 - # env: - # OrchardCore__UITestingCIDatabaseProvider: "SqlServer" # with: # build-directory: test/OrchardCore.Tests.UI + - name: Set up SQL Server + uses: Lombiq/GitHub-Actions/.github/actions/setup-sql-server@issue/OSOE-424 + - name: CMS UI Tests - SQL Server + uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@issue/OSOE-424 + env: + OrchardCore__UITestingCIDatabaseProvider: "SqlServer" + with: + build-directory: test/OrchardCore.Tests.UI #- name: Start PostgreSQL # # v3 # # This will cause warnings until this is fixed: https://github.com/ikalnytskyi/action-setup-postgres/issues/6. From ff29a39fc7af5eb95c3740e1ba7233fedcbe84e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Thu, 3 Nov 2022 22:17:58 +0100 Subject: [PATCH 144/175] PostgreSQL tests --- .github/workflows/pr_ci.yml | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/pr_ci.yml b/.github/workflows/pr_ci.yml index 9c2400994fe..3ed6a57fa09 100644 --- a/.github/workflows/pr_ci.yml +++ b/.github/workflows/pr_ci.yml @@ -40,24 +40,24 @@ jobs: # uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@issue/OSOE-424 # with: # build-directory: test/OrchardCore.Tests.UI - - name: Set up SQL Server - uses: Lombiq/GitHub-Actions/.github/actions/setup-sql-server@issue/OSOE-424 - - name: CMS UI Tests - SQL Server - uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@issue/OSOE-424 - env: - OrchardCore__UITestingCIDatabaseProvider: "SqlServer" - with: - build-directory: test/OrchardCore.Tests.UI - #- name: Start PostgreSQL - # # v3 - # # This will cause warnings until this is fixed: https://github.com/ikalnytskyi/action-setup-postgres/issues/6. - # uses: ikalnytskyi/action-setup-postgres@e5b77936cf3f9d1a079ac5e8c1787fc657924809 - #- name: CMS UI Tests - PostgreSQL + #- name: Set up SQL Server + # uses: Lombiq/GitHub-Actions/.github/actions/setup-sql-server@issue/OSOE-424 + #- name: CMS UI Tests - SQL Server # uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@issue/OSOE-424 # env: - # OrchardCore__UITestingCIDatabaseProvider: "Postgres" + # OrchardCore__UITestingCIDatabaseProvider: "SqlServer" # with: # build-directory: test/OrchardCore.Tests.UI + - name: Start PostgreSQL + # v3 + # This will cause warnings until this is fixed: https://github.com/ikalnytskyi/action-setup-postgres/issues/6. + uses: ikalnytskyi/action-setup-postgres@e5b77936cf3f9d1a079ac5e8c1787fc657924809 + - name: CMS UI Tests - PostgreSQL + uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@issue/OSOE-424 + env: + OrchardCore__UITestingCIDatabaseProvider: "Postgres" + with: + build-directory: test/OrchardCore.Tests.UI # MariaDB is an open-source drop-in replacement of MySQL, so we can use it instead. #- name: Set up MariaDB # # v1.13.0 From 166e906e6e498f604e23c08704be80718e0cbf0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Thu, 3 Nov 2022 22:33:15 +0100 Subject: [PATCH 145/175] Fixing SetupWithInvalidDataShouldFail --- .../Extensions/OrchardCoreSetupParametersExtensions.cs | 2 +- test/OrchardCore.Tests.UI/Tests/InvalidSetupTests.cs | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs b/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs index 664143c68ae..7a17d4254b1 100644 --- a/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs +++ b/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs @@ -26,7 +26,7 @@ public static OrchardCoreSetupParameters ConfigureDatabaseSettings( // and the max table name length is 64 characters), see https://mariadb.com/kb/en/identifier-names/. With // the leading "t" and the no-hyphen context ID it would be 34 characters, so we have to shorten it. With // the hash it will be at most 11 characters (since negative hash codes are disallowed). - setupParameters.TablePrefix = "t" + Math.Abs(context.Id.Replace("-", "").GetHashCode()); + setupParameters.TablePrefix = "t" + Math.Abs(context.Id.Replace("-", String.Empty).GetHashCode()); if (provider == OrchardCoreSetupPage.DatabaseType.Postgres) { diff --git a/test/OrchardCore.Tests.UI/Tests/InvalidSetupTests.cs b/test/OrchardCore.Tests.UI/Tests/InvalidSetupTests.cs index 797716823c5..27254739c95 100644 --- a/test/OrchardCore.Tests.UI/Tests/InvalidSetupTests.cs +++ b/test/OrchardCore.Tests.UI/Tests/InvalidSetupTests.cs @@ -1,3 +1,4 @@ +using System; using System.Threading.Tasks; using Lombiq.Tests.UI.Attributes; using Lombiq.Tests.UI.Extensions; @@ -19,7 +20,13 @@ public InvalidSetupTests(ITestOutputHelper testOutputHelper) public Task SetupWithInvalidDataShouldFail(Browser browser) => ExecuteTestAsync( context => context.TestSetupWithInvalidDataAsync( - new OrchardCoreSetupParameters(context).ConfigureDatabaseSettings(context)), + new OrchardCoreSetupParameters(context) + { + SiteName = String.Empty, + UserName = String.Empty, + Email = String.Empty, + Password = String.Empty, + }.ConfigureDatabaseSettings(context)), browser); } } From dee49ba32c3d3f10bdbe80892f7b381443377da8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Thu, 3 Nov 2022 22:34:31 +0100 Subject: [PATCH 146/175] SQL Server tests --- .github/workflows/pr_ci.yml | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/pr_ci.yml b/.github/workflows/pr_ci.yml index 3ed6a57fa09..9c2400994fe 100644 --- a/.github/workflows/pr_ci.yml +++ b/.github/workflows/pr_ci.yml @@ -40,24 +40,24 @@ jobs: # uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@issue/OSOE-424 # with: # build-directory: test/OrchardCore.Tests.UI - #- name: Set up SQL Server - # uses: Lombiq/GitHub-Actions/.github/actions/setup-sql-server@issue/OSOE-424 - #- name: CMS UI Tests - SQL Server - # uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@issue/OSOE-424 - # env: - # OrchardCore__UITestingCIDatabaseProvider: "SqlServer" - # with: - # build-directory: test/OrchardCore.Tests.UI - - name: Start PostgreSQL - # v3 - # This will cause warnings until this is fixed: https://github.com/ikalnytskyi/action-setup-postgres/issues/6. - uses: ikalnytskyi/action-setup-postgres@e5b77936cf3f9d1a079ac5e8c1787fc657924809 - - name: CMS UI Tests - PostgreSQL + - name: Set up SQL Server + uses: Lombiq/GitHub-Actions/.github/actions/setup-sql-server@issue/OSOE-424 + - name: CMS UI Tests - SQL Server uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@issue/OSOE-424 env: - OrchardCore__UITestingCIDatabaseProvider: "Postgres" + OrchardCore__UITestingCIDatabaseProvider: "SqlServer" with: build-directory: test/OrchardCore.Tests.UI + #- name: Start PostgreSQL + # # v3 + # # This will cause warnings until this is fixed: https://github.com/ikalnytskyi/action-setup-postgres/issues/6. + # uses: ikalnytskyi/action-setup-postgres@e5b77936cf3f9d1a079ac5e8c1787fc657924809 + #- name: CMS UI Tests - PostgreSQL + # uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@issue/OSOE-424 + # env: + # OrchardCore__UITestingCIDatabaseProvider: "Postgres" + # with: + # build-directory: test/OrchardCore.Tests.UI # MariaDB is an open-source drop-in replacement of MySQL, so we can use it instead. #- name: Set up MariaDB # # v1.13.0 From c3050d0d8047ad7c93bb42f8aad2cd88d9657da0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Thu, 3 Nov 2022 22:35:22 +0100 Subject: [PATCH 147/175] MVC and SQLite tests --- .github/workflows/pr_ci.yml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/pr_ci.yml b/.github/workflows/pr_ci.yml index 9c2400994fe..1967eb2511c 100644 --- a/.github/workflows/pr_ci.yml +++ b/.github/workflows/pr_ci.yml @@ -28,26 +28,26 @@ jobs: #- name: Unit Tests # run: | # dotnet test -c Release --no-restore --no-build ./test/OrchardCore.Tests/OrchardCore.Tests.csproj - #- name: MVC UI Tests - # uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@issue/OSOE-424 - # with: - # build-directory: test/OrchardCore.Tests.UI.Mvc + - name: MVC UI Tests + uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@issue/OSOE-424 + with: + build-directory: test/OrchardCore.Tests.UI.Mvc - name: Set up Azurite uses: Lombiq/GitHub-Actions/.github/actions/setup-azurite@issue/OSOE-424 with: location: test/OrchardCore.Tests.UI - #- name: CMS UI Tests - SQLite - # uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@issue/OSOE-424 - # with: - # build-directory: test/OrchardCore.Tests.UI - - name: Set up SQL Server - uses: Lombiq/GitHub-Actions/.github/actions/setup-sql-server@issue/OSOE-424 - - name: CMS UI Tests - SQL Server + - name: CMS UI Tests - SQLite uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@issue/OSOE-424 - env: - OrchardCore__UITestingCIDatabaseProvider: "SqlServer" with: build-directory: test/OrchardCore.Tests.UI + #- name: Set up SQL Server + # uses: Lombiq/GitHub-Actions/.github/actions/setup-sql-server@issue/OSOE-424 + #- name: CMS UI Tests - SQL Server + # uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@issue/OSOE-424 + # env: + # OrchardCore__UITestingCIDatabaseProvider: "SqlServer" + # with: + # build-directory: test/OrchardCore.Tests.UI #- name: Start PostgreSQL # # v3 # # This will cause warnings until this is fixed: https://github.com/ikalnytskyi/action-setup-postgres/issues/6. From 9b55db4b9341eccb7f3c79187ac228d0e77e3b90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Thu, 3 Nov 2022 22:36:20 +0100 Subject: [PATCH 148/175] MySQL tests --- .github/workflows/pr_ci.yml | 48 ++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/.github/workflows/pr_ci.yml b/.github/workflows/pr_ci.yml index 1967eb2511c..0d39fd0f9f1 100644 --- a/.github/workflows/pr_ci.yml +++ b/.github/workflows/pr_ci.yml @@ -28,18 +28,18 @@ jobs: #- name: Unit Tests # run: | # dotnet test -c Release --no-restore --no-build ./test/OrchardCore.Tests/OrchardCore.Tests.csproj - - name: MVC UI Tests - uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@issue/OSOE-424 - with: - build-directory: test/OrchardCore.Tests.UI.Mvc + #- name: MVC UI Tests + # uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@issue/OSOE-424 + # with: + # build-directory: test/OrchardCore.Tests.UI.Mvc - name: Set up Azurite uses: Lombiq/GitHub-Actions/.github/actions/setup-azurite@issue/OSOE-424 with: location: test/OrchardCore.Tests.UI - - name: CMS UI Tests - SQLite - uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@issue/OSOE-424 - with: - build-directory: test/OrchardCore.Tests.UI + #- name: CMS UI Tests - SQLite + # uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@issue/OSOE-424 + # with: + # build-directory: test/OrchardCore.Tests.UI #- name: Set up SQL Server # uses: Lombiq/GitHub-Actions/.github/actions/setup-sql-server@issue/OSOE-424 #- name: CMS UI Tests - SQL Server @@ -59,19 +59,19 @@ jobs: # with: # build-directory: test/OrchardCore.Tests.UI # MariaDB is an open-source drop-in replacement of MySQL, so we can use it instead. - #- name: Set up MariaDB - # # v1.13.0 - # uses: shogo82148/actions-setup-mysql@e9da98ba6e914131f3111105e445c06bc1629280 - # with: - # distribution: "mariadb" - # root-password: "test123" - #- name: Create MariaDB database - # shell: pwsh - # run: | - # mysql --user=root --password=test123 --host=127.0.0.1 --execute="CREATE DATABASE mariadb" - #- name: CMS UI Tests - MySql - # uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@issue/OSOE-424 - # env: - # OrchardCore__UITestingCIDatabaseProvider: "MySql" - # with: - # build-directory: test/OrchardCore.Tests.UI + - name: Set up MariaDB + # v1.13.0 + uses: shogo82148/actions-setup-mysql@e9da98ba6e914131f3111105e445c06bc1629280 + with: + distribution: "mariadb" + root-password: "test123" + - name: Create MariaDB database + shell: pwsh + run: | + mysql --user=root --password=test123 --host=127.0.0.1 --execute="CREATE DATABASE mariadb" + - name: CMS UI Tests - MySql + uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@issue/OSOE-424 + env: + OrchardCore__UITestingCIDatabaseProvider: "MySql" + with: + build-directory: test/OrchardCore.Tests.UI From 0e9a35892bd0db4d2b0662ab6026729f83c8216a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Thu, 3 Nov 2022 22:57:40 +0100 Subject: [PATCH 149/175] Fixing that with SQL Server the table prefix was just a number --- test/OrchardCore.Tests.UI/Tests/SaaSRecipeTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/OrchardCore.Tests.UI/Tests/SaaSRecipeTests.cs b/test/OrchardCore.Tests.UI/Tests/SaaSRecipeTests.cs index 215fcab63de..3cfa04a29ec 100644 --- a/test/OrchardCore.Tests.UI/Tests/SaaSRecipeTests.cs +++ b/test/OrchardCore.Tests.UI/Tests/SaaSRecipeTests.cs @@ -59,7 +59,7 @@ await context.GoToSetupPageAndSetupOrchardCoreAsync( RunSetupOnCurrentPage = true, }.ConfigureDatabaseSettings(context); - tenantSetupParameters.TablePrefix += "2"; + tenantSetupParameters.TablePrefix += "t2"; await context.GoToSetupPageAndSetupOrchardCoreAsync(tenantSetupParameters); From 0e4a3ddd6aaf429ea9cb83c2f04a7cfa37a2f36c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Thu, 3 Nov 2022 23:04:42 +0100 Subject: [PATCH 150/175] Reverting to original, working MySQL connection string --- .../Extensions/OrchardCoreSetupParametersExtensions.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs b/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs index 7a17d4254b1..1835fad5327 100644 --- a/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs +++ b/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs @@ -34,7 +34,7 @@ public static OrchardCoreSetupParameters ConfigureDatabaseSettings( } else if (provider == OrchardCoreSetupPage.DatabaseType.MySql) { - setupParameters.ConnectionString = "Server=127.0.0.1;User ID=root;Password=test123;Database=test"; + setupParameters.ConnectionString = "server=127.0.0.1;uid=root;pwd=test123;database=test"; } return setupParameters; From ceab4be9827b4effef30b1dd128325fa52365fbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Thu, 3 Nov 2022 23:05:13 +0100 Subject: [PATCH 151/175] MVC and SQLite tests --- .github/workflows/pr_ci.yml | 48 ++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/.github/workflows/pr_ci.yml b/.github/workflows/pr_ci.yml index 0d39fd0f9f1..1967eb2511c 100644 --- a/.github/workflows/pr_ci.yml +++ b/.github/workflows/pr_ci.yml @@ -28,18 +28,18 @@ jobs: #- name: Unit Tests # run: | # dotnet test -c Release --no-restore --no-build ./test/OrchardCore.Tests/OrchardCore.Tests.csproj - #- name: MVC UI Tests - # uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@issue/OSOE-424 - # with: - # build-directory: test/OrchardCore.Tests.UI.Mvc + - name: MVC UI Tests + uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@issue/OSOE-424 + with: + build-directory: test/OrchardCore.Tests.UI.Mvc - name: Set up Azurite uses: Lombiq/GitHub-Actions/.github/actions/setup-azurite@issue/OSOE-424 with: location: test/OrchardCore.Tests.UI - #- name: CMS UI Tests - SQLite - # uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@issue/OSOE-424 - # with: - # build-directory: test/OrchardCore.Tests.UI + - name: CMS UI Tests - SQLite + uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@issue/OSOE-424 + with: + build-directory: test/OrchardCore.Tests.UI #- name: Set up SQL Server # uses: Lombiq/GitHub-Actions/.github/actions/setup-sql-server@issue/OSOE-424 #- name: CMS UI Tests - SQL Server @@ -59,19 +59,19 @@ jobs: # with: # build-directory: test/OrchardCore.Tests.UI # MariaDB is an open-source drop-in replacement of MySQL, so we can use it instead. - - name: Set up MariaDB - # v1.13.0 - uses: shogo82148/actions-setup-mysql@e9da98ba6e914131f3111105e445c06bc1629280 - with: - distribution: "mariadb" - root-password: "test123" - - name: Create MariaDB database - shell: pwsh - run: | - mysql --user=root --password=test123 --host=127.0.0.1 --execute="CREATE DATABASE mariadb" - - name: CMS UI Tests - MySql - uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@issue/OSOE-424 - env: - OrchardCore__UITestingCIDatabaseProvider: "MySql" - with: - build-directory: test/OrchardCore.Tests.UI + #- name: Set up MariaDB + # # v1.13.0 + # uses: shogo82148/actions-setup-mysql@e9da98ba6e914131f3111105e445c06bc1629280 + # with: + # distribution: "mariadb" + # root-password: "test123" + #- name: Create MariaDB database + # shell: pwsh + # run: | + # mysql --user=root --password=test123 --host=127.0.0.1 --execute="CREATE DATABASE mariadb" + #- name: CMS UI Tests - MySql + # uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@issue/OSOE-424 + # env: + # OrchardCore__UITestingCIDatabaseProvider: "MySql" + # with: + # build-directory: test/OrchardCore.Tests.UI From 398f2033afddb28c1d88209161a50b6eabf23861 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Thu, 3 Nov 2022 23:05:28 +0100 Subject: [PATCH 152/175] SQL Server tests --- .github/workflows/pr_ci.yml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/pr_ci.yml b/.github/workflows/pr_ci.yml index 1967eb2511c..9c2400994fe 100644 --- a/.github/workflows/pr_ci.yml +++ b/.github/workflows/pr_ci.yml @@ -28,26 +28,26 @@ jobs: #- name: Unit Tests # run: | # dotnet test -c Release --no-restore --no-build ./test/OrchardCore.Tests/OrchardCore.Tests.csproj - - name: MVC UI Tests - uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@issue/OSOE-424 - with: - build-directory: test/OrchardCore.Tests.UI.Mvc + #- name: MVC UI Tests + # uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@issue/OSOE-424 + # with: + # build-directory: test/OrchardCore.Tests.UI.Mvc - name: Set up Azurite uses: Lombiq/GitHub-Actions/.github/actions/setup-azurite@issue/OSOE-424 with: location: test/OrchardCore.Tests.UI - - name: CMS UI Tests - SQLite - uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@issue/OSOE-424 - with: - build-directory: test/OrchardCore.Tests.UI - #- name: Set up SQL Server - # uses: Lombiq/GitHub-Actions/.github/actions/setup-sql-server@issue/OSOE-424 - #- name: CMS UI Tests - SQL Server + #- name: CMS UI Tests - SQLite # uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@issue/OSOE-424 - # env: - # OrchardCore__UITestingCIDatabaseProvider: "SqlServer" # with: # build-directory: test/OrchardCore.Tests.UI + - name: Set up SQL Server + uses: Lombiq/GitHub-Actions/.github/actions/setup-sql-server@issue/OSOE-424 + - name: CMS UI Tests - SQL Server + uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@issue/OSOE-424 + env: + OrchardCore__UITestingCIDatabaseProvider: "SqlServer" + with: + build-directory: test/OrchardCore.Tests.UI #- name: Start PostgreSQL # # v3 # # This will cause warnings until this is fixed: https://github.com/ikalnytskyi/action-setup-postgres/issues/6. From a3233d0e9b60e1725969f29eb81dac0f5d3d4d0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Thu, 3 Nov 2022 23:05:43 +0100 Subject: [PATCH 153/175] PostgreSQL tests --- .github/workflows/pr_ci.yml | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/pr_ci.yml b/.github/workflows/pr_ci.yml index 9c2400994fe..3ed6a57fa09 100644 --- a/.github/workflows/pr_ci.yml +++ b/.github/workflows/pr_ci.yml @@ -40,24 +40,24 @@ jobs: # uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@issue/OSOE-424 # with: # build-directory: test/OrchardCore.Tests.UI - - name: Set up SQL Server - uses: Lombiq/GitHub-Actions/.github/actions/setup-sql-server@issue/OSOE-424 - - name: CMS UI Tests - SQL Server - uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@issue/OSOE-424 - env: - OrchardCore__UITestingCIDatabaseProvider: "SqlServer" - with: - build-directory: test/OrchardCore.Tests.UI - #- name: Start PostgreSQL - # # v3 - # # This will cause warnings until this is fixed: https://github.com/ikalnytskyi/action-setup-postgres/issues/6. - # uses: ikalnytskyi/action-setup-postgres@e5b77936cf3f9d1a079ac5e8c1787fc657924809 - #- name: CMS UI Tests - PostgreSQL + #- name: Set up SQL Server + # uses: Lombiq/GitHub-Actions/.github/actions/setup-sql-server@issue/OSOE-424 + #- name: CMS UI Tests - SQL Server # uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@issue/OSOE-424 # env: - # OrchardCore__UITestingCIDatabaseProvider: "Postgres" + # OrchardCore__UITestingCIDatabaseProvider: "SqlServer" # with: # build-directory: test/OrchardCore.Tests.UI + - name: Start PostgreSQL + # v3 + # This will cause warnings until this is fixed: https://github.com/ikalnytskyi/action-setup-postgres/issues/6. + uses: ikalnytskyi/action-setup-postgres@e5b77936cf3f9d1a079ac5e8c1787fc657924809 + - name: CMS UI Tests - PostgreSQL + uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@issue/OSOE-424 + env: + OrchardCore__UITestingCIDatabaseProvider: "Postgres" + with: + build-directory: test/OrchardCore.Tests.UI # MariaDB is an open-source drop-in replacement of MySQL, so we can use it instead. #- name: Set up MariaDB # # v1.13.0 From fd333170bf5a925f237e605a9791db43a9fff924 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Thu, 3 Nov 2022 23:33:47 +0100 Subject: [PATCH 154/175] Perhaps a railing semicolon will help the MySQL connection string be added on the setup screen? --- .github/workflows/pr_ci.yml | 46 +++++++++---------- .../OrchardCoreSetupParametersExtensions.cs | 2 +- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/.github/workflows/pr_ci.yml b/.github/workflows/pr_ci.yml index 3ed6a57fa09..0d39fd0f9f1 100644 --- a/.github/workflows/pr_ci.yml +++ b/.github/workflows/pr_ci.yml @@ -48,30 +48,30 @@ jobs: # OrchardCore__UITestingCIDatabaseProvider: "SqlServer" # with: # build-directory: test/OrchardCore.Tests.UI - - name: Start PostgreSQL - # v3 - # This will cause warnings until this is fixed: https://github.com/ikalnytskyi/action-setup-postgres/issues/6. - uses: ikalnytskyi/action-setup-postgres@e5b77936cf3f9d1a079ac5e8c1787fc657924809 - - name: CMS UI Tests - PostgreSQL - uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@issue/OSOE-424 - env: - OrchardCore__UITestingCIDatabaseProvider: "Postgres" - with: - build-directory: test/OrchardCore.Tests.UI - # MariaDB is an open-source drop-in replacement of MySQL, so we can use it instead. - #- name: Set up MariaDB - # # v1.13.0 - # uses: shogo82148/actions-setup-mysql@e9da98ba6e914131f3111105e445c06bc1629280 - # with: - # distribution: "mariadb" - # root-password: "test123" - #- name: Create MariaDB database - # shell: pwsh - # run: | - # mysql --user=root --password=test123 --host=127.0.0.1 --execute="CREATE DATABASE mariadb" - #- name: CMS UI Tests - MySql + #- name: Start PostgreSQL + # # v3 + # # This will cause warnings until this is fixed: https://github.com/ikalnytskyi/action-setup-postgres/issues/6. + # uses: ikalnytskyi/action-setup-postgres@e5b77936cf3f9d1a079ac5e8c1787fc657924809 + #- name: CMS UI Tests - PostgreSQL # uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@issue/OSOE-424 # env: - # OrchardCore__UITestingCIDatabaseProvider: "MySql" + # OrchardCore__UITestingCIDatabaseProvider: "Postgres" # with: # build-directory: test/OrchardCore.Tests.UI + # MariaDB is an open-source drop-in replacement of MySQL, so we can use it instead. + - name: Set up MariaDB + # v1.13.0 + uses: shogo82148/actions-setup-mysql@e9da98ba6e914131f3111105e445c06bc1629280 + with: + distribution: "mariadb" + root-password: "test123" + - name: Create MariaDB database + shell: pwsh + run: | + mysql --user=root --password=test123 --host=127.0.0.1 --execute="CREATE DATABASE mariadb" + - name: CMS UI Tests - MySql + uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@issue/OSOE-424 + env: + OrchardCore__UITestingCIDatabaseProvider: "MySql" + with: + build-directory: test/OrchardCore.Tests.UI diff --git a/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs b/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs index 1835fad5327..e8f83a4643f 100644 --- a/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs +++ b/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs @@ -34,7 +34,7 @@ public static OrchardCoreSetupParameters ConfigureDatabaseSettings( } else if (provider == OrchardCoreSetupPage.DatabaseType.MySql) { - setupParameters.ConnectionString = "server=127.0.0.1;uid=root;pwd=test123;database=test"; + setupParameters.ConnectionString = "server=127.0.0.1;uid=root;pwd=test123;database=test;"; } return setupParameters; From 86dae369ee4a3c359313e55edd4c3984ac07be28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Thu, 3 Nov 2022 23:35:52 +0100 Subject: [PATCH 155/175] Revert "Re-enabling all tests" This reverts commit 4cc769c95b203edf822e69b07c24852fcd08da12. --- test/OrchardCore.Tests.UI/Tests/AdminMonkeyTests.cs | 2 +- test/OrchardCore.Tests.UI/Tests/AgencyRecipeTests.cs | 2 +- test/OrchardCore.Tests.UI/Tests/AzureBlobStorageTests.cs | 2 +- test/OrchardCore.Tests.UI/Tests/BlankRecipeTests.cs | 2 +- test/OrchardCore.Tests.UI/Tests/ComingSoonRecipeTests.cs | 2 +- test/OrchardCore.Tests.UI/Tests/HeadlessRecipeTests.cs | 2 +- test/OrchardCore.Tests.UI/Tests/InvalidSetupTests.cs | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/test/OrchardCore.Tests.UI/Tests/AdminMonkeyTests.cs b/test/OrchardCore.Tests.UI/Tests/AdminMonkeyTests.cs index 15f4b992c22..d9ae86696aa 100644 --- a/test/OrchardCore.Tests.UI/Tests/AdminMonkeyTests.cs +++ b/test/OrchardCore.Tests.UI/Tests/AdminMonkeyTests.cs @@ -21,7 +21,7 @@ public AdminMonkeyTests(ITestOutputHelper testOutputHelper) { } - [Theory, Chrome] + [Theory(Skip = "Minimal test suite for multi-DB testing."), Chrome] public Task TestAdminPagesAsMonkeyRecursivelyShouldWorkWithAdminUser(Browser browser) => ExecuteTestAsync( async context => diff --git a/test/OrchardCore.Tests.UI/Tests/AgencyRecipeTests.cs b/test/OrchardCore.Tests.UI/Tests/AgencyRecipeTests.cs index f346aeecae2..15cdc6a8923 100644 --- a/test/OrchardCore.Tests.UI/Tests/AgencyRecipeTests.cs +++ b/test/OrchardCore.Tests.UI/Tests/AgencyRecipeTests.cs @@ -17,7 +17,7 @@ public AgencyRecipeTests(ITestOutputHelper testOutputHelper) { } - [Theory, Chrome] + [Theory(Skip = "Minimal test suite for multi-DB testing."), Chrome] public Task BasicOrchardFeaturesShouldWorkWithAgency(Browser browser) => ExecuteTestAsync( async context => diff --git a/test/OrchardCore.Tests.UI/Tests/AzureBlobStorageTests.cs b/test/OrchardCore.Tests.UI/Tests/AzureBlobStorageTests.cs index 8e5ba1b2a81..704287df6b4 100644 --- a/test/OrchardCore.Tests.UI/Tests/AzureBlobStorageTests.cs +++ b/test/OrchardCore.Tests.UI/Tests/AzureBlobStorageTests.cs @@ -15,7 +15,7 @@ public AzureBlobStorageTests(ITestOutputHelper testOutputHelper) { } - [Theory, Chrome] + [Theory(Skip = "Minimal test suite for multi-DB testing."), Chrome] public Task BasicOrchardFeaturesShouldWorkWithBlogAndAzureBlobStorage(Browser browser) => ExecuteTestAsync( async context => diff --git a/test/OrchardCore.Tests.UI/Tests/BlankRecipeTests.cs b/test/OrchardCore.Tests.UI/Tests/BlankRecipeTests.cs index 61dade3bf1d..9fbe4816e09 100644 --- a/test/OrchardCore.Tests.UI/Tests/BlankRecipeTests.cs +++ b/test/OrchardCore.Tests.UI/Tests/BlankRecipeTests.cs @@ -18,7 +18,7 @@ public BlankRecipeTests(ITestOutputHelper testOutputHelper) { } - [Theory, Chrome] + [Theory(Skip = "Minimal test suite for multi-DB testing."), Chrome] public Task BasicOrchardFeaturesShouldWorkWithBlank(Browser browser) => ExecuteTestAsync( async context => diff --git a/test/OrchardCore.Tests.UI/Tests/ComingSoonRecipeTests.cs b/test/OrchardCore.Tests.UI/Tests/ComingSoonRecipeTests.cs index 12f76caa987..365a850aec4 100644 --- a/test/OrchardCore.Tests.UI/Tests/ComingSoonRecipeTests.cs +++ b/test/OrchardCore.Tests.UI/Tests/ComingSoonRecipeTests.cs @@ -15,7 +15,7 @@ public ComingSoonRecipeTests(ITestOutputHelper testOutputHelper) { } - [Theory, Chrome] + [Theory(Skip = "Minimal test suite for multi-DB testing."), Chrome] public Task BasicOrchardFeaturesShouldWorkWithComingSoon(Browser browser) => ExecuteTestAsync( async context => diff --git a/test/OrchardCore.Tests.UI/Tests/HeadlessRecipeTests.cs b/test/OrchardCore.Tests.UI/Tests/HeadlessRecipeTests.cs index eee1cc02ef7..2db773c9404 100644 --- a/test/OrchardCore.Tests.UI/Tests/HeadlessRecipeTests.cs +++ b/test/OrchardCore.Tests.UI/Tests/HeadlessRecipeTests.cs @@ -15,7 +15,7 @@ public HeadlessRecipeTests(ITestOutputHelper testOutputHelper) { } - [Theory, Chrome] + [Theory(Skip = "Minimal test suite for multi-DB testing."), Chrome] public Task BasicOrchardFeaturesShouldWorkWithHeadless(Browser browser) => ExecuteTestAsync( async context => diff --git a/test/OrchardCore.Tests.UI/Tests/InvalidSetupTests.cs b/test/OrchardCore.Tests.UI/Tests/InvalidSetupTests.cs index 27254739c95..2650218b2cf 100644 --- a/test/OrchardCore.Tests.UI/Tests/InvalidSetupTests.cs +++ b/test/OrchardCore.Tests.UI/Tests/InvalidSetupTests.cs @@ -16,7 +16,7 @@ public InvalidSetupTests(ITestOutputHelper testOutputHelper) { } - [Theory, Chrome] + [Theory(Skip = "Minimal test suite for multi-DB testing."), Chrome] public Task SetupWithInvalidDataShouldFail(Browser browser) => ExecuteTestAsync( context => context.TestSetupWithInvalidDataAsync( From 47f149781a4ce27780fdcc0a2bbcde40f23b47a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Thu, 3 Nov 2022 23:36:44 +0100 Subject: [PATCH 156/175] Perhaps "Host" will work under Windows? --- .../Extensions/OrchardCoreSetupParametersExtensions.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs b/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs index e8f83a4643f..db9c876a874 100644 --- a/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs +++ b/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs @@ -34,7 +34,7 @@ public static OrchardCoreSetupParameters ConfigureDatabaseSettings( } else if (provider == OrchardCoreSetupPage.DatabaseType.MySql) { - setupParameters.ConnectionString = "server=127.0.0.1;uid=root;pwd=test123;database=test;"; + setupParameters.ConnectionString = "Host=127.0.0.1;uid=root;pwd=test123;database=test;"; } return setupParameters; From 0eaf1013e222b84a42e0e28dac8eb64e166daf18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Thu, 3 Nov 2022 23:37:00 +0100 Subject: [PATCH 157/175] Perhaps "localhost" will work under Windows? --- .../Extensions/OrchardCoreSetupParametersExtensions.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs b/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs index db9c876a874..396fc831a51 100644 --- a/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs +++ b/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs @@ -34,7 +34,7 @@ public static OrchardCoreSetupParameters ConfigureDatabaseSettings( } else if (provider == OrchardCoreSetupPage.DatabaseType.MySql) { - setupParameters.ConnectionString = "Host=127.0.0.1;uid=root;pwd=test123;database=test;"; + setupParameters.ConnectionString = "Host=localhost;uid=root;pwd=test123;database=test;"; } return setupParameters; From 9d07d35bc63430362c0f088fa9a001850662ed39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Fri, 4 Nov 2022 00:00:10 +0100 Subject: [PATCH 158/175] Perhaps server=localhost will work under Windows? --- .../Extensions/OrchardCoreSetupParametersExtensions.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs b/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs index 396fc831a51..8cf1e38083d 100644 --- a/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs +++ b/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs @@ -34,7 +34,7 @@ public static OrchardCoreSetupParameters ConfigureDatabaseSettings( } else if (provider == OrchardCoreSetupPage.DatabaseType.MySql) { - setupParameters.ConnectionString = "Host=localhost;uid=root;pwd=test123;database=test;"; + setupParameters.ConnectionString = "server=localhost;uid=root;pwd=test123;database=test;"; } return setupParameters; From f29b0fa2492f88877143a3d0de788230fae93c76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Fri, 4 Nov 2022 00:03:17 +0100 Subject: [PATCH 159/175] Fixing MariaDB DB name in connstring --- .../Extensions/OrchardCoreSetupParametersExtensions.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs b/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs index 8cf1e38083d..3e98591679a 100644 --- a/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs +++ b/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs @@ -34,7 +34,7 @@ public static OrchardCoreSetupParameters ConfigureDatabaseSettings( } else if (provider == OrchardCoreSetupPage.DatabaseType.MySql) { - setupParameters.ConnectionString = "server=localhost;uid=root;pwd=test123;database=test;"; + setupParameters.ConnectionString = "server=127.0.0.1;uid=root;pwd=test123;database=mariadb;"; } return setupParameters; From 6c2d033d84790a77308798b9cd0deb4360a96034 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Fri, 4 Nov 2022 00:19:05 +0100 Subject: [PATCH 160/175] Revert "Revert "Re-enabling all tests"" This reverts commit 86dae369ee4a3c359313e55edd4c3984ac07be28. --- test/OrchardCore.Tests.UI/Tests/AdminMonkeyTests.cs | 2 +- test/OrchardCore.Tests.UI/Tests/AgencyRecipeTests.cs | 2 +- test/OrchardCore.Tests.UI/Tests/AzureBlobStorageTests.cs | 2 +- test/OrchardCore.Tests.UI/Tests/BlankRecipeTests.cs | 2 +- test/OrchardCore.Tests.UI/Tests/ComingSoonRecipeTests.cs | 2 +- test/OrchardCore.Tests.UI/Tests/HeadlessRecipeTests.cs | 2 +- test/OrchardCore.Tests.UI/Tests/InvalidSetupTests.cs | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/test/OrchardCore.Tests.UI/Tests/AdminMonkeyTests.cs b/test/OrchardCore.Tests.UI/Tests/AdminMonkeyTests.cs index d9ae86696aa..15f4b992c22 100644 --- a/test/OrchardCore.Tests.UI/Tests/AdminMonkeyTests.cs +++ b/test/OrchardCore.Tests.UI/Tests/AdminMonkeyTests.cs @@ -21,7 +21,7 @@ public AdminMonkeyTests(ITestOutputHelper testOutputHelper) { } - [Theory(Skip = "Minimal test suite for multi-DB testing."), Chrome] + [Theory, Chrome] public Task TestAdminPagesAsMonkeyRecursivelyShouldWorkWithAdminUser(Browser browser) => ExecuteTestAsync( async context => diff --git a/test/OrchardCore.Tests.UI/Tests/AgencyRecipeTests.cs b/test/OrchardCore.Tests.UI/Tests/AgencyRecipeTests.cs index 15cdc6a8923..f346aeecae2 100644 --- a/test/OrchardCore.Tests.UI/Tests/AgencyRecipeTests.cs +++ b/test/OrchardCore.Tests.UI/Tests/AgencyRecipeTests.cs @@ -17,7 +17,7 @@ public AgencyRecipeTests(ITestOutputHelper testOutputHelper) { } - [Theory(Skip = "Minimal test suite for multi-DB testing."), Chrome] + [Theory, Chrome] public Task BasicOrchardFeaturesShouldWorkWithAgency(Browser browser) => ExecuteTestAsync( async context => diff --git a/test/OrchardCore.Tests.UI/Tests/AzureBlobStorageTests.cs b/test/OrchardCore.Tests.UI/Tests/AzureBlobStorageTests.cs index 704287df6b4..8e5ba1b2a81 100644 --- a/test/OrchardCore.Tests.UI/Tests/AzureBlobStorageTests.cs +++ b/test/OrchardCore.Tests.UI/Tests/AzureBlobStorageTests.cs @@ -15,7 +15,7 @@ public AzureBlobStorageTests(ITestOutputHelper testOutputHelper) { } - [Theory(Skip = "Minimal test suite for multi-DB testing."), Chrome] + [Theory, Chrome] public Task BasicOrchardFeaturesShouldWorkWithBlogAndAzureBlobStorage(Browser browser) => ExecuteTestAsync( async context => diff --git a/test/OrchardCore.Tests.UI/Tests/BlankRecipeTests.cs b/test/OrchardCore.Tests.UI/Tests/BlankRecipeTests.cs index 9fbe4816e09..61dade3bf1d 100644 --- a/test/OrchardCore.Tests.UI/Tests/BlankRecipeTests.cs +++ b/test/OrchardCore.Tests.UI/Tests/BlankRecipeTests.cs @@ -18,7 +18,7 @@ public BlankRecipeTests(ITestOutputHelper testOutputHelper) { } - [Theory(Skip = "Minimal test suite for multi-DB testing."), Chrome] + [Theory, Chrome] public Task BasicOrchardFeaturesShouldWorkWithBlank(Browser browser) => ExecuteTestAsync( async context => diff --git a/test/OrchardCore.Tests.UI/Tests/ComingSoonRecipeTests.cs b/test/OrchardCore.Tests.UI/Tests/ComingSoonRecipeTests.cs index 365a850aec4..12f76caa987 100644 --- a/test/OrchardCore.Tests.UI/Tests/ComingSoonRecipeTests.cs +++ b/test/OrchardCore.Tests.UI/Tests/ComingSoonRecipeTests.cs @@ -15,7 +15,7 @@ public ComingSoonRecipeTests(ITestOutputHelper testOutputHelper) { } - [Theory(Skip = "Minimal test suite for multi-DB testing."), Chrome] + [Theory, Chrome] public Task BasicOrchardFeaturesShouldWorkWithComingSoon(Browser browser) => ExecuteTestAsync( async context => diff --git a/test/OrchardCore.Tests.UI/Tests/HeadlessRecipeTests.cs b/test/OrchardCore.Tests.UI/Tests/HeadlessRecipeTests.cs index 2db773c9404..eee1cc02ef7 100644 --- a/test/OrchardCore.Tests.UI/Tests/HeadlessRecipeTests.cs +++ b/test/OrchardCore.Tests.UI/Tests/HeadlessRecipeTests.cs @@ -15,7 +15,7 @@ public HeadlessRecipeTests(ITestOutputHelper testOutputHelper) { } - [Theory(Skip = "Minimal test suite for multi-DB testing."), Chrome] + [Theory, Chrome] public Task BasicOrchardFeaturesShouldWorkWithHeadless(Browser browser) => ExecuteTestAsync( async context => diff --git a/test/OrchardCore.Tests.UI/Tests/InvalidSetupTests.cs b/test/OrchardCore.Tests.UI/Tests/InvalidSetupTests.cs index 2650218b2cf..27254739c95 100644 --- a/test/OrchardCore.Tests.UI/Tests/InvalidSetupTests.cs +++ b/test/OrchardCore.Tests.UI/Tests/InvalidSetupTests.cs @@ -16,7 +16,7 @@ public InvalidSetupTests(ITestOutputHelper testOutputHelper) { } - [Theory(Skip = "Minimal test suite for multi-DB testing."), Chrome] + [Theory, Chrome] public Task SetupWithInvalidDataShouldFail(Browser browser) => ExecuteTestAsync( context => context.TestSetupWithInvalidDataAsync( From 1cea784c11d65a2fd66830a0368bbf15fd85fcc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Sat, 5 Nov 2022 23:46:50 +0100 Subject: [PATCH 161/175] More conventional connection string for MySQL --- .../Extensions/OrchardCoreSetupParametersExtensions.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs b/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs index 3e98591679a..1cddf1b1e64 100644 --- a/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs +++ b/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs @@ -34,7 +34,7 @@ public static OrchardCoreSetupParameters ConfigureDatabaseSettings( } else if (provider == OrchardCoreSetupPage.DatabaseType.MySql) { - setupParameters.ConnectionString = "server=127.0.0.1;uid=root;pwd=test123;database=mariadb;"; + setupParameters.ConnectionString = "Server=127.0.0.1;User ID=root;Password=test123;Database=mariadb;"; } return setupParameters; From 44e39f96d939278e13d635abb386cd227077100e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Sun, 6 Nov 2022 18:58:55 +0100 Subject: [PATCH 162/175] Revert "Re-enabling all tests" This reverts commit 4cc769c95b203edf822e69b07c24852fcd08da12. --- test/OrchardCore.Tests.UI/Tests/AdminMonkeyTests.cs | 2 +- test/OrchardCore.Tests.UI/Tests/AgencyRecipeTests.cs | 2 +- test/OrchardCore.Tests.UI/Tests/AzureBlobStorageTests.cs | 2 +- test/OrchardCore.Tests.UI/Tests/BlankRecipeTests.cs | 2 +- test/OrchardCore.Tests.UI/Tests/ComingSoonRecipeTests.cs | 2 +- test/OrchardCore.Tests.UI/Tests/HeadlessRecipeTests.cs | 2 +- test/OrchardCore.Tests.UI/Tests/InvalidSetupTests.cs | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/test/OrchardCore.Tests.UI/Tests/AdminMonkeyTests.cs b/test/OrchardCore.Tests.UI/Tests/AdminMonkeyTests.cs index 15f4b992c22..d9ae86696aa 100644 --- a/test/OrchardCore.Tests.UI/Tests/AdminMonkeyTests.cs +++ b/test/OrchardCore.Tests.UI/Tests/AdminMonkeyTests.cs @@ -21,7 +21,7 @@ public AdminMonkeyTests(ITestOutputHelper testOutputHelper) { } - [Theory, Chrome] + [Theory(Skip = "Minimal test suite for multi-DB testing."), Chrome] public Task TestAdminPagesAsMonkeyRecursivelyShouldWorkWithAdminUser(Browser browser) => ExecuteTestAsync( async context => diff --git a/test/OrchardCore.Tests.UI/Tests/AgencyRecipeTests.cs b/test/OrchardCore.Tests.UI/Tests/AgencyRecipeTests.cs index f346aeecae2..15cdc6a8923 100644 --- a/test/OrchardCore.Tests.UI/Tests/AgencyRecipeTests.cs +++ b/test/OrchardCore.Tests.UI/Tests/AgencyRecipeTests.cs @@ -17,7 +17,7 @@ public AgencyRecipeTests(ITestOutputHelper testOutputHelper) { } - [Theory, Chrome] + [Theory(Skip = "Minimal test suite for multi-DB testing."), Chrome] public Task BasicOrchardFeaturesShouldWorkWithAgency(Browser browser) => ExecuteTestAsync( async context => diff --git a/test/OrchardCore.Tests.UI/Tests/AzureBlobStorageTests.cs b/test/OrchardCore.Tests.UI/Tests/AzureBlobStorageTests.cs index 8e5ba1b2a81..704287df6b4 100644 --- a/test/OrchardCore.Tests.UI/Tests/AzureBlobStorageTests.cs +++ b/test/OrchardCore.Tests.UI/Tests/AzureBlobStorageTests.cs @@ -15,7 +15,7 @@ public AzureBlobStorageTests(ITestOutputHelper testOutputHelper) { } - [Theory, Chrome] + [Theory(Skip = "Minimal test suite for multi-DB testing."), Chrome] public Task BasicOrchardFeaturesShouldWorkWithBlogAndAzureBlobStorage(Browser browser) => ExecuteTestAsync( async context => diff --git a/test/OrchardCore.Tests.UI/Tests/BlankRecipeTests.cs b/test/OrchardCore.Tests.UI/Tests/BlankRecipeTests.cs index 61dade3bf1d..9fbe4816e09 100644 --- a/test/OrchardCore.Tests.UI/Tests/BlankRecipeTests.cs +++ b/test/OrchardCore.Tests.UI/Tests/BlankRecipeTests.cs @@ -18,7 +18,7 @@ public BlankRecipeTests(ITestOutputHelper testOutputHelper) { } - [Theory, Chrome] + [Theory(Skip = "Minimal test suite for multi-DB testing."), Chrome] public Task BasicOrchardFeaturesShouldWorkWithBlank(Browser browser) => ExecuteTestAsync( async context => diff --git a/test/OrchardCore.Tests.UI/Tests/ComingSoonRecipeTests.cs b/test/OrchardCore.Tests.UI/Tests/ComingSoonRecipeTests.cs index 12f76caa987..365a850aec4 100644 --- a/test/OrchardCore.Tests.UI/Tests/ComingSoonRecipeTests.cs +++ b/test/OrchardCore.Tests.UI/Tests/ComingSoonRecipeTests.cs @@ -15,7 +15,7 @@ public ComingSoonRecipeTests(ITestOutputHelper testOutputHelper) { } - [Theory, Chrome] + [Theory(Skip = "Minimal test suite for multi-DB testing."), Chrome] public Task BasicOrchardFeaturesShouldWorkWithComingSoon(Browser browser) => ExecuteTestAsync( async context => diff --git a/test/OrchardCore.Tests.UI/Tests/HeadlessRecipeTests.cs b/test/OrchardCore.Tests.UI/Tests/HeadlessRecipeTests.cs index eee1cc02ef7..2db773c9404 100644 --- a/test/OrchardCore.Tests.UI/Tests/HeadlessRecipeTests.cs +++ b/test/OrchardCore.Tests.UI/Tests/HeadlessRecipeTests.cs @@ -15,7 +15,7 @@ public HeadlessRecipeTests(ITestOutputHelper testOutputHelper) { } - [Theory, Chrome] + [Theory(Skip = "Minimal test suite for multi-DB testing."), Chrome] public Task BasicOrchardFeaturesShouldWorkWithHeadless(Browser browser) => ExecuteTestAsync( async context => diff --git a/test/OrchardCore.Tests.UI/Tests/InvalidSetupTests.cs b/test/OrchardCore.Tests.UI/Tests/InvalidSetupTests.cs index 27254739c95..2650218b2cf 100644 --- a/test/OrchardCore.Tests.UI/Tests/InvalidSetupTests.cs +++ b/test/OrchardCore.Tests.UI/Tests/InvalidSetupTests.cs @@ -16,7 +16,7 @@ public InvalidSetupTests(ITestOutputHelper testOutputHelper) { } - [Theory, Chrome] + [Theory(Skip = "Minimal test suite for multi-DB testing."), Chrome] public Task SetupWithInvalidDataShouldFail(Browser browser) => ExecuteTestAsync( context => context.TestSetupWithInvalidDataAsync( From 8d67700b22e51640ab2d8cf57a7ac4d591879b41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Sun, 6 Nov 2022 19:05:50 +0100 Subject: [PATCH 163/175] Trying ankane/setup-mariadb instead --- .github/workflows/pr_ci.yml | 11 +++-------- .../OrchardCoreSetupParametersExtensions.cs | 2 +- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/.github/workflows/pr_ci.yml b/.github/workflows/pr_ci.yml index 0d39fd0f9f1..6e03b68e42c 100644 --- a/.github/workflows/pr_ci.yml +++ b/.github/workflows/pr_ci.yml @@ -60,15 +60,10 @@ jobs: # build-directory: test/OrchardCore.Tests.UI # MariaDB is an open-source drop-in replacement of MySQL, so we can use it instead. - name: Set up MariaDB - # v1.13.0 - uses: shogo82148/actions-setup-mysql@e9da98ba6e914131f3111105e445c06bc1629280 + # v1 branch as of 06.11.2022. + uses: ankane/setup-mariadb@81fcdda23edba40ba0762fb8fff403e320a46f76 with: - distribution: "mariadb" - root-password: "test123" - - name: Create MariaDB database - shell: pwsh - run: | - mysql --user=root --password=test123 --host=127.0.0.1 --execute="CREATE DATABASE mariadb" + database: mariadb - name: CMS UI Tests - MySql uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@issue/OSOE-424 env: diff --git a/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs b/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs index 1cddf1b1e64..3ffdc9e0104 100644 --- a/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs +++ b/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs @@ -34,7 +34,7 @@ public static OrchardCoreSetupParameters ConfigureDatabaseSettings( } else if (provider == OrchardCoreSetupPage.DatabaseType.MySql) { - setupParameters.ConnectionString = "Server=127.0.0.1;User ID=root;Password=test123;Database=mariadb;"; + setupParameters.ConnectionString = "Server=127.0.0.1;Database=mariadb;"; } return setupParameters; From 345dea047a0a7db5fe58cc664d5782ddd235d0c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Sun, 6 Nov 2022 19:09:33 +0100 Subject: [PATCH 164/175] Trying ankane/setup-postgres instead --- .github/workflows/pr_ci.yml | 33 ++++++++++--------- .../OrchardCoreSetupParametersExtensions.cs | 2 +- 2 files changed, 18 insertions(+), 17 deletions(-) diff --git a/.github/workflows/pr_ci.yml b/.github/workflows/pr_ci.yml index 6e03b68e42c..0615f4a4053 100644 --- a/.github/workflows/pr_ci.yml +++ b/.github/workflows/pr_ci.yml @@ -48,25 +48,26 @@ jobs: # OrchardCore__UITestingCIDatabaseProvider: "SqlServer" # with: # build-directory: test/OrchardCore.Tests.UI - #- name: Start PostgreSQL - # # v3 - # # This will cause warnings until this is fixed: https://github.com/ikalnytskyi/action-setup-postgres/issues/6. - # uses: ikalnytskyi/action-setup-postgres@e5b77936cf3f9d1a079ac5e8c1787fc657924809 - #- name: CMS UI Tests - PostgreSQL - # uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@issue/OSOE-424 - # env: - # OrchardCore__UITestingCIDatabaseProvider: "Postgres" - # with: - # build-directory: test/OrchardCore.Tests.UI - # MariaDB is an open-source drop-in replacement of MySQL, so we can use it instead. - - name: Set up MariaDB + - name: Start PostgreSQL # v1 branch as of 06.11.2022. - uses: ankane/setup-mariadb@81fcdda23edba40ba0762fb8fff403e320a46f76 + uses: ankane/setup-postgres@fb3b63234a45536dde68bae3f8cf1b6dbbc281cb with: - database: mariadb - - name: CMS UI Tests - MySql + database: postgres + - name: CMS UI Tests - PostgreSQL uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@issue/OSOE-424 env: - OrchardCore__UITestingCIDatabaseProvider: "MySql" + OrchardCore__UITestingCIDatabaseProvider: "Postgres" with: build-directory: test/OrchardCore.Tests.UI + # MariaDB is an open-source drop-in replacement of MySQL, so we can use it instead. + #- name: Set up MariaDB + # # v1 branch as of 06.11.2022. + # uses: ankane/setup-mariadb@81fcdda23edba40ba0762fb8fff403e320a46f76 + # with: + # database: mariadb + #- name: CMS UI Tests - MySql + # uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@issue/OSOE-424 + # env: + # OrchardCore__UITestingCIDatabaseProvider: "MySql" + # with: + # build-directory: test/OrchardCore.Tests.UI diff --git a/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs b/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs index 3ffdc9e0104..f2b9f83c7cc 100644 --- a/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs +++ b/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs @@ -30,7 +30,7 @@ public static OrchardCoreSetupParameters ConfigureDatabaseSettings( if (provider == OrchardCoreSetupPage.DatabaseType.Postgres) { - setupParameters.ConnectionString = "Host=localhost;Port=5432;User ID=postgres;Password=postgres;Database=postgres;"; + setupParameters.ConnectionString = "Host=localhost;Port=5432;Database=postgres;"; } else if (provider == OrchardCoreSetupPage.DatabaseType.MySql) { From c04ecdac2a7a90b7a28d8eebef18de3c20f6923d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Sun, 6 Nov 2022 19:19:41 +0100 Subject: [PATCH 165/175] Just Ubuntu for now --- .github/workflows/pr_ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr_ci.yml b/.github/workflows/pr_ci.yml index 6e03b68e42c..b61dbfc531d 100644 --- a/.github/workflows/pr_ci.yml +++ b/.github/workflows/pr_ci.yml @@ -11,7 +11,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest, windows-latest] + os: [ubuntu-latest] name: Build & Test steps: - uses: actions/checkout@v3 From 41e905772183cb106180951a4eeae36bbed0a946 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Sun, 6 Nov 2022 19:20:19 +0100 Subject: [PATCH 166/175] Providing at least the User ID for MariaDB --- .../Extensions/OrchardCoreSetupParametersExtensions.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs b/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs index 3ffdc9e0104..e51be0c0d4c 100644 --- a/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs +++ b/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs @@ -34,7 +34,7 @@ public static OrchardCoreSetupParameters ConfigureDatabaseSettings( } else if (provider == OrchardCoreSetupPage.DatabaseType.MySql) { - setupParameters.ConnectionString = "Server=127.0.0.1;Database=mariadb;"; + setupParameters.ConnectionString = "Server=127.0.0.1;User ID=runneradmin;Database=mariadb;"; } return setupParameters; From 756378aa499cd9bcd6f378be1ef1ad6fa53c2c03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Sun, 6 Nov 2022 19:21:36 +0100 Subject: [PATCH 167/175] The postgres database is created by default --- .github/workflows/pr_ci.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/pr_ci.yml b/.github/workflows/pr_ci.yml index 9dd1dfce9be..ebe9b45d323 100644 --- a/.github/workflows/pr_ci.yml +++ b/.github/workflows/pr_ci.yml @@ -51,8 +51,6 @@ jobs: - name: Start PostgreSQL # v1 branch as of 06.11.2022. uses: ankane/setup-postgres@fb3b63234a45536dde68bae3f8cf1b6dbbc281cb - with: - database: postgres - name: CMS UI Tests - PostgreSQL uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@issue/OSOE-424 env: From b9f4bc130260257288deebb7eeadcf09bbde4fd6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Sun, 6 Nov 2022 19:30:33 +0100 Subject: [PATCH 168/175] Revert "Revert "Re-enabling all tests"" This reverts commit 44e39f96d939278e13d635abb386cd227077100e. --- test/OrchardCore.Tests.UI/Tests/AdminMonkeyTests.cs | 2 +- test/OrchardCore.Tests.UI/Tests/AgencyRecipeTests.cs | 2 +- test/OrchardCore.Tests.UI/Tests/AzureBlobStorageTests.cs | 2 +- test/OrchardCore.Tests.UI/Tests/BlankRecipeTests.cs | 2 +- test/OrchardCore.Tests.UI/Tests/ComingSoonRecipeTests.cs | 2 +- test/OrchardCore.Tests.UI/Tests/HeadlessRecipeTests.cs | 2 +- test/OrchardCore.Tests.UI/Tests/InvalidSetupTests.cs | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/test/OrchardCore.Tests.UI/Tests/AdminMonkeyTests.cs b/test/OrchardCore.Tests.UI/Tests/AdminMonkeyTests.cs index d9ae86696aa..15f4b992c22 100644 --- a/test/OrchardCore.Tests.UI/Tests/AdminMonkeyTests.cs +++ b/test/OrchardCore.Tests.UI/Tests/AdminMonkeyTests.cs @@ -21,7 +21,7 @@ public AdminMonkeyTests(ITestOutputHelper testOutputHelper) { } - [Theory(Skip = "Minimal test suite for multi-DB testing."), Chrome] + [Theory, Chrome] public Task TestAdminPagesAsMonkeyRecursivelyShouldWorkWithAdminUser(Browser browser) => ExecuteTestAsync( async context => diff --git a/test/OrchardCore.Tests.UI/Tests/AgencyRecipeTests.cs b/test/OrchardCore.Tests.UI/Tests/AgencyRecipeTests.cs index 15cdc6a8923..f346aeecae2 100644 --- a/test/OrchardCore.Tests.UI/Tests/AgencyRecipeTests.cs +++ b/test/OrchardCore.Tests.UI/Tests/AgencyRecipeTests.cs @@ -17,7 +17,7 @@ public AgencyRecipeTests(ITestOutputHelper testOutputHelper) { } - [Theory(Skip = "Minimal test suite for multi-DB testing."), Chrome] + [Theory, Chrome] public Task BasicOrchardFeaturesShouldWorkWithAgency(Browser browser) => ExecuteTestAsync( async context => diff --git a/test/OrchardCore.Tests.UI/Tests/AzureBlobStorageTests.cs b/test/OrchardCore.Tests.UI/Tests/AzureBlobStorageTests.cs index 704287df6b4..8e5ba1b2a81 100644 --- a/test/OrchardCore.Tests.UI/Tests/AzureBlobStorageTests.cs +++ b/test/OrchardCore.Tests.UI/Tests/AzureBlobStorageTests.cs @@ -15,7 +15,7 @@ public AzureBlobStorageTests(ITestOutputHelper testOutputHelper) { } - [Theory(Skip = "Minimal test suite for multi-DB testing."), Chrome] + [Theory, Chrome] public Task BasicOrchardFeaturesShouldWorkWithBlogAndAzureBlobStorage(Browser browser) => ExecuteTestAsync( async context => diff --git a/test/OrchardCore.Tests.UI/Tests/BlankRecipeTests.cs b/test/OrchardCore.Tests.UI/Tests/BlankRecipeTests.cs index 9fbe4816e09..61dade3bf1d 100644 --- a/test/OrchardCore.Tests.UI/Tests/BlankRecipeTests.cs +++ b/test/OrchardCore.Tests.UI/Tests/BlankRecipeTests.cs @@ -18,7 +18,7 @@ public BlankRecipeTests(ITestOutputHelper testOutputHelper) { } - [Theory(Skip = "Minimal test suite for multi-DB testing."), Chrome] + [Theory, Chrome] public Task BasicOrchardFeaturesShouldWorkWithBlank(Browser browser) => ExecuteTestAsync( async context => diff --git a/test/OrchardCore.Tests.UI/Tests/ComingSoonRecipeTests.cs b/test/OrchardCore.Tests.UI/Tests/ComingSoonRecipeTests.cs index 365a850aec4..12f76caa987 100644 --- a/test/OrchardCore.Tests.UI/Tests/ComingSoonRecipeTests.cs +++ b/test/OrchardCore.Tests.UI/Tests/ComingSoonRecipeTests.cs @@ -15,7 +15,7 @@ public ComingSoonRecipeTests(ITestOutputHelper testOutputHelper) { } - [Theory(Skip = "Minimal test suite for multi-DB testing."), Chrome] + [Theory, Chrome] public Task BasicOrchardFeaturesShouldWorkWithComingSoon(Browser browser) => ExecuteTestAsync( async context => diff --git a/test/OrchardCore.Tests.UI/Tests/HeadlessRecipeTests.cs b/test/OrchardCore.Tests.UI/Tests/HeadlessRecipeTests.cs index 2db773c9404..eee1cc02ef7 100644 --- a/test/OrchardCore.Tests.UI/Tests/HeadlessRecipeTests.cs +++ b/test/OrchardCore.Tests.UI/Tests/HeadlessRecipeTests.cs @@ -15,7 +15,7 @@ public HeadlessRecipeTests(ITestOutputHelper testOutputHelper) { } - [Theory(Skip = "Minimal test suite for multi-DB testing."), Chrome] + [Theory, Chrome] public Task BasicOrchardFeaturesShouldWorkWithHeadless(Browser browser) => ExecuteTestAsync( async context => diff --git a/test/OrchardCore.Tests.UI/Tests/InvalidSetupTests.cs b/test/OrchardCore.Tests.UI/Tests/InvalidSetupTests.cs index 2650218b2cf..27254739c95 100644 --- a/test/OrchardCore.Tests.UI/Tests/InvalidSetupTests.cs +++ b/test/OrchardCore.Tests.UI/Tests/InvalidSetupTests.cs @@ -16,7 +16,7 @@ public InvalidSetupTests(ITestOutputHelper testOutputHelper) { } - [Theory(Skip = "Minimal test suite for multi-DB testing."), Chrome] + [Theory, Chrome] public Task SetupWithInvalidDataShouldFail(Browser browser) => ExecuteTestAsync( context => context.TestSetupWithInvalidDataAsync( From e1b87e22fc31fb95b5143af92876ac6e4b78d175 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Sun, 6 Nov 2022 19:30:42 +0100 Subject: [PATCH 169/175] Revert "Just Ubuntu for now" This reverts commit c04ecdac2a7a90b7a28d8eebef18de3c20f6923d. --- .github/workflows/pr_ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr_ci.yml b/.github/workflows/pr_ci.yml index ebe9b45d323..b33d93a202a 100644 --- a/.github/workflows/pr_ci.yml +++ b/.github/workflows/pr_ci.yml @@ -11,7 +11,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest] + os: [ubuntu-latest, windows-latest] name: Build & Test steps: - uses: actions/checkout@v3 From 9ba9ab7a9c6775c81bc3d6f7c88e12ebb768cbcf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Sun, 6 Nov 2022 19:45:08 +0100 Subject: [PATCH 170/175] Back to original MariaDB approach --- .github/workflows/pr_ci.yml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pr_ci.yml b/.github/workflows/pr_ci.yml index b61dbfc531d..0d39fd0f9f1 100644 --- a/.github/workflows/pr_ci.yml +++ b/.github/workflows/pr_ci.yml @@ -11,7 +11,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest] + os: [ubuntu-latest, windows-latest] name: Build & Test steps: - uses: actions/checkout@v3 @@ -60,10 +60,15 @@ jobs: # build-directory: test/OrchardCore.Tests.UI # MariaDB is an open-source drop-in replacement of MySQL, so we can use it instead. - name: Set up MariaDB - # v1 branch as of 06.11.2022. - uses: ankane/setup-mariadb@81fcdda23edba40ba0762fb8fff403e320a46f76 + # v1.13.0 + uses: shogo82148/actions-setup-mysql@e9da98ba6e914131f3111105e445c06bc1629280 with: - database: mariadb + distribution: "mariadb" + root-password: "test123" + - name: Create MariaDB database + shell: pwsh + run: | + mysql --user=root --password=test123 --host=127.0.0.1 --execute="CREATE DATABASE mariadb" - name: CMS UI Tests - MySql uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@issue/OSOE-424 env: From daa0fdc279f74106b58b8d3aef28685342c13a80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Sun, 6 Nov 2022 19:52:18 +0100 Subject: [PATCH 171/175] Also reverting connection string --- .../Extensions/OrchardCoreSetupParametersExtensions.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs b/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs index e51be0c0d4c..1cddf1b1e64 100644 --- a/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs +++ b/test/OrchardCore.Tests.UI/Extensions/OrchardCoreSetupParametersExtensions.cs @@ -34,7 +34,7 @@ public static OrchardCoreSetupParameters ConfigureDatabaseSettings( } else if (provider == OrchardCoreSetupPage.DatabaseType.MySql) { - setupParameters.ConnectionString = "Server=127.0.0.1;User ID=runneradmin;Database=mariadb;"; + setupParameters.ConnectionString = "Server=127.0.0.1;User ID=root;Password=test123;Database=mariadb;"; } return setupParameters; From 9c56fb4381157998d49e9328354bbe261b49c8e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Sun, 6 Nov 2022 19:55:29 +0100 Subject: [PATCH 172/175] Re-enable MariaDB --- .github/workflows/pr_ci.yml | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/.github/workflows/pr_ci.yml b/.github/workflows/pr_ci.yml index b33d93a202a..4eadee08188 100644 --- a/.github/workflows/pr_ci.yml +++ b/.github/workflows/pr_ci.yml @@ -48,24 +48,24 @@ jobs: # OrchardCore__UITestingCIDatabaseProvider: "SqlServer" # with: # build-directory: test/OrchardCore.Tests.UI - - name: Start PostgreSQL - # v1 branch as of 06.11.2022. - uses: ankane/setup-postgres@fb3b63234a45536dde68bae3f8cf1b6dbbc281cb - - name: CMS UI Tests - PostgreSQL - uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@issue/OSOE-424 - env: - OrchardCore__UITestingCIDatabaseProvider: "Postgres" - with: - build-directory: test/OrchardCore.Tests.UI - # MariaDB is an open-source drop-in replacement of MySQL, so we can use it instead. - #- name: Set up MariaDB + #- name: Start PostgreSQL # # v1 branch as of 06.11.2022. - # uses: ankane/setup-mariadb@81fcdda23edba40ba0762fb8fff403e320a46f76 - # with: - # database: mariadb - #- name: CMS UI Tests - MySql + # uses: ankane/setup-postgres@fb3b63234a45536dde68bae3f8cf1b6dbbc281cb + #- name: CMS UI Tests - PostgreSQL # uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@issue/OSOE-424 # env: - # OrchardCore__UITestingCIDatabaseProvider: "MySql" + # OrchardCore__UITestingCIDatabaseProvider: "Postgres" # with: # build-directory: test/OrchardCore.Tests.UI + # MariaDB is an open-source drop-in replacement of MySQL, so we can use it instead. + - name: Set up MariaDB + # v1 branch as of 06.11.2022. + uses: ankane/setup-mariadb@81fcdda23edba40ba0762fb8fff403e320a46f76 + with: + database: mariadb + - name: CMS UI Tests - MySql + uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@issue/OSOE-424 + env: + OrchardCore__UITestingCIDatabaseProvider: "MySql" + with: + build-directory: test/OrchardCore.Tests.UI From 8125eb0b81d59f4921e50bac853510369d8c10d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Tue, 8 Nov 2022 19:22:13 +0100 Subject: [PATCH 173/175] Pointing Lombiq GHA actions to a different branch --- .github/workflows/pr_ci.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/pr_ci.yml b/.github/workflows/pr_ci.yml index e95f6094a61..bd4e718249e 100644 --- a/.github/workflows/pr_ci.yml +++ b/.github/workflows/pr_ci.yml @@ -29,21 +29,21 @@ jobs: # run: | # dotnet test -c Release --no-restore --no-build ./test/OrchardCore.Tests/OrchardCore.Tests.csproj #- name: MVC UI Tests - # uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@issue/OSOE-424 + # uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@issue/OSOE-408 # with: # build-directory: test/OrchardCore.Tests.UI.Mvc - name: Set up Azurite - uses: Lombiq/GitHub-Actions/.github/actions/setup-azurite@issue/OSOE-424 + uses: Lombiq/GitHub-Actions/.github/actions/setup-azurite@issue/OSOE-408 with: location: test/OrchardCore.Tests.UI #- name: CMS UI Tests - SQLite - # uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@issue/OSOE-424 + # uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@issue/OSOE-408 # with: # build-directory: test/OrchardCore.Tests.UI #- name: Set up SQL Server - # uses: Lombiq/GitHub-Actions/.github/actions/setup-sql-server@issue/OSOE-424 + # uses: Lombiq/GitHub-Actions/.github/actions/setup-sql-server@issue/OSOE-408 #- name: CMS UI Tests - SQL Server - # uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@issue/OSOE-424 + # uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@issue/OSOE-408 # env: # OrchardCore__UITestingCIDatabaseProvider: "SqlServer" # with: @@ -52,7 +52,7 @@ jobs: # # v1 branch as of 06.11.2022. # uses: ankane/setup-postgres@fb3b63234a45536dde68bae3f8cf1b6dbbc281cb #- name: CMS UI Tests - PostgreSQL - # uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@issue/OSOE-424 + # uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@issue/OSOE-408 # env: # OrchardCore__UITestingCIDatabaseProvider: "Postgres" # with: @@ -69,7 +69,7 @@ jobs: run: | mysql --user=root --password=test123 --host=127.0.0.1 --execute="CREATE DATABASE mariadb" - name: CMS UI Tests - MySql - uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@issue/OSOE-424 + uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@issue/OSOE-408 env: OrchardCore__UITestingCIDatabaseProvider: "MySql" with: From 6b2df55fa429f8f25303526aa4fb342d90fa4618 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Tue, 8 Nov 2022 19:22:30 +0100 Subject: [PATCH 174/175] Enabling only MVC UI Tests to test test reporting --- .github/workflows/pr_ci.yml | 40 ++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/.github/workflows/pr_ci.yml b/.github/workflows/pr_ci.yml index bd4e718249e..cf5bd5aa056 100644 --- a/.github/workflows/pr_ci.yml +++ b/.github/workflows/pr_ci.yml @@ -28,10 +28,10 @@ jobs: #- name: Unit Tests # run: | # dotnet test -c Release --no-restore --no-build ./test/OrchardCore.Tests/OrchardCore.Tests.csproj - #- name: MVC UI Tests - # uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@issue/OSOE-408 - # with: - # build-directory: test/OrchardCore.Tests.UI.Mvc + - name: MVC UI Tests + uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@issue/OSOE-408 + with: + build-directory: test/OrchardCore.Tests.UI.Mvc - name: Set up Azurite uses: Lombiq/GitHub-Actions/.github/actions/setup-azurite@issue/OSOE-408 with: @@ -58,19 +58,19 @@ jobs: # with: # build-directory: test/OrchardCore.Tests.UI # MariaDB is an open-source drop-in replacement of MySQL, so we can use it instead. - - name: Set up MariaDB - # v1.13.0 - uses: shogo82148/actions-setup-mysql@e9da98ba6e914131f3111105e445c06bc1629280 - with: - distribution: "mariadb" - root-password: "test123" - - name: Create MariaDB database - shell: pwsh - run: | - mysql --user=root --password=test123 --host=127.0.0.1 --execute="CREATE DATABASE mariadb" - - name: CMS UI Tests - MySql - uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@issue/OSOE-408 - env: - OrchardCore__UITestingCIDatabaseProvider: "MySql" - with: - build-directory: test/OrchardCore.Tests.UI + #- name: Set up MariaDB + # # v1.13.0 + # uses: shogo82148/actions-setup-mysql@e9da98ba6e914131f3111105e445c06bc1629280 + # with: + # distribution: "mariadb" + # root-password: "test123" + #- name: Create MariaDB database + # shell: pwsh + # run: | + # mysql --user=root --password=test123 --host=127.0.0.1 --execute="CREATE DATABASE mariadb" + #- name: CMS UI Tests - MySql + # uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@issue/OSOE-408 + # env: + # OrchardCore__UITestingCIDatabaseProvider: "MySql" + # with: + # build-directory: test/OrchardCore.Tests.UI From 4c1f070e0e868c45ca65dee1b42863c35440ea4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Leh=C3=B3czky?= Date: Tue, 8 Nov 2022 19:33:36 +0100 Subject: [PATCH 175/175] Revert "Enabling only MVC UI Tests to test test reporting" This reverts commit 6b2df55fa429f8f25303526aa4fb342d90fa4618. --- .github/workflows/pr_ci.yml | 40 ++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/.github/workflows/pr_ci.yml b/.github/workflows/pr_ci.yml index cf5bd5aa056..bd4e718249e 100644 --- a/.github/workflows/pr_ci.yml +++ b/.github/workflows/pr_ci.yml @@ -28,10 +28,10 @@ jobs: #- name: Unit Tests # run: | # dotnet test -c Release --no-restore --no-build ./test/OrchardCore.Tests/OrchardCore.Tests.csproj - - name: MVC UI Tests - uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@issue/OSOE-408 - with: - build-directory: test/OrchardCore.Tests.UI.Mvc + #- name: MVC UI Tests + # uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@issue/OSOE-408 + # with: + # build-directory: test/OrchardCore.Tests.UI.Mvc - name: Set up Azurite uses: Lombiq/GitHub-Actions/.github/actions/setup-azurite@issue/OSOE-408 with: @@ -58,19 +58,19 @@ jobs: # with: # build-directory: test/OrchardCore.Tests.UI # MariaDB is an open-source drop-in replacement of MySQL, so we can use it instead. - #- name: Set up MariaDB - # # v1.13.0 - # uses: shogo82148/actions-setup-mysql@e9da98ba6e914131f3111105e445c06bc1629280 - # with: - # distribution: "mariadb" - # root-password: "test123" - #- name: Create MariaDB database - # shell: pwsh - # run: | - # mysql --user=root --password=test123 --host=127.0.0.1 --execute="CREATE DATABASE mariadb" - #- name: CMS UI Tests - MySql - # uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@issue/OSOE-408 - # env: - # OrchardCore__UITestingCIDatabaseProvider: "MySql" - # with: - # build-directory: test/OrchardCore.Tests.UI + - name: Set up MariaDB + # v1.13.0 + uses: shogo82148/actions-setup-mysql@e9da98ba6e914131f3111105e445c06bc1629280 + with: + distribution: "mariadb" + root-password: "test123" + - name: Create MariaDB database + shell: pwsh + run: | + mysql --user=root --password=test123 --host=127.0.0.1 --execute="CREATE DATABASE mariadb" + - name: CMS UI Tests - MySql + uses: Lombiq/GitHub-Actions/.github/actions/test-dotnet@issue/OSOE-408 + env: + OrchardCore__UITestingCIDatabaseProvider: "MySql" + with: + build-directory: test/OrchardCore.Tests.UI