Closed xsoft7 closed 7 months ago
update:
it seems that the issue happens strictly when The monitor resolution is >= viewport_size
to reproduce - if your monitor resolution is 1920X1080, set the viewport size for example 2560X2000
you will see cut items and cannot manually scale down the browser window to see them
I found a quick override- set viewport resolution to about 5% smaller than it is - so in my example, if my monitor is FHD - I set the viewport resolution to 1900X1000
Can u assign me this task
@xsoft7 This seems to work as intended - when viewport does not fit your screen, you do not see some parts of the web page.
If you still believe this is a bug in Playwright, please follow the issue template and provide a self-contained repro that we can run locally. Unfortunately, I cannot run your code snippet - it does not even have imports.
Version
1.41.0
Steps to reproduce
update:
it seems that the issue happens strictly when The monitor resolution is >= viewport_size
to reproduce - if your resolution is 1920X1080, set the viewport size for example 2560X2000
you will see cut items and cannot manually scale down the browser window to see them
I found a quick overide- set viewport resolution to about 5% smaller that its is - so in my example, if my monitor is FHD - I set the viewport resolution to 1900X1000
conftest.py
@pytest.fixture(scope="session") def browser_context_args(browser_context_args, video_path): size = {"width": 1920, "height": 1080} return { browser_context_args, "record_video_dir": "./debug/videos/", "viewport": size,** 'record_video_size': size, }
@pytest.fixture def page(context: BrowserContext, base_url: str) -> Generator[Page, None, None]: page = context.new_page() page._goto = page.goto # type: ignore page.goto = lambda *args, **kwargs: _handle_page_goto( # type: ignore page, list(args), kwargs, base_url ) yield page
save off the test unique id
Expected behavior
to display content
Actual behavior
content is not displayed, the "save/cancel button"
Additional context
In a conftest.py as shown above, I have that custom fixture.
Thing is, when I enable the "viewport" in the dictionary, I lose some buttons.
When I remove "viewport", the buttons appear but the video recording is not full screen (per resolution I've set, there's like 1/4 of the screen.).
viewport enabled- no buttons, video recording is good
viewport option is commented out - buttons are present, video recording is trimmed|
The video is not full screen/doesnt apply the set resolution (viewport is commented out)
Environment