Closed tuan91 closed 5 years ago
Differencify uses Puppeteer to run the web page and take a screenshot, so there is no real mobile device integration. But what you can do is to emulate a mobile device using Puppeteer Api. The differencify script would be something like:
const Differencify = require('differencify');
const differencify = new Differencify(GlobalOptions);
const devices = require('puppeteer/DeviceDescriptors');
(async () => {
const result = await differencify
.init()
.launch()
.newPage()
.emulate(devices['iPhone 6'])
.goto('https://github.com/NimaSoroush/differencify')
.waitFor(1000)
.screenshot()
.toMatchSnapshot()
.result((result) => {
console.log(result); // Prints true or false
})
.close()
.end();
})();
Hope this helps!
Thank you!
Hi, is it possible to test various mobile devices? If so, how can I do that? Thank you!