1515from selenium .common .exceptions import WebDriverException
1616
1717class bcolors :
18- HEADER = '\033 [95m'
19- OKBLUE = '\033 [94m'
20- OKGREEN = '\033 [92m'
21- WARNING = '\033 [93m'
22- FAIL = '\033 [91m'
23- ENDC = '\033 [0m'
24- BOLD = '\033 [1m'
25- UNDERLINE = '\033 [4m'
18+ HEADER = '\033 [95m'
19+ OKBLUE = '\033 [94m'
20+ OKGREEN = '\033 [92m'
21+ WARNING = '\033 [93m'
22+ FAIL = '\033 [91m'
23+ ENDC = '\033 [0m'
24+ BOLD = '\033 [1m'
25+ UNDERLINE = '\033 [4m'
2626
2727chromeOps = webdriver .ChromeOptions ()
2828chromeOps .add_extension (sys .argv [1 ])
@@ -31,23 +31,23 @@ class bcolors:
3131chromdriver_path = "chromedriver"
3232
3333if 'TRAVIS' in os .environ :
34- chromeOps .add_argument ('--no-sandbox' )
35- chromdriver_path = os .path .abspath ("test/chromium/chromedriver" )
34+ chromeOps .add_argument ('--no-sandbox' )
35+ chromdriver_path = os .path .abspath ("test/chromium/chromedriver" )
3636
3737# First argument is optional, if not specified will search path.
3838
3939try :
40- driver = webdriver .Chrome (chromdriver_path , chrome_options = chromeOps )
40+ driver = webdriver .Chrome (chromdriver_path , chrome_options = chromeOps )
4141except WebDriverException as e :
42- error = e .__str__ ()
42+ error = e .__str__ ()
4343
44- if "executable needs to be in PATH" in e .__str__ ():
45- print "ChromeDriver isn't installed. Check test/chrome/README.md\
44+ if "executable needs to be in PATH" in e .__str__ ():
45+ print "ChromeDriver isn't installed. Check test/chrome/README.md\
4646 for instructions on how to install ChromeDriver"
4747
48- sys .exit (2 )
49- else :
50- raise e
48+ sys .exit (2 )
49+ else :
50+ raise e
5151
5252print '' #New line
5353
@@ -56,10 +56,10 @@ class bcolors:
5656#Page Loaded
5757
5858if driver .current_url .startswith ('https' ):
59- print bcolors .OKGREEN + "HTTP to HTTPS redirection successful" + bcolors .ENDC
59+ print bcolors .OKGREEN + "HTTP to HTTPS redirection successful" + bcolors .ENDC
6060elif driver .current_url .startswith ('http' ):
61- print bcolors .FAIL + "HTTP to HTTPS redirection failed" + bcolors .ENDC
62- sys .exit (1 )
61+ print bcolors .FAIL + "HTTP to HTTPS redirection failed" + bcolors .ENDC
62+ sys .exit (1 )
6363
6464print '' #New line
6565
0 commit comments