Examples of JFileChooserTester


Examples of abbot.tester.JFileChooserTester

    // 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);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.