Example #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
Example #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
Example #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,
    })
Example #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,
    })