Skip to content

Commit

Permalink
UITest: Add Thread.Sleep to the modern print dialog to get the tests …
Browse files Browse the repository at this point in the history
…more stable
  • Loading branch information
jbe2277 committed Feb 3, 2025
1 parent 57ab17f commit 47c626f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/Samples.UITest/BookLibrary.Test/Tests/ReportingTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ void PrintAsPdf(string fileName)
if (printDialog is not null) // Windows 2025 Server uses legacy print dialog
{
printDialog.PrinterSelector.Select(printDialog.PrintToPdf.Name);
Thread.Sleep(100);
Retry.WhileFalse(() => printDialog.PrintButton.IsEnabled, throwOnTimeout: true);
printDialog.PrintButton.Invoke();
printCompleted = true;
Expand Down
1 change: 1 addition & 0 deletions src/Samples.UITest/Writer.Test/Tests/WriterTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ void PrintAsPdf(string fileName)
if (printDialog is not null) // Windows 2025 Server uses legacy print dialog
{
printDialog.PrinterSelector.Select(printDialog.PrintToPdf.Name);
Thread.Sleep(100);
Retry.WhileFalse(() => printDialog.PrintButton.IsEnabled, throwOnTimeout: true);
printDialog.PrintButton.Invoke();
printCompleted = true;
Expand Down

0 comments on commit 47c626f

Please sign in to comment.