[英]How to achieve browser resizing in run time using playwright? in a e2e test run
我們在 protractor 中有: browser.driver.manage().window().setSize( width - 30, height );
如何在劇作家中實現這一目標?
要調整您的 playwrite 瀏覽器 window:您可以使用方法page.setViewportSize()
例如:
import { test, expect, devices } from '@playwright/test';
test('test', async ({ page }) => {
page.setViewportSize({ width: 600, height: 600 });
// do stuff then resize to a particular device size
page.setViewportSize(devices['iPhone X'].viewport);
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.