UNPKG

progalenor

Version:

A protractor helper library for responsive testing

18 lines (16 loc) 598 B
(function() { 'use strict'; var utils = require('../utils/utils'); module.exports = function(element1, element2, range) { return element1.getLocation().then(function(loc1) { return element2.getLocation().then(function(loc2) { return utils.elementHeight(element1).then(function(height) { if (range) { return utils.distanceWithinRange(range, (loc1.y + height), loc2.y); } return loc1.y + height <= loc2.y; }); }); }); }; })();