![]() ![]() ![]() Having the window change size interrupt the dev experience.ĭisabling the feature would be great! but also giving access to the dev tools protocol window bounds API could help. In dev mode I run my IDE on one window and the browser (viewport + dev tools) on the other. Working with the browser open allows me to run code and debug it directly in the browser while still having the great external control and information that Playwright provides. While I provide async access to the Playwright API only to mimic user actions, collect external information or save snapshots ( click example). Running in the browser, allows tests to have direct sync access to the document with each test easily setting up and tearing down its own fixture. I chose to run my entire suit of tests in a single context/page because it's much faster and easier to test and debug. ![]() Giving control over the window size and viewport size would really help building maintainable tests for libraries, applications and websites resize behavior. There is no API to control the window size (although it exist under the devTools protocol: setWindowBounds, getWindowBounds).It is also not consistent across browsers (Chromium changes size and if the dev tools are open it might minimize to hide the viewport while Firefox only changes the viewport and doesn't change the window), it would be nice to maybe add a flag to prevent changing the window size. changing the viewport size also triggers a change to the window size - that makes it hard to run multiple tests under the same window and removes the nice benefit that the separation of window & viewport sizes gives.once viewport is set, there is no way to return to viewport: null ( setViewportSize doesn't accept null).However there are several issues with the way the viewport works that makes it hard to build responsive tests: I'm trying to test for responsive behavior of my library, The tests inspect the HTML state in a specific size, resize the viewport and re-check the state.įirst of all, for debugging, I really like the behavior of the fixed viewport which allows debugging with a full window while keeping the document viewport restricted. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |