From d207ac1568bb4dee305f6692ed7ddee8a1ff8b99 Mon Sep 17 00:00:00 2001 From: Tom Forbes Date: Thu, 25 Oct 2018 18:52:29 +0100 Subject: Fixed #29883 -- Added selenium hub support to runtests.py. --- tests/runtests.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'tests') 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 @@ -436,6 +437,15 @@ if __name__ == "__main__": '--selenium', action=ActionSelenium, metavar='BROWSERS', 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: -- cgit v1.3