Skip to content

Instantly share code, notes, and snippets.

@CaseyHaralson
Created February 12, 2016 03:44
Show Gist options
  • Save CaseyHaralson/9965492d894565bfe9d7 to your computer and use it in GitHub Desktop.
Save CaseyHaralson/9965492d894565bfe9d7 to your computer and use it in GitHub Desktop.
var currentPage = 0;
element.all(by.css('#tableid td')).map(function (page) {
var pageHtml = '';
return page.getInnerHtml().then(function (html) {
pageHtml = html;
return page.getText();
}).then(function (text) {
if (currentPage != 0 && parseInt(text) == currentPage + 1) {
return page;
}
if (pageHtml.indexOf('<span>') > -1) {
currentPage = parseInt(pageHtml.replace('<span>', '').replace('</span>', ''));
}
});
}).then(function (page) {
//never gets here, there are memory issues above
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment