Пример #1
0
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"])
Пример #2
0
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"])
Пример #3
0
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"])
Пример #4
0
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()
Пример #5
0
def step_impl(context):
    util = context.util
    wedutil.set_window_size(util, 683, 500)
Пример #6
0
def step_impl(context):
    util = context.util
    wedutil.set_window_size(util, 683, 741)