summaryrefslogtreecommitdiff
path: root/test/cors/main.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/cors/main.py')
-rwxr-xr-xtest/cors/main.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/test/cors/main.py b/test/cors/main.py
index 8f4314d9f..5da06ae68 100755
--- a/test/cors/main.py
+++ b/test/cors/main.py
@@ -180,9 +180,19 @@ def run(args, url):
browsers = list(ALL_BROWSERS) if 'all' in args.browsers else args.browsers
ran_one = False
for browser_name in browsers:
+ kwargs = {}
+ try:
+ options = getattr(
+ selenium.webdriver, browser_name.title() + 'Options')()
+ options.headless = True
+ kwargs['options'] = options
+ except AttributeError:
+ # not all browser types have Options class
+ pass
+
driver = getattr(selenium.webdriver, browser_name.title())
try:
- browser = driver()
+ browser = driver(**kwargs)
except Exception as e:
if not ('needs to be in PATH' in str(e) or
'SafariDriver was not found' in str(e)):