diff --git a/readme.md b/readme.md index a5cd6ad..e361657 100644 --- a/readme.md +++ b/readme.md @@ -132,6 +132,14 @@ dotnet pack -p:PackageVersion=0.0.25 --output nupkgs Update the example project package version (Weasyprint.Wrapped.Example.csproj) and run the example to test it +## Error in tests + +The following error might be thrown when running the tests on windows: +``` shell +(process:13448): GLib-GIO-WARNING **: 17:21:45.816: Unexpectedly, UWP app `Microsoft.OutlookForWindows_1.2023.1114.100_x64__8wekyb3d8bbwe' (AUMId `Microsoft.OutlookForWindows_8wekyb3d8bbwe!Microsoft.OutlookforWindows') supports 1 extensions but has no verbs +``` +Check here for the answer: + ## Building assets ### Windows (build-on-windows.ps1 does approximately this) diff --git a/src/Weasyprint.Wrapped.Tests/Expected/Print_RunsCommand_Simple_Input.html b/src/Weasyprint.Wrapped.Tests/Expected/Print_RunsCommand_Simple_Input.html new file mode 100644 index 0000000..ed062e2 --- /dev/null +++ b/src/Weasyprint.Wrapped.Tests/Expected/Print_RunsCommand_Simple_Input.html @@ -0,0 +1,9 @@ + + + + + +

TEST

+ + + \ No newline at end of file diff --git a/src/Weasyprint.Wrapped.Tests/Expected/Print_RunsCommand_WithFilePaths_Result_Actual.pdf b/src/Weasyprint.Wrapped.Tests/Expected/Print_RunsCommand_WithFilePaths_Result_Actual.pdf new file mode 100644 index 0000000..f8a06cc Binary files /dev/null and b/src/Weasyprint.Wrapped.Tests/Expected/Print_RunsCommand_WithFilePaths_Result_Actual.pdf differ diff --git a/src/Weasyprint.Wrapped.Tests/Tests/PrinterTests.cs b/src/Weasyprint.Wrapped.Tests/Tests/PrinterTests.cs index f7cc175..02b558d 100755 --- a/src/Weasyprint.Wrapped.Tests/Tests/PrinterTests.cs +++ b/src/Weasyprint.Wrapped.Tests/Tests/PrinterTests.cs @@ -4,6 +4,7 @@ using System.IO.Compression; using System.Linq; using System.Runtime.InteropServices; +using System.Threading; using System.Threading.Tasks; using Xunit; @@ -94,6 +95,25 @@ public async Task Print_RunsCommand_Simple() Assert.True(result.Bytes.Length > 0); } + [Fact] + public async Task Print_RunsCommand_WithFilePaths_Simple() + { + var printer = GetPrinter(); + await printer.Initialize(); + + var testingProjectRoot = new DirectoryInfo(AppContext.BaseDirectory).Parent.Parent.Parent.FullName; + var inputFile = Path.Combine(testingProjectRoot,"Expected/Print_RunsCommand_Simple_Input.html"); + var outputFile = Path.Combine(testingProjectRoot, "Expected/Print_RunsCommand_WithFilePaths_Result_Actual.pdf"); + var result = await printer.Print(inputFile, outputFile, CancellationToken.None); + + Assert.True(string.IsNullOrWhiteSpace(result.Error), $"Should have no error but found {result.Error}"); + Assert.Equal(0, result.ExitCode); + Assert.False(result.HasError); + + var outputFileBytes = File.ReadAllBytes(outputFile); + Assert.True(outputFileBytes.Length > 0); + } + [Fact] public async Task Print_RunsCommand_WithParameters() {