Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- getBoundingClientRect: function(selector, callback) {
- var webdriverio = this._webdriverio;
- webdriverio.getElementSize(selector)
- .then(function(size) {
- webdriverio.getLocation(selector)
- .then(function(location) {
- var rect = {
- width: size.width,
- height: size.height,
- top: location.y,
- left: location.x,
- bottom: location.y + size.height,
- right: location.x + size.width
- };
- callback(null, rect);
- })
- .catch(function(error) {
- callback(error);
- });
- })
- .catch(function(error) {
- callback(error);
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement