I want to use a specific resolution on my Playwright tests using the Chrome browser. How can I do that?

I want to use a specific resolution on my Playwright tests using the Chrome browser. How can I do that?

Hi Tim,

You can add the following code snippet below to your Playwright script:

const capabilities = {
    'browserName': 'Chrome',
    'browserVersion': 'latest',
}

=====

  const page = await browser.newPage()
  await page.setViewportSize({ width: 1920, height: 1080 });
  await page.goto('YOUR URL')