示例#1
0
def test_height_width_larger_than_max(session):
    screen_width, screen_height = screen_size(session)
    avail_width, avail_height = available_screen_size(session)

    response = set_window_rect(session, {
        "width": screen_width + 100,
        "height": screen_height + 100
    })
    rect = assert_success(response)
    assert rect["width"] >= avail_width
    assert rect["height"] >= avail_height
示例#2
0
def test_height_width_larger_than_max(session):
    screen_width, screen_height = screen_size(session)
    avail_width, avail_height = available_screen_size(session)

    response = set_window_rect(session, {
        "width": screen_width + 100,
        "height": screen_height + 100
    })
    rect = assert_success(response)
    assert rect["width"] >= avail_width
    assert rect["height"] >= avail_height
示例#3
0
def test_height_width(session):
    # The window position might be auto-adjusted by the browser
    # if it exceeds the lower right corner. As such ensure that
    # there is enough space left so no window move will occur.
    session.window.position = (50, 50)

    original = session.window.rect
    screen_width, screen_height = screen_size(session)

    response = set_window_rect(session, {
        "width": screen_width - 100,
        "height": screen_height - 100
    })
    assert_success(response, {
        "x": original["x"],
        "y": original["y"],
        "width": screen_width - 100,
        "height": screen_height - 100,
    })
示例#4
0
def test_height_width(session):
    # The window position might be auto-adjusted by the browser
    # if it exceeds the lower right corner. As such ensure that
    # there is enough space left so no window move will occur.
    session.window.position = (50, 50)

    original = session.window.rect
    screen_width, screen_height = screen_size(session)

    response = set_window_rect(session, {
        "width": screen_width - 100,
        "height": screen_height - 100
    })
    assert_success(response, {
        "x": original["x"],
        "y": original["y"],
        "width": screen_width - 100,
        "height": screen_height - 100,
    })