Skip to content

Commit a66b64c

Browse files
committed
Close driver on failure too, misspelling fix.
Signed-off-by: Nick Semenkovich <semenko@alum.mit.edu>
1 parent 7b6909b commit a66b64c

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

test/chromium/script.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,16 @@ class bcolors:
2828
chromeOps.add_extension(sys.argv[1])
2929
chromeOps.add_argument("--disable-setuid-sandbox")
3030

31-
chromdriver_path = "chromedriver"
31+
chromedriver_path = "chromedriver"
3232

3333
if 'TRAVIS' in os.environ:
3434
chromeOps.add_argument('--no-sandbox')
35-
chromdriver_path = os.path.abspath("test/chromium/chromedriver")
35+
chromedriver_path = os.path.abspath("test/chromium/chromedriver")
3636

3737
# First argument is optional, if not specified will search path.
3838

3939
try:
40-
driver = webdriver.Chrome(chromdriver_path, chrome_options=chromeOps)
40+
driver = webdriver.Chrome(chromedriver_path, chrome_options=chromeOps)
4141
except WebDriverException as e:
4242
error = e.__str__()
4343

@@ -55,12 +55,18 @@ class bcolors:
5555

5656
#Page Loaded
5757

58+
failed = False
5859
if driver.current_url.startswith('https'):
5960
print bcolors.OKGREEN + "HTTP to HTTPS redirection successful" + bcolors.ENDC
6061
elif driver.current_url.startswith('http'):
6162
print bcolors.FAIL + "HTTP to HTTPS redirection failed" + bcolors.ENDC
63+
failed = True
6264
sys.exit(1)
6365

6466
print '' #New line
6567

6668
driver.quit()
69+
70+
71+
if failed:
72+
sys.exit(1)

0 commit comments

Comments
 (0)