Refs #29883 -- Removed runtests.py's dependency on selenium.

Regression in d207ac1568.
This commit is contained in:
Tim Graham 2018-11-03 18:49:51 -04:00
parent 6b7f1c2530
commit 1c948e544e
1 changed files with 2 additions and 3 deletions

View File

@ -2,9 +2,6 @@ import sys
import unittest import unittest
from contextlib import contextmanager from contextlib import contextmanager
from selenium import webdriver
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
from django.test import LiveServerTestCase, tag from django.test import LiveServerTestCase, tag
from django.utils.decorators import classproperty from django.utils.decorators import classproperty
from django.utils.module_loading import import_string from django.utils.module_loading import import_string
@ -67,10 +64,12 @@ class SeleniumTestCaseBase(type(LiveServerTestCase)):
@classmethod @classmethod
def get_capability(cls, browser): def get_capability(cls, browser):
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
return getattr(DesiredCapabilities, browser.upper()) return getattr(DesiredCapabilities, browser.upper())
def create_webdriver(self): def create_webdriver(self):
if self.selenium_hub: if self.selenium_hub:
from selenium import webdriver
return webdriver.Remote( return webdriver.Remote(
command_executor=self.selenium_hub, command_executor=self.selenium_hub,
desired_capabilities=self.get_capability(self.browser), desired_capabilities=self.get_capability(self.browser),