Commit b7f4bdeb b7f4bdebbfd2833cd5a412244e13115f1d36ca3a by hexid

Split ClientUtils.getElementsInfo() tests

1 parent 8f8d8aad
......@@ -162,10 +162,9 @@ casper.test.begin('ClientUtils.getElementInfo() tests', 10, function(test) {
test.done();
});
casper.test.begin('ClientUtils.getElementsInfo() tests', 20, function(test) {
casper.test.begin('ClientUtils.getElementsInfo() first element tests', 10, function(test) {
casper.page.content = '<a href="plop" class="plip plup"><i>paf</i></a><a href="plap" class="plip plup"><i>puf</i></a>';
var info = casper.getElementsInfo('a.plip');
test.assertEquals(info[0].nodeName, 'a', 'ClientUtils.getElementsInfo() retrieves first element name');
test.assertEquals(info[0].attributes, {
'href': 'plop',
......@@ -180,7 +179,11 @@ casper.test.begin('ClientUtils.getElementsInfo() tests', 20, function(test) {
test.assert(info[0].visible, 'ClientUtils.getElementsInfo() retrieves first element visibility');
test.assertEquals(info[0].tag, '<a href="plop" class="plip plup"><i>paf</i></a>',
'ClientUtils.getElementsInfo() retrieves first element whole tag contents');
test.done();
});
casper.test.begin('ClientUtils.getElementsInfo() second element tests', 10, function(test) {
var info = casper.getElementsInfo('a.plip');
test.assertEquals(info[1].nodeName, 'a', 'ClientUtils.getElementsInfo() retrieves second element name');
test.assertEquals(info[1].attributes, {
'href': 'plap',
......