def step_impl(context): util = context.util term = util.find_elements((By.CLASS_NAME, "term"))[-1] size = dict(context.initial_window_size) while util.visible_to_user(term, ".wed-caret-layer"): size["height"] -= 15 wedutil.set_window_size(util, size["width"], size["height"])
def after_scenario(context, _scenario): driver = context.driver util = context.util # # Make sure we did not trip a fatal error. # with util.local_timeout(0.5): assert_raises(TimeoutException, util.find_element, (By.CLASS_NAME, "wed-fatal-modal")) window_size = driver.get_window_size() if window_size != context.before_scenario_window_size: wedutil.set_window_size(util, context.before_scenario_window_size["width"], context.before_scenario_window_size["height"])
def after_scenario(context, _scenario): driver = context.driver util = context.util window_size = driver.get_window_size() if window_size != context.before_scenario_window_size: wedutil.set_window_size( util, context.before_scenario_window_size["width"], context.before_scenario_window_size["height"] ) # If the scenario ends on an editor window, we want to move away # from it NOW so that the next scenario does not trigger the alert # about moving away. if driver.execute_script("return window.wed_editor !== undefined;"): driver.get(context.selenic_config.SERVER + "/lexicography") alert = driver.switch_to_alert() alert.accept()
def step_impl(context): util = context.util wedutil.set_window_size(util, 683, 500)
def step_impl(context): util = context.util wedutil.set_window_size(util, 683, 741)