Skip to content

Add mob.getWindowSize #154

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions src/ox_modules/module-mob/commands/getWindowSize.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
* Copyright (C) 2015-present CloudBeat Limited
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*/

/**
* @summary Sets the size of the outer browser window.
* @function getWindowSize
* @return {Object} Size object. Example: { height: 1056, width: 1936, x: -8, y: -8 }
* @example <caption>[javascript] Usage example</caption>
* mob.init();//Opens browser session.
* mob.open("www.yourwebsite.com");// Opens a website.
* const sizeObject = mob.getWindowSize();
*/
module.exports = async function() {
return await this.driver.getWindowSize();
};
1 change: 1 addition & 0 deletions src/ox_modules/module-mob/commands/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export {default as getText} from './getText';
export {default as getTitle} from './getTitle';
export {default as getUrl} from './getUrl';
export {default as getValue} from './getValue';
export {default as getWindowSize} from './getWindowSize';
export {default as hideKeyboard} from './hideKeyboard';
export {default as index} from './index';
export {default as installApp} from './installApp';
Expand Down