Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OSOE-771: Create full UI test suite in Lombiq.Walkthroughs #699

Merged
merged 52 commits into from
Feb 13, 2024
Merged
Show file tree
Hide file tree
Changes from 51 commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
7c2ef25
Walkthrough cleaned up and test steps added up until going to the mai…
Piedone Feb 9, 2024
c5de048
ClickReliablyOnByLinkTextAsync() navigation shortcut in Lombiq.UITest…
Piedone Feb 9, 2024
19a6fe9
Steps up until import
Piedone Feb 11, 2024
a7384ac
Completing all Walkthroughs test steps
Piedone Feb 11, 2024
0da19cc
Merge remote-tracking branch 'origin/dev' into issue/OSOE-771
Piedone Feb 11, 2024
aa3799e
Spelling
Piedone Feb 11, 2024
7cd0f52
Increasing workflow timeout
Piedone Feb 11, 2024
3b35410
Lombiq.Walkthroughs UI test log sections
Piedone Feb 11, 2024
b83be19
Increasing process timeout
Piedone Feb 11, 2024
21995ce
Spelling
Piedone Feb 11, 2024
bc3ebcd
Further increasing dotnet test process timeout
Piedone Feb 11, 2024
c647f84
Adding missing Theme.png for NuGet.TestTheme
Piedone Feb 11, 2024
13ad25d
Updating NuGetTest solution too
Piedone Feb 11, 2024
f51112a
Temporarily enabling parallel builds
Piedone Feb 12, 2024
6dd25c4
Re-adding mistakenly removed comments
Piedone Feb 12, 2024
135aafc
Removing orphaned </a> elements in Lombiq.Walkthroughs
Piedone Feb 12, 2024
0517125
Temporarily renaming test class to see if it helps performance
Piedone Feb 12, 2024
5209928
Dummy change to kick off build
Piedone Feb 12, 2024
abe44ff
Revert "Dummy change to kick off build"
Piedone Feb 12, 2024
9e1020c
Spelling
Piedone Feb 12, 2024
b79cbfe
Dummy change to kick off build
Piedone Feb 12, 2024
fe90f14
Revert "Dummy change to kick off build"
Piedone Feb 12, 2024
4489acf
Temporarily disabling Spelling workflow
Piedone Feb 12, 2024
d773726
Dummy change to kick off build
Piedone Feb 12, 2024
b95046b
Revert "Dummy change to kick off build"
Piedone Feb 12, 2024
127abfd
Temporarily removing NuGetTest build too
Piedone Feb 12, 2024
269e159
Dummy change to kick off build again
Piedone Feb 12, 2024
7ab5024
Revert "Dummy change to kick off build again"
Piedone Feb 12, 2024
31e5d90
Revert "Temporarily renaming test class to see if it helps performance"
Piedone Feb 12, 2024
1650165
Trying to run BehaviorWalkthroughsTests in the beginning with a name …
Piedone Feb 12, 2024
6ce2190
Dummy change to kick off build again
Piedone Feb 12, 2024
5ead90d
Revert "Dummy change to kick off build again"
Piedone Feb 12, 2024
b8a657f
Setting parent job names too
Piedone Feb 12, 2024
f5c3514
Trying test rename again
Piedone Feb 12, 2024
462325e
Naming the test itself so it's at the beginning alphabetically
Piedone Feb 12, 2024
897cf74
Revert "Naming the test itself so it's at the beginning alphabetically"
Piedone Feb 12, 2024
827760a
Reverting workflow, increasing timeouts
Piedone Feb 12, 2024
5159e74
Again temporarily allowing parallel builds, and enabling Windows builds
Piedone Feb 12, 2024
650c3a0
Reverting test name
Piedone Feb 12, 2024
42d275a
Enabling Windows builds for workflows temporarily
Piedone Feb 12, 2024
abd2836
Fixing Windows build
Piedone Feb 12, 2024
8879ab2
And NuGetTest Windows builds too
Piedone Feb 12, 2024
7df888e
Dummy change to kick off build
Piedone Feb 12, 2024
1116cf6
Revert "Dummy change to kick off build"
Piedone Feb 12, 2024
d7ec70b
Lombiq.Walkthroughs UI test fix
Piedone Feb 12, 2024
39fe130
Removing now unnecessary retry in Lombiq.Walkthroughs
Piedone Feb 12, 2024
840d6e4
Mergeable version of workflows
Piedone Feb 12, 2024
e43ddad
Merge remote-tracking branch 'origin/dev' into issue/OSOE-771
Piedone Feb 12, 2024
a300fa4
Lombiq.Walkthroughs NuGet alpha release
Piedone Feb 12, 2024
fc07840
Increasing Windows NuGetTest timeout too
Piedone Feb 12, 2024
b9d509c
Lombiq.UITestingToolbox monkey testing sample speed-up
Piedone Feb 12, 2024
aa65673
Updating Lombiq.UITestingToolbox and Lombiq.Walkthroughs to latest dev
DemeSzabolcs Feb 13, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions .github/workflows/build-and-test-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@ jobs:
uses: Lombiq/GitHub-Actions/.github/workflows/build-and-test-orchard-core.yml@dev
with:
parent-job-name: "root-solution-larger-runners"
# Should be windows-2022-8core but temporarily isn't due to this bug: https://github.com/Lombiq/GitHub-Actions/issues/320.
# Once this is reverted, timeout-minutes below should also be reverted to 30 and dotnet-test-process-timeout to 360000.
# Should be windows-2022-8core but temporarily isn't due to this bug:
# https://github.com/Lombiq/GitHub-Actions/issues/320. Once this is reverted, timeout-minutes below should also be
# reverted to 30 and dotnet-test-process-timeout to 540000.
machine-types: "['windows-2022']"
timeout-minutes: 60
set-up-sql-server: "true"
Expand Down Expand Up @@ -76,8 +77,8 @@ jobs:
parent-job-name: "nuget-solution"
machine-types: "['windows-2022']"
build-directory: NuGetTest
timeout-minutes: 25
dotnet-test-process-timeout: 360000
timeout-minutes: 30
dotnet-test-process-timeout: 420000
# Running ZAP for security scans in Docker under GHA Windows runners won't work since such virtualization is not
# supported by GHA.
test-filter: "FullyQualifiedName!~SecurityScanningTests"
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ jobs:
with:
parent-job-name: "root-solution-larger-runners"
machine-types: "['buildjet-4vcpu-ubuntu-2204']"
timeout-minutes: 20
timeout-minutes: 30
set-up-sql-server: "true"
set-up-azurite: "true"
ui-test-parallelism: 0
build-create-binary-log: "true"
dotnet-test-process-timeout: 360000
dotnet-test-process-timeout: 540000
build-enable-nuget-caching: "true"
build-enable-npm-caching: "true"

Expand All @@ -43,8 +43,8 @@ jobs:
with:
parent-job-name: nuget-solution
build-directory: NuGetTest
timeout-minutes: 15
dotnet-test-process-timeout: 360000
timeout-minutes: 20
dotnet-test-process-timeout: 420000

spelling:
name: Spelling
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@
<PackageReference Include="Lombiq.Privacy" Version="7.0.2-alpha.2.osoe-638" />
<PackageReference Include="Lombiq.Privacy.Samples" Version="7.0.2-alpha.2.osoe-638" />
<PackageReference Include="Lombiq.SetupExtensions" Version="5.0.0" />
<PackageReference Include="Lombiq.Tests.UI.AppExtensions" Version="8.2.1-alpha.14.osoe-767" />
<PackageReference Include="Lombiq.Tests.UI.Shortcuts" Version="8.2.1-alpha.14.osoe-767" />
<PackageReference Include="Lombiq.Tests.UI.AppExtensions" Version="8.2.1-alpha.16.osoe-771" />
<PackageReference Include="Lombiq.Tests.UI.Shortcuts" Version="8.2.1-alpha.16.osoe-771" />
<PackageReference Include="Lombiq.UIKit" Version="6.0.1-alpha.0.osoe-638" />
<PackageReference Include="Lombiq.VueJs" Version="3.0.1-alpha.0.osoe-638" />
<PackageReference Include="Lombiq.VueJs.Samples" Version="3.0.1-alpha.0.osoe-638" />
<PackageReference Include="Lombiq.Walkthroughs" Version="1.0.0-alpha.2.nest-522" />
<PackageReference Include="Lombiq.Walkthroughs" Version="1.0.0-alpha.4.osoe-771" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="1.2.2" Condition="'$(RazorRuntimeCompilation)' == 'true'" />
<PackageReference Include="SixLabors.ImageSharp.Web" Version="3.0.1" />
</ItemGroup>
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@
<PackageReference Include="Lombiq.OrchardCoreApiClient.Tests.UI" Version="4.0.1-alpha.0.osoe-638" />
<PackageReference Include="Lombiq.Privacy.Tests.UI" Version="7.0.2-alpha.2.osoe-638" />
<PackageReference Include="Lombiq.HelpfulExtensions.Tests.UI" Version="7.0.2-alpha.2.osoe-683" />
<PackageReference Include="Lombiq.Tests.UI" Version="8.2.1-alpha.14.osoe-767" />
<PackageReference Include="Lombiq.Tests.UI" Version="8.2.1-alpha.16.osoe-771" />
<PackageReference Include="Lombiq.VueJs.Tests.UI" Version="3.0.1-alpha.0.osoe-638" />
<PackageReference Include="Lombiq.Walkthroughs.Tests.UI" Version="1.0.0-alpha.2.nest-522" />
<PackageReference Include="Lombiq.Walkthroughs.Tests.UI" Version="1.0.0-alpha.4.osoe-771" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.1">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
using Lombiq.Tests.UI.Extensions;
using Lombiq.Tests.UI.Services;
using Lombiq.Walkthroughs.Tests.UI.Extensions;
using OpenQA.Selenium;
using Shouldly;
using System;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using Xunit;
using Xunit.Abstractions;
Expand All @@ -18,9 +23,26 @@ public BehaviorWalkthroughsTests(ITestOutputHelper testOutputHelper)
public Task WalkthroughsShouldWorkCorrectly() =>
ExecuteTestAsync(
context => context.RunSetupAndTestWalkthroughsBehaviorAsync(),
// Could be removed if https://github.com/shepherd-pro/shepherd/issues/2555 is fixed.
DemeSzabolcs marked this conversation as resolved.
Show resolved Hide resolved
changeConfiguration: configuration => configuration.HtmlValidationConfiguration.HtmlValidationOptions =
configuration.HtmlValidationConfiguration.HtmlValidationOptions
.CloneWith(validationOptions => validationOptions.ConfigPath =
Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "BehaviorWalkthroughsTests.htmlvalidate.json")));
changeConfiguration: configuration =>
{
// Could be removed if https://github.com/shepherd-pro/shepherd/issues/2555 is fixed.
configuration.HtmlValidationConfiguration.HtmlValidationOptions =
configuration.HtmlValidationConfiguration.HtmlValidationOptions
.CloneWith(validationOptions => validationOptions.ConfigPath =
Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "BehaviorWalkthroughsTests.htmlvalidate.json"));

// Once the linked issues are fixed, the custom browser log assertion can be removed completely.
configuration.AssertBrowserLog = logEntries => logEntries.ShouldNotContain(
logEntry => IsValidLogEntry(logEntry),
logEntries.Where(IsValidLogEntry).ToFormattedString());
});

private static bool IsValidLogEntry(LogEntry logEntry) =>
OrchardCoreUITestExecutorConfiguration.IsValidBrowserLogEntry(logEntry) &&
// See https://github.com/OrchardCMS/OrchardCore/issues/15301.
!(logEntry.Message.ContainsOrdinalIgnoreCase("/OrchardCore.Resources/Scripts/jquery.js?v=") &&
logEntry.Message.ContainsOrdinalIgnoreCase("3128:6 Uncaught")) &&
// See https://github.com/OrchardCMS/OrchardCore/issues/14598. This error has multiple variations, so targeting
// the lowest common denominator with the file name.
!logEntry.Message.ContainsOrdinalIgnoreCase("/monaco/IStandaloneEditorConstructionOptions.json");
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
using Lombiq.Tests.UI.Extensions;
using Lombiq.Tests.UI.Services;
using Lombiq.Walkthroughs.Tests.UI.Extensions;
using OpenQA.Selenium;
using Shouldly;
using System;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using Xunit;
using Xunit.Abstractions;
Expand All @@ -19,8 +24,26 @@ public Task WalkthroughsShouldWorkCorrectly() =>
ExecuteTestAsync(
context => context.RunSetupAndTestWalkthroughsBehaviorAsync(),
// Could be removed if https://github.com/shepherd-pro/shepherd/issues/2555 is fixed.
changeConfiguration: configuration => configuration.HtmlValidationConfiguration.HtmlValidationOptions =
configuration.HtmlValidationConfiguration.HtmlValidationOptions
.CloneWith(validationOptions => validationOptions.ConfigPath =
Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "BehaviorWalkthroughsTests.htmlvalidate.json")));
changeConfiguration: configuration =>
{
// Could be removed if https://github.com/shepherd-pro/shepherd/issues/2555 is fixed.
configuration.HtmlValidationConfiguration.HtmlValidationOptions =
configuration.HtmlValidationConfiguration.HtmlValidationOptions
.CloneWith(validationOptions => validationOptions.ConfigPath =
Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "BehaviorWalkthroughsTests.htmlvalidate.json"));

// Once the linked issues are fixed, the custom browser log assertion can be removed completely.
configuration.AssertBrowserLog = logEntries => logEntries.ShouldNotContain(
logEntry => IsValidLogEntry(logEntry),
logEntries.Where(IsValidLogEntry).ToFormattedString());
});

private static bool IsValidLogEntry(LogEntry logEntry) =>
OrchardCoreUITestExecutorConfiguration.IsValidBrowserLogEntry(logEntry) &&
// See https://github.com/OrchardCMS/OrchardCore/issues/15301.
!(logEntry.Message.ContainsOrdinalIgnoreCase("/OrchardCore.Resources/Scripts/jquery.js?v=") &&
logEntry.Message.ContainsOrdinalIgnoreCase("3128:6 Uncaught")) &&
// See https://github.com/OrchardCMS/OrchardCore/issues/14598. This error has multiple variations, so targeting
// the lowest common denominator with the file name.
!logEntry.Message.ContainsOrdinalIgnoreCase("/monaco/IStandaloneEditorConstructionOptions.json");
}
Loading