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) { ...@@ -162,10 +162,9 @@ casper.test.begin('ClientUtils.getElementInfo() tests', 10, function(test) {
162 test.done(); 162 test.done();
163 }); 163 });
164 164
165 casper.test.begin('ClientUtils.getElementsInfo() tests', 20, function(test) { 165 casper.test.begin('ClientUtils.getElementsInfo() first element tests', 10, function(test) {
166 casper.page.content = '<a href="plop" class="plip plup"><i>paf</i></a><a href="plap" class="plip plup"><i>puf</i></a>'; 166 casper.page.content = '<a href="plop" class="plip plup"><i>paf</i></a><a href="plap" class="plip plup"><i>puf</i></a>';
167 var info = casper.getElementsInfo('a.plip'); 167 var info = casper.getElementsInfo('a.plip');
168
169 test.assertEquals(info[0].nodeName, 'a', 'ClientUtils.getElementsInfo() retrieves first element name'); 168 test.assertEquals(info[0].nodeName, 'a', 'ClientUtils.getElementsInfo() retrieves first element name');
170 test.assertEquals(info[0].attributes, { 169 test.assertEquals(info[0].attributes, {
171 'href': 'plop', 170 'href': 'plop',
...@@ -180,7 +179,11 @@ casper.test.begin('ClientUtils.getElementsInfo() tests', 20, function(test) { ...@@ -180,7 +179,11 @@ casper.test.begin('ClientUtils.getElementsInfo() tests', 20, function(test) {
180 test.assert(info[0].visible, 'ClientUtils.getElementsInfo() retrieves first element visibility'); 179 test.assert(info[0].visible, 'ClientUtils.getElementsInfo() retrieves first element visibility');
181 test.assertEquals(info[0].tag, '<a href="plop" class="plip plup"><i>paf</i></a>', 180 test.assertEquals(info[0].tag, '<a href="plop" class="plip plup"><i>paf</i></a>',
182 'ClientUtils.getElementsInfo() retrieves first element whole tag contents'); 181 'ClientUtils.getElementsInfo() retrieves first element whole tag contents');
182 test.done();
183 });
183 184
185 casper.test.begin('ClientUtils.getElementsInfo() second element tests', 10, function(test) {
186 var info = casper.getElementsInfo('a.plip');
184 test.assertEquals(info[1].nodeName, 'a', 'ClientUtils.getElementsInfo() retrieves second element name'); 187 test.assertEquals(info[1].nodeName, 'a', 'ClientUtils.getElementsInfo() retrieves second element name');
185 test.assertEquals(info[1].attributes, { 188 test.assertEquals(info[1].attributes, {
186 'href': 'plap', 189 'href': 'plap',
......