Skip to content

Commit aaf4931

Browse files
committed
Add Mac OS X support to Chromium Testing
1 parent 37f74f9 commit aaf4931

2 files changed

Lines changed: 12 additions & 4 deletions

File tree

install-dev-dependencies.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ if type apt-get >/dev/null ; then
1515
chromium-chromedriver
1616
elif type brew >/dev/null ; then
1717
brew list python &>/dev/null || brew install python
18-
brew install libxml2 gnu-sed
18+
brew install libxml2 gnu-sed chromedriver
1919
if ! echo $PATH | grep -ql /usr/local/bin ; then
2020
echo '/usr/local/bin not found in $PATH, please add it.'
2121
fi

test/chrome/script.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,14 @@
1818
from selenium.webdriver.common.by import By
1919
from selenium.common.exceptions import WebDriverException
2020

21+
if system.platform.startswith("linux"):
22+
chromedriver_path = "/usr/lib/chromium-browser/chromedriver"
23+
elif system.platform.startswith("darwin"):
24+
chromedriver_path = "chromedriver"
25+
else:
26+
print "Unsupported Operating System"
27+
sys.exit(3)
28+
2129
class bcolors:
2230
HEADER = '\033[95m'
2331
OKBLUE = '\033[94m'
@@ -34,7 +42,7 @@ class bcolors:
3442
# First argument is optional, if not specified will search path.
3543

3644
try:
37-
driver = webdriver.Chrome('/usr/lib/chromium-browser/chromedriver', chrome_options = chromeOps)
45+
driver = webdriver.Chrome(chromedriver_path, chrome_options = chromeOps)
3846
except WebDriverException as e:
3947
error = e.__str__()
4048

@@ -50,9 +58,9 @@ class bcolors:
5058

5159
#Page Loaded
5260

53-
if driver.current_url.startswith('httaps'):
61+
if driver.current_url.startswith('https'):
5462
print bcolors.OKGREEN + "HTTP to HTTPS redirection successful" + bcolors.ENDC
55-
elif(driver.current_url.startswith('https')):
63+
elif(driver.current_url.startswith('http')):
5664
print bcolors.FAIL + "HTTP to HTTPS redirection failed" + bcolors.ENDC
5765
sys.exit(1)
5866

0 commit comments

Comments
 (0)