2382 tests can now proceed through the DSP selection panel

This commit is contained in:
William Schaefer 2017-03-13 17:56:27 -04:00
parent 8a4b78daee
commit 01db267b0a

View File

@ -50,12 +50,14 @@ import org.netbeans.jemmy.operators.JListOperator;
import org.netbeans.jemmy.operators.JTabbedPaneOperator; import org.netbeans.jemmy.operators.JTabbedPaneOperator;
import org.netbeans.jemmy.operators.JTableOperator; import org.netbeans.jemmy.operators.JTableOperator;
import org.netbeans.jemmy.operators.JTextFieldOperator; import org.netbeans.jemmy.operators.JTextFieldOperator;
import org.netbeans.jemmy.operators.JToggleButtonOperator;
import org.sleuthkit.autopsy.ingest.IngestManager; import org.sleuthkit.autopsy.ingest.IngestManager;
public class AutopsyTestCases { public class AutopsyTestCases {
private static final Logger logger = Logger.getLogger(AutopsyTestCases.class.getName()); private static final Logger logger = Logger.getLogger(AutopsyTestCases.class.getName());
private long start; private long start;
/** /**
* This method is used to escape file/directory path. Example: * This method is used to escape file/directory path. Example:
* \\NetworkLocation\foo\bar get escaped to \\\\NetworkLocation\foo\bar so * \\NetworkLocation\foo\bar get escaped to \\\\NetworkLocation\foo\bar so
@ -106,11 +108,15 @@ public class AutopsyTestCases {
public void testStartAddImageFileDataSource() { public void testStartAddImageFileDataSource() {
logger.info("Starting Add Image process"); logger.info("Starting Add Image process");
WizardOperator wo = new WizardOperator("Add Data"); WizardOperator wo = new WizardOperator("Add Data");
//select the toggle button for Disk Image or VM File it will be the first button created and proceed to next panel
JToggleButtonOperator jtbo = new JToggleButtonOperator(wo, 0);
jtbo.clickMouse();
wo.btNext().clickMouse();
JTextFieldOperator jtfo0 = new JTextFieldOperator(wo, 0); JTextFieldOperator jtfo0 = new JTextFieldOperator(wo, 0);
String img_path = getEscapedPath(System.getProperty("img_path")); String img_path = getEscapedPath(System.getProperty("img_path"));
String imageDir = img_path; String imageDir = img_path;
((JTextComponent) jtfo0.getSource()).setText(imageDir); ((JTextComponent) jtfo0.getSource()).setText(imageDir);
JComboBoxOperator comboBoxOperator = new JComboBoxOperator(wo, 1); JComboBoxOperator comboBoxOperator = new JComboBoxOperator(wo, 0);
comboBoxOperator.setSelectedItem("(GMT-5:00) America/New_York"); comboBoxOperator.setSelectedItem("(GMT-5:00) America/New_York");
wo.btNext().clickMouse(); wo.btNext().clickMouse();
} }
@ -118,9 +124,10 @@ public class AutopsyTestCases {
public void testStartAddLogicalFilesDataSource() { public void testStartAddLogicalFilesDataSource() {
logger.info("Starting Add Logical Files process"); logger.info("Starting Add Logical Files process");
WizardOperator wo = new WizardOperator("Add Data"); WizardOperator wo = new WizardOperator("Add Data");
JComboBoxOperator comboBoxOperator = new JComboBoxOperator(wo); //select the toggle button for Logical Files it will be the third button created and proceed to next panel
// select the item indexed 2 (Logical Files) from the drop-down list. JToggleButtonOperator jtbo = new JToggleButtonOperator(wo, 2);
comboBoxOperator.selectItem(2); jtbo.clickMouse();
wo.btNext().clickMouse();
JButtonOperator addButtonOperator = new JButtonOperator(wo, "Add"); JButtonOperator addButtonOperator = new JButtonOperator(wo, "Add");
addButtonOperator.pushNoBlock(); addButtonOperator.pushNoBlock();
JFileChooserOperator fileChooserOperator = new JFileChooserOperator(); JFileChooserOperator fileChooserOperator = new JFileChooserOperator();