I am working on angular 4 test automation and using Protractor tool. After many video tutorials I concluded that there is no need of WAIT functions for synchronization while using protractor. When I use browser.WaitForAngularEnabled(true)
it hangs the browser until jasmine default time expires and the test case fails. Attached is the spec.ts beforAll()
block code. Can any one tell me whether my concept is false or true and if it is true then what is the issue?
login = new LoginPage();
addMemeber = new AddMemberClass();
return new Promise((resolve)=>{
login.navigateTo().then(()=>{
login.getEmailInput().sendKeys('valid_email@gmail.com');
login.getPasswordInput().sendKeys('123456');
login.getLoginButton().click();
console.log('here is protractor');
browser.waitForAngularEnabled(true);
expect(browser.getCurrentUrl()).toContain('organization').then(()=>{
console.log('Nave bar present');
resolve();
})
});