-
-
Save CaseyHaralson/7153be9f437f4e3a7f5c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var currentPage = 0; | |
var promises = []; | |
var nextPage; | |
element.all(by.css('#tableid td')).then(function (pages) { | |
for (var i = 0; i < pages.length; i++) { | |
var page = pages[i]; | |
var deferred = protractor.promise.defer(); | |
promises.push(deferred.promise); | |
page.getInnerHtml().then(function (html) { | |
if (html.indexOf('<span>') > -1) { | |
currentPage = parseInt(html.replace('<span>', '').replace('</span>', '')); | |
} | |
page.getText().then(function (text) { | |
if (currentPage != 0 && parseInt(text) == currentPage + 1) { | |
nextPage = page; | |
} | |
deferred.fulfill(true); | |
}); | |
}); | |
return protractor.promise.all(promises); | |
}).then(function () { | |
var test = ''; //won't make it here | |
// I assume if it did that I could then click on "nextPage" a element | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment