Updated regression test, now will check reports

This commit is contained in:
Sean-M 2013-02-12 14:36:29 -05:00
parent 47256dd128
commit bfba3dbe18
2 changed files with 9 additions and 18 deletions

View File

@ -397,7 +397,7 @@ def run_config_test(config_file):
# Runs the test on the single given file.
# The path must be guarenteed to be a correct path.
def run_test(image_file, count):
if not image_type(image_file) != IMGTYPE.UNKNOWN:
if image_type(image_file) == IMGTYPE.UNKNOWN:
printerror("Error: Image type is unrecognized:")
printerror(image_file + "\n")
return
@ -627,18 +627,17 @@ def compare_to_gold_db():
# Using the global case's variables, compare the html report file made by
# the regression test against the gold standard html report
def compare_to_gold_html():
gold_html_file = make_local_path(case.gold, case.image_name, "index.html")
gold_html_file = make_local_path(case.gold, case.image_name, "Report", "index.html")
htmlfolder = ""
for fs in os.listdir(os.path.join(os.getcwd(),case.output_dir, case.image_name, "AutopsyTestCase", "Reports")):
if os.path.isdir(os.path.join(os.getcwd(), case.output_dir, case.image_name, "AutopsyTestCase", "Reports", fs)):
htmlfolder = fs
autopsy_html_path = make_local_path(case.output_dir, case.image_name, "AutopsyTestCase", "Reports", htmlfolder) #, "AutopsyTestCase", "Reports", htmlfolder)
autopsy_html_path = make_local_path(case.output_dir, case.image_name, "AutopsyTestCase", "Reports", htmlfolder, "HTML Report") #, "AutopsyTestCase", "Reports", htmlfolder)
print(autopsy_html_path)
try:
autopsy_html_file = get_file_in_dir(autopsy_html_path, "index.html")
if not file_exists(gold_html_file):
printerror("Error: No gold html report exists at:")
printerror(gold_html_file + "\n")

View File

@ -278,28 +278,20 @@ public class RegressionTest extends TestCase{
}
public void testGenerateReportButton() throws IOException {
FileWriter outp = new FileWriter("log.txt");
outp.write("got to 282\n");
outp.flush();
logger.info("Generate Report Button");
JDialog reportDialog = JDialogOperator.waitJDialog("Report", false, false);
JDialog reportDialog = JDialogOperator.waitJDialog("Generate Report", false, false);
JDialogOperator reportDialogOperator = new JDialogOperator(reportDialog);
JButtonOperator jbo0 = new JButtonOperator(reportDialogOperator, "Next");
DateFormat dateFormat = new SimpleDateFormat("MM-dd-yyyy-HH-mm-ss");
Date date = new Date();
String datenotime = dateFormat.format(date);
jbo0.pushNoBlock();
outp.write("got to 292\n");
outp.flush();
JDialog reportDialog1 = JDialogOperator.waitJDialog("HTML", false, false);
outp.write("got to 295\n");
outp.flush();
JDialogOperator reportDialogOperator1 = new JDialogOperator(reportDialog1);
JButtonOperator jbo1 = new JButtonOperator(reportDialogOperator1, "Finish");
new Timeout("pausing", 1000).sleep();
JButtonOperator jbo1 = new JButtonOperator(reportDialogOperator, "Finish");
jbo1.pushNoBlock();
new Timeout("pausing", 3000).sleep(); // Give it a few seconds to generate
screenshot("Finished Report");
JDialog previewDialog = JDialogOperator.waitJDialog("Report Preview", false, false);
new Timeout("pausing", 8000).sleep(); // Give it a few seconds to generate
screenshot("Progress");
JDialog previewDialog = JDialogOperator.waitJDialog("Progress", false, false);
JDialogOperator previewDialogOperator = new JDialogOperator(previewDialog);
JButtonOperator jbo2 = new JButtonOperator(previewDialogOperator, "Close");
jbo2.pushNoBlock();