var grid, wrapper; describe.feature = function(description, suite) { describe(description, function() { before(function(done) { initializeGrid(); waitUntil(function() { return grid.then; }, done, done); }); after(function() { return grid; //make sure everything is finished before moving on. }); suite(); }); }; function waitUntil(check, exec, onTimeout) { var id = setInterval(function() { if (check()) { clearInterval(id); clearTimeout(timeoutId); exec(); } }, 100); var timeoutId = setTimeout(function() { clearInterval(id); assert.fail(); onTimeout(); }, 5000); } function initializeGrid() { wrapper = document.getElementById("gridwrapper"); wrapper.innerHTML = "" + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " " + " "+ "
Grid10000
VaadinX1000
NameValue
" + "
"; grid = wrapper.querySelector("v-grid"); return grid; }; var local = function() { return Polymer.dom(grid.root); }; var light = function() { return Polymer.dom(grid); }; var qLocal = function(selector) { return local().querySelector(selector); }; var qaLocal = function(selector) { return local().querySelectorAll(selector); }; var qLight = function(selector) { return light().querySelector(selector); };