// It waits for true to be returned
browser.waitUntil(() => {
return yourPageObject.fakeLnk.isDisplayed();
}, { timeout: 10000, timeoutMsg:'Fake Link did not show up after 10 seconds'});
browser.waitUntil(() => {
return $$('.tenElementsClass').map((elem) => elem.isDisplayed()).length > 9;
// Same code below but element is in page object
// return pageObj.yourElements.map((elem) => elem.isDisplayed()).length > 9;
}, { timeout: 10000, timeoutMsg:'Ten elements were not visible'});
browser.waitUntil(() => {
return yourPageObject.fakeTextLbl.getText() === 'I love rock & roll!'
}, { timeout: 10000, timeoutMsg:'"I love rock & roll "'});
browser.waitUntil(() => {
return yourPageObject.fakeTextLbl.getText() != 'I love rock & roll!'
}, {timeout: 10000, timeoutMsg:'"I love rock & roll "'});
browser.waitUntil(() => {
return browser.getUrl().includes('/friends');
}, {timeout: 10000, timeoutMsg:'"I love rock & roll "'});