Commit c3887b0b by Ben Patterson

Fix lettuce tests for Xenial compatibility and newer Chrome version.

parent e6e32d79
...@@ -279,10 +279,9 @@ def after_each_step(step): ...@@ -279,10 +279,9 @@ def after_each_step(step):
@after.harvest @after.harvest
def teardown_browser(total): def saucelabs_status(total):
""" """
Quit the browser after executing the tests. Collect data for saucelabs.
""" """
if world.LETTUCE_SELENIUM_CLIENT == 'saucelabs': if world.LETTUCE_SELENIUM_CLIENT == 'saucelabs':
set_saucelabs_job_status(world.jobid, total.scenarios_ran == total.scenarios_passed) set_saucelabs_job_status(world.jobid, total.scenarios_ran == total.scenarios_passed)
world.browser.quit()
...@@ -56,12 +56,19 @@ def stop_video_server(_total): ...@@ -56,12 +56,19 @@ def stop_video_server(_total):
video_server.shutdown() video_server.shutdown()
@before.all
def start_stub_servers():
"""
Start all stub servers
"""
for stub in SERVICES.keys():
start_stub(stub)
@before.each_scenario # pylint: disable=no-member @before.each_scenario # pylint: disable=no-member
def process_requires_tags(scenario): def skip_youtube_if_not_available(scenario):
""" """
Process the scenario tags to make sure that any
requirements are met prior to that scenario
being executed.
Scenario tags must be named with this convention: Scenario tags must be named with this convention:
@requires_stub_bar, where 'bar' is the name of the stub service to start @requires_stub_bar, where 'bar' is the name of the stub service to start
...@@ -85,7 +92,7 @@ def process_requires_tags(scenario): ...@@ -85,7 +92,7 @@ def process_requires_tags(scenario):
scenario.steps = [] scenario.steps = []
return return
start_stub(requires.group('server')) return
def start_stub(name): def start_stub(name):
...@@ -124,11 +131,13 @@ def is_youtube_available(urls): ...@@ -124,11 +131,13 @@ def is_youtube_available(urls):
return True return True
@after.each_scenario # pylint: disable=no-member @after.all # pylint: disable=no-member
def stop_stubs(_scenario): def stop_stubs(_scenario):
""" """
Shut down any stub services that were started up for the scenario. Shut down any stub services.
""" """
# close browser to ensure no open connections to the stub servers
world.browser.quit()
for name in SERVICES.keys(): for name in SERVICES.keys():
stub_server = getattr(world, name, None) stub_server = getattr(world, name, None)
if stub_server is not None: if stub_server is not None:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment