Merge "Use headless option for cors functional test runner"
This commit is contained in:
commit
1fad8c2ed5
@ -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)):
|
||||
|
@ -9,7 +9,7 @@
|
||||
|
||||
- name: Run CORS tests
|
||||
shell: >
|
||||
xvfb-run python
|
||||
python
|
||||
{{ ansible_env.HOME }}/{{ zuul.project.src_dir }}/test/cors/main.py
|
||||
--output {{ ansible_env.HOME }}/cors-test-results.txt
|
||||
all
|
||||
|
Loading…
x
Reference in New Issue
Block a user