1
0
mirror of https://github.com/elisspace/autopsy.git synced 2026-09-06 02:24:30 +00:00
This commit is contained in:
adam-m
2013-02-12 15:30:30 -05:00
2 changed files with 20 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)
print autopsy_html_path
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")
@@ -1262,7 +1261,7 @@ def vsBuild():
vs.append("/p:configuration=release")
vs.append("/p:platform=win32")
vs.append("/t:rebuild")
print vs
print(vs)
subprocess.call(vs)
@@ -1563,4 +1562,4 @@ if __name__ == "__main__":
if SYS is OS.WIN or SYS is OS.CYGWIN:
main()
else:
print("We only support Windows and Cygwin at this time.")
print("We only support Windows and Cygwin at this time.")

View File

@@ -24,6 +24,7 @@ import java.awt.Robot;
import java.awt.Toolkit;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
@@ -35,7 +36,6 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import javax.imageio.ImageIO;
import javax.swing.JDialog;
import javax.swing.JTabbedPane;
import javax.swing.JTextField;
import junit.framework.Test;
import junit.framework.TestCase;
@@ -116,10 +116,10 @@ public class RegressionTest extends TestCase{
logger.info("New Case");
NbDialogOperator nbdo = new NbDialogOperator("Welcome");
JButtonOperator jbo = new JButtonOperator(nbdo, 0); // the "New Case" button
jbo.clickMouse();
jbo.pushNoBlock();
}
public void testNewCaseWizard() {
public void testNewCaseWizard(){
logger.info("New Case Wizard");
WizardOperator wo = new WizardOperator("New Case Information");
JTextFieldOperator jtfo1 = new JTextFieldOperator(wo, 1);
@@ -277,21 +277,24 @@ public class RegressionTest extends TestCase{
new Timeout("pausing", 1000).sleep();
}
public void testGenerateReportButton() {
public void testGenerateReportButton() throws IOException {
logger.info("Generate Report Button");
JDialog reportDialog = JDialogOperator.waitJDialog("Generate Report", false, false);
JDialogOperator reportDialogOperator = new JDialogOperator(reportDialog);
JButtonOperator jbo0 = new JButtonOperator(reportDialogOperator, "Generate Report");
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();
new Timeout("pausing", 3000).sleep(); // Give it a few seconds to generate
screenshot("Finished Report");
JDialog previewDialog = JDialogOperator.waitJDialog("Report Preview", false, false);
JDialogOperator previewDialogOperator = new JDialogOperator(previewDialog);
JButtonOperator jbo1 = new JButtonOperator(previewDialogOperator, "Close");
jbo0.pushNoBlock();
new Timeout("pausing", 1000).sleep();
JButtonOperator jbo1 = new JButtonOperator(reportDialogOperator, "Finish");
jbo1.pushNoBlock();
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();
new Timeout("pausing", 3000).sleep(); // Give the program a second to idle to be safe
System.setProperty("ReportStr", datenotime);
screenshot("Done Testing");