Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

context.meta.viewport for mobile #82

Open
ericzered opened this issue Jun 8, 2018 · 1 comment
Open

context.meta.viewport for mobile #82

ericzered opened this issue Jun 8, 2018 · 1 comment

Comments

@ericzered
Copy link

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

@aaron-humerickhouse
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants