The huge range of mobile devices used to browse the web, which means you really have to consider making your site mobile-compatible when designing your responsive website.
We will be learning how to run our tests in the mobile configuration using the puppeteer. We can perform this task using the puppeteer/DeviceDescriptors.
The supporter list of devices is given in Puppeteer documentation. So, go to the device descriptor file and choose your preferred device name.
You can find the device list in the chrome dev tools as well,



const puppeteer = require('puppeteer');
const devices = require('puppeteer/DeviceDescriptors');
const iPhonex = devices['iPhone X'];
puppeteer.launch({headless:false}).then(async browser => {
const page = await browser.newPage();
//We use here page.emulate so no more need to set the viewport separately
//await page.setViewport({ width: 1280, height: 800 })
await page.emulate(iPhonex);
await page.goto('https://www.chercher.tech');
await page.screenshot({ path: 'cherchertech-iphoneX.png'});
await browser.close();
});
I am Pavankumar, Having 8.5 years of experience currently working in Video/Live Analytics project.