Another great feature of the Playwright (Context Options Configuration)
You can use it to create numerous browser contexts with various setups. This is helpful for simulating various testing scenarios. For example, you may replicate a scenario in which a user visits your site incognito on iPhone 14:
Sample code (Javascript):
const iPhone14 = playwright.devices[‘iPhone 14’];
const context = await browser.newContext({
…iPhone14,
isMobile: true,
hasTouch: true,
javaScriptEnabled: true,
colorScheme: ‘light’,
acceptDownloads: true
});
const page = await context.newPage();