17.10.2018 Views

Angular

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

});<br />

function checkNavbarTexts(){<br />

element(by.id('home-navbar')).getText().then(function(text){ // Promise<br />

expect(text).toEqual('Home');<br />

});<br />

element(by.id('list-navbar')).getText().then(function(text){ // Promise<br />

expect(text).toEqual('List');<br />

});<br />

}<br />

element(by.id('create-navbar')).getText().then(function(text){ // Promise<br />

expect(text).toEqual('Create');<br />

});<br />

function navigateToListPage(){<br />

element(by.id('list-home')).click().then(function(){ // first find list-home a tag and than<br />

click<br />

browser.sleep(2000).then(function(){<br />

browser.getCurrentUrl().then(function(actualUrl){ // promise<br />

expect(actualUrl.indexOf('list') !== -1).toBeTruthy(); // check the current url is list<br />

});<br />

});<br />

}<br />

});<br />

});<br />

GoalKicker.com – <strong>Angular</strong> 2 Notes for Professionals 166

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!