2640: override the default WindowWaiter.WaitwidnowTimeout to git WizardOperator more time to wait it's fully loaded and also at StartAddxxxxDataSource time give timeouts for casedatabase and solr to create

This commit is contained in:
U-BASIS\zhaohui 2017-05-15 13:23:11 -04:00
parent 97ff7ca519
commit c61c179807

View File

@ -39,7 +39,9 @@ import javax.swing.text.JTextComponent;
import org.netbeans.jellytools.MainWindowOperator;
import org.netbeans.jellytools.NbDialogOperator;
import org.netbeans.jellytools.WizardOperator;
import org.netbeans.jemmy.JemmyProperties;
import org.netbeans.jemmy.Timeout;
import org.netbeans.jemmy.Timeouts;
import org.netbeans.jemmy.operators.JButtonOperator;
import org.netbeans.jemmy.operators.JCheckBoxOperator;
import org.netbeans.jemmy.operators.JComboBoxOperator;
@ -57,7 +59,8 @@ public class AutopsyTestCases {
private static final Logger logger = Logger.getLogger(AutopsyTestCases.class.getName());
private long start;
private Timeouts timeouts; //Set a new timeout value for WizardOpertor
/**
* Escapes the slashes in a file or directory path.
*
@ -78,6 +81,12 @@ public class AutopsyTestCases {
public AutopsyTestCases() {
start = 0;
/*
* Nightly test failed at this point because of TimeoutExpiredException. So we set 4 minutes (This number is based on test experience) for WizardOperator
* to override the default WaitWindowTimeouts=60000
*/
timeouts = JemmyProperties.getCurrentTimeouts();
timeouts.setTimeout("WindowWaiter.WaitWindowTimeOut", 240000);
}
public void testNewCaseWizardOpen(String title) {
@ -104,8 +113,13 @@ public class AutopsyTestCases {
}
public void testStartAddImageFileDataSource() {
/*
* This time out is to give time for creating case database and opening solr index
*/
new Timeout("pausing", 120000).sleep();
logger.info("Starting Add Image process");
WizardOperator wo = new WizardOperator("Add Data Source");
wo.setTimeouts(timeouts);
while(!wo.btNext().isEnabled()){
new Timeout("pausing", 1000).sleep(); // give it a second till the Add Data Source dialog enabled
}
@ -123,8 +137,13 @@ public class AutopsyTestCases {
}
public void testStartAddLogicalFilesDataSource() {
/*
* This time out is to give time for creating case database and opening solr index
*/
new Timeout("pausing", 120000).sleep();
logger.info("Starting Add Logical Files process");
WizardOperator wo = new WizardOperator("Add Data Source");
wo.setTimeouts(timeouts);
while(!wo.btNext().isEnabled()){
new Timeout("pausing", 1000).sleep(); // give it a second till the Add Data Source dialog enabled
}