Ensure Selenium is started only when it's needed.

This commit is contained in:
Akshay Joshi 2019-07-17 15:38:14 +01:00 committed by Dave Page
parent 8168f623c4
commit d78dfbd30f

View File

@ -20,12 +20,6 @@ import sys
import traceback
import json
import random
import flask
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
import unittest
@ -201,8 +195,14 @@ def get_test_modules(arguments):
exclude_pkgs += arguments['exclude'].split(',')
if 'feature_tests' not in exclude_pkgs and \
(arguments['pkg'] == "all" or
(arguments['pkg'] is None or arguments['pkg'] == "all" or
arguments['pkg'] == "feature_tests"):
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.desired_capabilities import \
DesiredCapabilities
default_browser = 'chrome'
# Check default browser provided through command line. If provided