def test_background_steps(): world.current_number = 0 @step('add one') def add_one(step): world.current_number += 1 @step('current number should be "(.*)"') def check_number(step, check_number): assert str(world.current_number) == check_number feature = Feature.from_string(FEATURE10) feature_result = feature.run() world.spew('current_number') assert feature_result.passed
def hook_ensure_screenshot_after_step(step): """ Makes sure a screen shot is taken in Saucelabs after each test step. If the step passed leave it on the sever, if it failed we want a copy. """ from .. import Driver try: wd = Driver.instance(step) if step.failed: on_fail(wd) else: on_pass(wd) finally: world.spew('step_name')
def teardown_scenario(*args, **kwargs): if hasattr(world, 'volume'): try: world.volume.destroy(force=True, remove_disks=True) except: print sys.exc_info() world.spew('volume') world.spew('new_volume') if hasattr(world, 'tmp_mount_dir'): if os.path.exists(world.tmp_mount_dir): try: os.rmdir(world.tmp_mount_dir) except: print sys.exc_info()
def run_single(index, browser, server, lettuce): """ :param index: int :param browser: dict :param server: dict :param lettuce: dict """ fattoush_config = FattoushConfig(index=index, browser=browser, server=server, lettuce=lettuce) world.absorb(fattoush_config, 'fattoush') try: result = fattoush_config.run() return result finally: world.spew('fattoush')
def teardown_scenario(*args, **kwargs): for vol in ('volume', 'bigger_vol'): if hasattr(world, vol): LOG.info('Removing %s' % vol) try: v = getattr(world, vol) v.destroy(force=True, remove_disks=True) except: pass world.spew(vol) if hasattr(world, 'tmp_mount_dir'): try: os.rmdir(world.tmp_mount_dir) except: pass global_artifacts = dict(unnecessary=[], other=[])
def clear_data(scenario): world.spew('scenario_dict')
def clear_data(scenario): """ Clean out the dict of scenario variables """ world.spew('scenario_dict')
def clear_data(scenario): world.spew("scenario_dict")