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-84: Merge task/nodejs-extensions to dev #258

Merged
merged 57 commits into from
Jan 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
a2ce0eb
Consolidating PackageReference version
Sep 30, 2022
58190ea
Merge remote-tracking branch 'origin/dev' into issue/OSOE-84
Oct 17, 2022
f6ef2a7
Fix MD linter warnings
Oct 18, 2022
2c41a57
Update NPM-Targets version
Oct 18, 2022
21086f5
Remove "v" prefix
Oct 18, 2022
6168364
Revert unnecessary change in Migration.md
Oct 19, 2022
af94506
Fix MD linter warning
Oct 19, 2022
df35145
Merge remote-tracking branch 'origin/dev' into issue/OSOE-84
sarahelsaig Oct 19, 2022
fc37bf0
Merge branch 'dev' into task/node-extensions
Oct 20, 2022
2ab286c
Merge branch 'task/node-extensions' into issue/OSOE-84
Oct 20, 2022
3ce7bd0
Merge pull request #210 from Lombiq/issue/OSOE-84
sarahelsaig Oct 24, 2022
46602d5
Merge remote-tracking branch 'origin/dev' into task/node-extensions
Oct 25, 2022
38e7a90
Fix trailing whitespace in MD
Oct 25, 2022
a6df1b8
Merge branch 'dev' into task/node-extensions
Oct 25, 2022
17a02c9
Merge remote-tracking branch 'origin/dev' into task/node-extensions
Oct 27, 2022
06735bc
Merge remote-tracking branch 'origin/dev' into task/node-extensions
sarahelsaig Oct 28, 2022
fb74d03
Merge remote-tracking branch 'origin/dev' into task/node-extensions
Nov 4, 2022
a2628b4
Merge remote-tracking branch 'origin/dev' into task/node-extensions
Nov 10, 2022
53b738d
Merge remote-tracking branch 'origin/dev' into task/node-extensions
Nov 14, 2022
b7befa4
Update pnpm lock file to v7
Nov 15, 2022
e2ea177
Merge remote-tracking branch 'origin/dev' into task/node-extensions
Nov 17, 2022
6f47dbb
Merge remote-tracking branch 'origin/dev' into task/node-extensions
Nov 17, 2022
378df72
Merge remote-tracking branch 'origin/dev' into task/node-extensions
Nov 25, 2022
f4c119a
Merge remote-tracking branch 'origin/dev' into task/nodejs-extensions
Nov 25, 2022
1860d0c
Merge branch 'task/nodejs-extensions' into issue/OSOE-84-final
Nov 25, 2022
502ff52
Merge remote-tracking branch 'origin/dev' into issue/OSOE-84-final
Nov 28, 2022
455a558
Merge remote-tracking branch 'origin/dev' into issue/OSOE-84-final
Dec 5, 2022
1cb07b5
Merge remote-tracking branch 'origin/dev' into task/nodejs-extensions
Dec 7, 2022
0d1268b
Merge branch 'task/nodejs-extensions' into issue/OSOE-84-final
Dec 7, 2022
267bba5
Merge remote-tracking branch 'origin/dev' into issue/OSOE-84-final
Dec 12, 2022
ed193c4
Merge remote-tracking branch 'origin/dev' into issue/OSOE-84-final
Dec 14, 2022
7798f4a
Merge remote-tracking branch 'origin/dev' into issue/OSOE-84-final
Dec 14, 2022
b6d31e6
Merge remote-tracking branch 'origin/dev' into task/nodejs-extensions
Dec 27, 2022
5f61799
Merge branch 'task/nodejs-extensions' into issue/OSOE-84-final
Dec 28, 2022
855e2b2
Update NPM-Targets to latest NuGet package
Dec 28, 2022
b4771aa
Update HL to latest NuGet package
Dec 29, 2022
d38a182
Merge remote-tracking branch 'origin/dev' into issue/OSOE-84-final
Jan 2, 2023
6524d74
Merge remote-tracking branch 'origin/dev' into issue/OSOE-84-final
Jan 7, 2023
f67b323
Merge remote-tracking branch 'origin/dev' into issue/OSOE-84-final
Jan 9, 2023
9790246
Add missing parameter documentation
Jan 9, 2023
65a2817
Dry boilerplate code
Jan 9, 2023
fb386fc
Dry repetitive code even more
Jan 9, 2023
f642da2
Dry repetitive code even more! Makes comments superfluous
Jan 9, 2023
97915ee
Add stacktraces to the failure dump for investigation
Jan 9, 2023
e55c840
Use shorter folder names
Jan 9, 2023
1d8d072
Revert "Use shorter folder names"
Jan 9, 2023
63d9ab3
Use short, random name
Jan 9, 2023
e04e571
Revert "Use short, random name"
Jan 12, 2023
3f6697a
Revert "Add stacktraces to the failure dump for investigation"
Jan 12, 2023
8a2d2b8
Merge remote-tracking branch 'origin/dev' into task/nodejs-extensions
Jan 13, 2023
fabf8dc
Merge branch 'task/nodejs-extensions' into issue/OSOE-84-final
Jan 13, 2023
5ca3796
Merge remote-tracking branch 'origin/dev' into issue/OSOE-84-final
Jan 16, 2023
dbbd057
Merge remote-tracking branch 'origin/dev' into task/nodejs-extensions
Jan 18, 2023
162d296
Merge branch 'task/nodejs-extensions' into issue/OSOE-84-final
Jan 18, 2023
872283e
Merge remote-tracking branch 'origin/dev' into task/nodejs-extensions
Jan 19, 2023
8e0f796
Merge branch 'task/nodejs-extensions' into issue/OSOE-84-final
Jan 19, 2023
161ea5e
Merge pull request #238 from Lombiq/issue/OSOE-84-final
sarahelsaig Jan 24, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public static class FailureDumpUITestContextExtensions
/// <param name="context"><see cref="UITestContext"/> instance.</param>
/// <param name="fileName">The name of the file.</param>
/// <param name="action">Gets called in failure dump collection.</param>
/// <param name="messageIfExists">A message to display in case the desired file already exists in the dump.</param>
public static void AppendFailureDump(
this UITestContext context,
string fileName,
Expand All @@ -33,6 +34,7 @@ public static void AppendFailureDump(
/// <param name="context"><see cref="UITestContext"/> instance.</param>
/// <param name="fileName">The name of the file.</param>
/// <param name="content">File content.</param>
/// <param name="messageIfExists">A message to display in case the desired file already exists in the dump.</param>
public static void AppendFailureDump(
this UITestContext context,
string fileName,
Expand All @@ -54,6 +56,7 @@ public static void AppendFailureDump(
/// <param name="content">File content.</param>
/// <param name="getStream">Function to get a new <see cref="Stream"/> from content.</param>
/// <param name="dispose">Action to dispose the content, if required. Can be null.</param>
/// <param name="messageIfExists">A message to display in case the desired file already exists in the dump.</param>
public static void AppendFailureDump<TContent>(
this UITestContext context,
string fileName,
Expand All @@ -71,9 +74,8 @@ public static void AppendFailureDump<TContent>(
/// </summary>
/// <param name="context"><see cref="UITestContext"/> instance.</param>
/// <param name="fileName">The name of the file.</param>
/// <param name="image">
/// File content. The <see cref="Image"/> will be disposed at the end.
/// </param>
/// <param name="image">File content. The <see cref="Image"/> will be disposed at the end.</param>
/// <param name="messageIfExists">A message to display in case the desired file already exists in the dump.</param>
public static void AppendFailureDump(
this UITestContext context,
string fileName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -400,13 +400,7 @@ private static void AssertVisualVerification(
using var elementImageOriginal = context.TakeElementScreenshot(element).ShouldNotBeNull();

var originalElementScreenshotFileName =
new[]
{
configuration.FileNamePrefix,
VisualVerificationMatchNames.ElementImageFileName,
configuration.FileNameSuffix,
}
.JoinNotNullOrEmpty("-");
configuration.WrapFileName(VisualVerificationMatchNames.ElementImageFileName);

// Checking the dimensions of captured image. This needs to happen before any other comparisons, because that
// can only be done on images with the same dimensions.
Expand Down Expand Up @@ -446,7 +440,7 @@ private static void AssertVisualVerification(
.ShouldNotBeNull();

// Now we are one step away from the end. Here we create a statistical summary of the differences between the
// captured and the baseline image. In the end, the lower values are better. You can read more about how these
// captured and the baseline image. In the end, lower values are better. You can read more about how these
// statistical calculations are created here:
// https://github.com/Codeuctivity/ImageSharp.Compare/blob/2.0.46/ImageSharpCompare/ImageSharpCompare.cs#L218.
var diff = baselineImageCropped.CompareTo(elementImageCropped);
Expand All @@ -458,75 +452,21 @@ private static void AssertVisualVerification(
catch
{
// Here we append all the relevant items to the failure dump to help the investigation.
// The full-page screenshot
context.AddImageToFailureDump(
new[]
{
configuration.FileNamePrefix,
VisualVerificationMatchNames.FullScreenImageFileName,
configuration.FileNameSuffix,
}
.JoinNotNullOrEmpty("-"),
fullScreenImage);

// The original element screenshot
context.AddImageToFailureDump(originalElementScreenshotFileName, elementImageOriginal);
void AddImageToFailureDumpLocal(string fileName, Image image, bool dontWrap = false) =>
context.AddImageToFailureDump(dontWrap ? fileName : configuration.WrapFileName(fileName), image);

AddImageToFailureDumpLocal(VisualVerificationMatchNames.FullScreenImageFileName, fullScreenImage);
AddImageToFailureDumpLocal(originalElementScreenshotFileName, elementImageOriginal, dontWrap: true);
AddImageToFailureDumpLocal(VisualVerificationMatchNames.BaselineImageFileName, baselineImageOriginal);
AddImageToFailureDumpLocal(VisualVerificationMatchNames.CroppedBaselineImageFileName, baselineImageCropped);
AddImageToFailureDumpLocal(VisualVerificationMatchNames.CroppedElementImageFileName, elementImageCropped);
AddImageToFailureDumpLocal(VisualVerificationMatchNames.DiffImageFileName, diffImage);

// The original baseline image
context.AddImageToFailureDump(
new[]
{
configuration.FileNamePrefix,
VisualVerificationMatchNames.BaselineImageFileName,
configuration.FileNameSuffix,
}
.JoinNotNullOrEmpty("-"),
baselineImageOriginal);

// The cropped baseline image
context.AddImageToFailureDump(
new[]
{
configuration.FileNamePrefix,
VisualVerificationMatchNames.CroppedBaselineImageFileName,
configuration.FileNameSuffix,
}
.JoinNotNullOrEmpty("-"),
baselineImageCropped);

// The cropped element image
context.AddImageToFailureDump(
new[]
{
configuration.FileNamePrefix,
VisualVerificationMatchNames.CroppedElementImageFileName,
configuration.FileNameSuffix,
}
.JoinNotNullOrEmpty("-"),
elementImageCropped);

// The diff image
context.AddImageToFailureDump(
new[]
{
configuration.FileNamePrefix,
VisualVerificationMatchNames.DiffImageFileName,
configuration.FileNameSuffix,
}
.JoinNotNullOrEmpty("-"),
diffImage);

// The diff stats
// The diff stats.
context.AppendFailureDump(
Path.Combine(
VisualVerificationMatchNames.DumpFolderName,
new[]
{
configuration.FileNamePrefix,
VisualVerificationMatchNames.DiffLogFileName,
configuration.FileNameSuffix,
}
.JoinNotNullOrEmpty("-")),
configuration.WrapFileName(VisualVerificationMatchNames.DiffLogFileName)),
content: string.Format(
CultureInfo.InvariantCulture,
@"
Expand Down
2 changes: 1 addition & 1 deletion Lombiq.Tests.UI/Lombiq.Tests.UI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
<PackageReference Include="Lombiq.HelpfulLibraries.Cli" Version="5.1.0" />
<PackageReference Include="Lombiq.HelpfulLibraries.OrchardCore" Version="5.1.0" />
<PackageReference Include="Lombiq.HelpfulLibraries.RestEase" Version="5.1.0" />
<PackageReference Include="Lombiq.Npm.Targets" Version="1.2.1" />
<PackageReference Include="Lombiq.Npm.Targets" Version="1.2.1-alpha.3.osoe-84" />
</ItemGroup>

<!-- These are necessary for symbols NuGet packaging, otherwise Shouldly would prevent PDBs to be packaged, see:
Expand Down
10 changes: 10 additions & 0 deletions Lombiq.Tests.UI/Models/VisualVerificationMatchConfiguration.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
using System;

namespace Lombiq.Tests.UI.Models;

public class VisualVerificationMatchConfiguration<TSelf>
Expand Down Expand Up @@ -34,6 +36,14 @@ public TSelf WithFileNameSuffix(string value)

return (TSelf)this;
}

public string WrapFileName(string fileName) =>
new[]
{
FileNamePrefix,
fileName,
FileNameSuffix,
}.JoinNotNullOrEmpty("-");
}

public class VisualMatchConfiguration : VisualVerificationMatchConfiguration<VisualMatchConfiguration> { }
2 changes: 1 addition & 1 deletion Lombiq.Tests.UI/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.