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

View File

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