Skip to content
Permalink
Browse files

Merge pull request #1491 from Maffooch/dev

Fix Trufflehog and change dedupe test file path
  • Loading branch information...
devGregA committed Aug 14, 2019
2 parents 37aacbb + 7ba763a commit 2a2dfc53b0cd463a6b6111d08f4855bcbda4d047
Showing with 13 additions and 9 deletions.
  1. +4 −1 dojo/tools/trufflehog/parser.py
  2. +9 −8 tests/dedupe_unit_test.py
@@ -69,7 +69,10 @@ def __init__(self, filename, test):

def parse_json(self, json_output):
try:
json_data = json.loads(json_output)
try:
json_data = json.loads(str(json_output, 'utf-8'))
except:
json_data = json.loads(json_output)
except ValueError:
raise Exception("Invalid format")

@@ -29,6 +29,7 @@ def setUp(self):
self.base_url = "http://localhost:8000/"
self.verificationErrors = []
self.accept_next_alert = True
self.relative_path = dir_path = os.path.dirname(os.path.realpath(__file__))

def login_page(self):
driver = self.driver
@@ -105,7 +106,7 @@ def test_import_path_tests(self):
driver.find_element_by_link_text("Re-Upload Scan").click()
driver.find_element_by_xpath('//*[@id="base-content"]/form/div[3]/div/div').click()
driver.find_element_by_xpath('//*[@id="base-content"]/form/div[4]/div/div').click()
driver.find_element_by_id('id_file').send_keys("/Users/codymaffucci/Desktop/dedupe/tests/dedupe_scans/dedupe_path_1.json")
driver.find_element_by_id('id_file').send_keys(self.relative_path + "/dedupe_scans/dedupe_path_1.json")
driver.find_element_by_css_selector("input.btn.btn-primary").click()
# Second test
driver.get(self.base_url + "engagement")
@@ -115,7 +116,7 @@ def test_import_path_tests(self):
driver.find_element_by_link_text("Re-Upload Scan").click()
driver.find_element_by_xpath('//*[@id="base-content"]/form/div[3]/div/div').click()
driver.find_element_by_xpath('//*[@id="base-content"]/form/div[4]/div/div').click()
driver.find_element_by_id('id_file').send_keys("/Users/codymaffucci/Desktop/dedupe/tests/dedupe_scans/dedupe_path_2.json")
driver.find_element_by_id('id_file').send_keys(self.relative_path + "/dedupe_scans/dedupe_path_2.json")
driver.find_element_by_css_selector("input.btn.btn-primary").click()

def test_check_path_status(self):
@@ -168,7 +169,7 @@ def test_import_endpoint_tests(self):
driver.find_element_by_link_text("Re-Upload Scan").click()
driver.find_element_by_xpath('//*[@id="base-content"]/form/div[3]/div/div').click()
driver.find_element_by_xpath('//*[@id="base-content"]/form/div[4]/div/div').click()
driver.find_element_by_id('id_file').send_keys("/Users/codymaffucci/Desktop/dedupe/tests/dedupe_scans/dedupe_endpoint_1.xml")
driver.find_element_by_id('id_file').send_keys(self.relative_path + "/dedupe_scans/dedupe_endpoint_1.xml")
driver.find_element_by_css_selector("input.btn.btn-primary").click()
# Second test
driver.get(self.base_url + "engagement")
@@ -178,7 +179,7 @@ def test_import_endpoint_tests(self):
driver.find_element_by_link_text("Re-Upload Scan").click()
driver.find_element_by_xpath('//*[@id="base-content"]/form/div[3]/div/div').click()
driver.find_element_by_xpath('//*[@id="base-content"]/form/div[4]/div/div').click()
driver.find_element_by_id('id_file').send_keys("/Users/codymaffucci/Desktop/dedupe/tests/dedupe_scans/dedupe_endpoint_2.xml")
driver.find_element_by_id('id_file').send_keys(self.relative_path + "/dedupe_scans/dedupe_endpoint_2.xml")
driver.find_element_by_css_selector("input.btn.btn-primary").click()

def test_check_endpoint_status(self):
@@ -231,7 +232,7 @@ def test_import_same_eng_tests(self):
driver.find_element_by_link_text("Re-Upload Scan").click()
driver.find_element_by_xpath('//*[@id="base-content"]/form/div[3]/div/div').click()
driver.find_element_by_xpath('//*[@id="base-content"]/form/div[4]/div/div').click()
driver.find_element_by_id('id_file').send_keys("/Users/codymaffucci/Desktop/dedupe/tests/dedupe_scans/dedupe_endpoint_1.xml")
driver.find_element_by_id('id_file').send_keys(self.relative_path + "/dedupe_scans/dedupe_endpoint_1.xml")
driver.find_element_by_css_selector("input.btn.btn-primary").click()
# Second test
driver.get(self.base_url + "engagement")
@@ -241,7 +242,7 @@ def test_import_same_eng_tests(self):
driver.find_element_by_link_text("Re-Upload Scan").click()
driver.find_element_by_xpath('//*[@id="base-content"]/form/div[3]/div/div').click()
driver.find_element_by_xpath('//*[@id="base-content"]/form/div[4]/div/div').click()
driver.find_element_by_id('id_file').send_keys("/Users/codymaffucci/Desktop/dedupe/tests/dedupe_scans/dedupe_cross_1.csv")
driver.find_element_by_id('id_file').send_keys(self.relative_path + "/dedupe_scans/dedupe_cross_1.csv")
driver.find_element_by_css_selector("input.btn.btn-primary").click()

def test_check_same_eng_status(self):
@@ -303,7 +304,7 @@ def test_import_cross_test(self):
driver.find_element_by_link_text("Re-Upload Scan Results").click()
driver.find_element_by_xpath('//*[@id="base-content"]/form/div[3]/div/div').click()
driver.find_element_by_xpath('//*[@id="base-content"]/form/div[4]/div/div').click()
driver.find_element_by_id('id_file').send_keys("/Users/codymaffucci/Desktop/dedupe/tests/dedupe_scans/dedupe_endpoint_1.xml")
driver.find_element_by_id('id_file').send_keys(self.relative_path + "/dedupe_scans/dedupe_endpoint_1.xml")
driver.find_element_by_css_selector("input.btn.btn-primary").click()
# Second test
driver.get(self.base_url + "engagement")
@@ -313,7 +314,7 @@ def test_import_cross_test(self):
driver.find_element_by_link_text("Re-Upload Scan Results").click()
driver.find_element_by_xpath('//*[@id="base-content"]/form/div[3]/div/div').click()
driver.find_element_by_xpath('//*[@id="base-content"]/form/div[4]/div/div').click()
driver.find_element_by_id('id_file').send_keys("/Users/codymaffucci/Desktop/dedupe/tests/dedupe_scans/dedupe_cross_1.csv")
driver.find_element_by_id('id_file').send_keys(self.relative_path + "/dedupe_scans/dedupe_cross_1.csv")
driver.find_element_by_css_selector("input.btn.btn-primary").click()

def test_check_cross_status(self):

0 comments on commit 2a2dfc5

Please sign in to comment.
You can’t perform that action at this time.