diff options
| author | Tom Forbes <tom@tomforb.es> | 2018-10-25 18:52:29 +0100 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2018-11-03 09:56:14 -0400 |
| commit | d207ac1568bb4dee305f6692ed7ddee8a1ff8b99 (patch) | |
| tree | cfae8b06b55ba09b35d92ae890f2b2e23b12675e /tests | |
| parent | 5a2dd5ec5330938e9afb77faf6ca89abf39c018c (diff) | |
Fixed #29883 -- Added selenium hub support to runtests.py.
Diffstat (limited to 'tests')
| -rwxr-xr-x | tests/runtests.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/runtests.py b/tests/runtests.py index 88971f43a1..a410777203 100755 --- a/tests/runtests.py +++ b/tests/runtests.py @@ -4,6 +4,7 @@ import atexit import copy import os import shutil +import socket import subprocess import sys import tempfile @@ -437,6 +438,15 @@ if __name__ == "__main__": help='A comma-separated list of browsers to run the Selenium tests against.', ) parser.add_argument( + '--selenium-hub', + help='A URL for a selenium hub instance to use in combination with --selenium.', + ) + parser.add_argument( + '--external-host', default=socket.gethostname(), + help='The external host that can be reached by the selenium hub instance when running Selenium ' + 'tests via Selenium Hub.', + ) + parser.add_argument( '--debug-sql', action='store_true', help='Turn on the SQL query logger within tests.', ) @@ -456,6 +466,12 @@ if __name__ == "__main__": options = parser.parse_args() + using_selenium_hub = options.selenium and options.selenium_hub + if options.selenium_hub and not options.selenium: + parser.error('--selenium-hub and --external-host require --selenium to be used.') + if using_selenium_hub and not options.external_host: + parser.error('--selenium-hub and --external-host must be used together.') + # Allow including a trailing slash on app_labels for tab completion convenience options.modules = [os.path.normpath(labels) for labels in options.modules] @@ -470,6 +486,9 @@ if __name__ == "__main__": options.tags = ['selenium'] elif 'selenium' not in options.tags: options.tags.append('selenium') + if options.selenium_hub: + SeleniumTestCaseBase.selenium_hub = options.selenium_hub + SeleniumTestCaseBase.external_host = options.external_host SeleniumTestCaseBase.browsers = options.selenium if options.bisect: |
