I have testing code that looks like this:
pageLogin(userName: string, password: string) {
element(by.id('loginUserName')).clear();
element(by.id('loginPassword')).clear();
element(by.id('loginUserName')).sendKeys(userName);
element(by.id('loginPassword')).sendKeys(password);
element(by.id('loginButton')).click();
expect(element(by.id('ngApp')).isPresent()).toBe(true);
}
Can someone explain to me. Do I need to wait for promises to be returned from the first five rows of my function before the expect? Are the lines inside this function executed async?