wdio-visual-regression-service
wdio-visual-regression-service copied to clipboard
context.meta.viewport for mobile
Hello, I'm in the wdio.conf.js and I'm trying to get the size of the browser to put it in the screenshot name. I've tried like this :
var browserViewport = context.meta.viewport;
var browserWidth = browserViewport.width;
var browserHeight = browserViewport.height;
But it's only working for desktop browser. I have ‘Cannot read property 'viewport' of undefined ‘ for mobile device (android and iOS). Is they're a way to get it on mobile ? Thanks a lot
Mobile doesn't have viewports, it has orientations
context.meta.viewport || context.meta.orientation