Skip to content

Commit

Permalink
Log list of available printers
Browse files Browse the repository at this point in the history
  • Loading branch information
jbe2277 committed Jun 16, 2024
1 parent c6a771c commit 64812cb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Samples.UITest/BookLibrary.Test/Tests/ReportingTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ void PrintAsPdf(string fileName)
else
{
var printDialog = window.FirstModalWindow().As<LegacyPrintDialog>();
Log.WriteLine("Printers:");
foreach (var x in printDialog.PrinterList.Items) Log.WriteLine($"- {x.Text}");
printDialog.PrintButton.Click();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ namespace UITest.SystemViews;

public class LegacyPrintDialog(FrameworkAutomationElementBase element) : Window(element)
{
public ListBox PrinterList => this.Find(x => x.ByControlType(ControlType.List).And(x.ByAutomationId("1"))).AsListBox();

public Button PrintButton => this.Find(x => x.ByControlType(ControlType.Button).And(x.ByAutomationId("1"))).AsButton();

public Button CancelButton => this.Find(x => x.ByControlType(ControlType.Button).And(x.ByAutomationId("2"))).AsButton();
Expand Down

0 comments on commit 64812cb

Please sign in to comment.