Support running feature tests against Firefox. Fixes #3270

This commit is contained in:
Akshay Joshi authored and Dave Page committed 2018-05-15 15:10:11 +01:00
1 parent 8d9e9eab13
commit ccf58570b1
9 files changed
+104 -15

No files matched your search

+21 -4
View File
@@ -12,6 +12,7 @@ import signal
import random
import time
from selenium.common.exceptions import WebDriverException
class AppStarter:
@@ -41,10 +42,26 @@ class AppStarter:
env=env
)
self.driver.get(
"http://" + self.app_config.DEFAULT_SERVER + ":" +
random_server_port
)
def launch_browser(retry_count):
try:
self.driver.get(
"http://" + self.app_config.DEFAULT_SERVER + ":" +
random_server_port
)
except WebDriverException as e:
# In case of WebDriverException sleep for 1 second and retry
# again. Retry 10 times and if still app will not start then
# raise exception.
time.sleep(1)
if retry_count < 60:
retry_count = retry_count + 1
launch_browser(retry_count)
else:
raise Exception('Unable to start python server even after '
'retrying 60 times.')
launch_browser(0)
def stop_app(self):
""" This function stop the started app by killing process """