});
// Wait for print to PDF file chooser to be shown
tester.waitForFrameShowing(new AWTHierarchy(), preferences.getLocalizedString(
HomePane.class, "printToPDFDialog.title"));
// Check dialog box is displayed
final Dialog printToPdfDialog = (Dialog)new BasicFinder().find(frame,
new ClassMatcher (Dialog.class, true));
assertTrue("Print to pdf dialog not showing", printToPdfDialog.isShowing());
// Change file in print to PDF file chooser
final JFileChooserTester fileChooserTester = new JFileChooserTester();
final JFileChooser fileChooser = (JFileChooser)new BasicFinder().find(printToPdfDialog,
new ClassMatcher(JFileChooser.class));
fileChooserTester.actionSetDirectory(fileChooser, System.getProperty("user.dir"));
fileChooserTester.actionSetFilename(fileChooser, pdfFileBase);
// Select Ok option to hide dialog box
fileChooserTester.actionApprove(fileChooser);
// Wait PDF generation
Thread.sleep(2000);
assertFalse("Print to pdf dialog still showing", printToPdfDialog.isShowing());
assertTrue("PDF file doesn't exist", pdfFile.exists());
assertTrue("PDF file is empty", pdfFile.length() > 0);
pdfFile.delete();
}