wdio-visual-regression-service icon indicating copy to clipboard operation
wdio-visual-regression-service copied to clipboard

context.meta.viewport for mobile

Open ericzered opened this issue 6 years ago • 1 comments

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

ericzered avatar Jun 08 '18 12:06 ericzered

Mobile doesn't have viewports, it has orientations context.meta.viewport || context.meta.orientation

aaron-humerickhouse avatar Nov 26 '18 16:11 aaron-humerickhouse