I am attempting to retrieve page number values from the method getPageNumber(), where the page number is being printed in the console. However, that value is not being used in the While loop. Even when I try to print pageNum, it returns a promise. Refer to the console output. https://i.sstatic.net/7mUuv.png
it('TS-06, should be able to navigate to Manage Users Screen',function(){
clientAdminPortal.clickMenuInSideBar("User Management");
manageUsers.at().then(function() {
console.log("---> Navigated to Manage Users Screen");
});
expect(manageUsers.isVisible(manageUsers.searchTxtBox)).toBeTruthy();
});
it('TS-10, verify Activate Button is viewed for all users',function(){
var i=1;
var check=false;
var pageNum=manageUsers.getPageNumber();
while(i<pageNum){
console.log("check");
i++;
}
});
this.getPageNumber=function(){
return this.pgnumCount.then(function(number){
console.log(number.length);
return number.length;
});
};