Commit a8f292bc a8f292bc175c69393435efffaccf20aa5bb19055 by Ryan Frederick

refs #917 - added capture zoom factor tests

1 parent 038f36c0
......@@ -142,6 +142,35 @@ casper.test.begin('ClientUtils.getElementBounds() tests', 3, function(test) {
});
});
casper.test.begin('ClientUtils.getElementBounds() page zoom factor tests', 3, function(test) {
casper.start().zoom(2).then(function() {
var html = '<div id="boxes">';
html += ' <div id="b1" style="position:fixed;top:10px;left:11px;width:50px;height:60px"></div>';
html += ' <div style="position:fixed;top:20px;left:21px;width:70px;height:80px"></div>';
html += '</div>';
this.page.content = html;
test.assertEquals(
this.getElementBounds('#b1'),
{ top: 20, left: 22, width: 100, height: 120 },
'ClientUtils.getElementBounds() is aware of the page zoom factor'
);
var bounds = this.getElementsBounds('#boxes div');
test.assertEquals(
bounds[0],
{ top: 20, left: 22, width: 100, height: 120 },
'ClientUtils.getElementsBounds() is aware of the page zoom factor'
);
test.assertEquals(
bounds[1],
{ top: 40, left: 42, width: 140, height: 160 },
'ClientUtils.getElementsBounds() is aware of the page zoom factor'
);
});
casper.run(function() {
test.done();
});
});
casper.test.begin('ClientUtils.getElementInfo() tests', 10, function(test) {
casper.page.content = '<a href="plop" class="plip plup"><i>paf</i></a>';
var info = casper.getElementInfo('a.plip');
......