I got a function which enter some values into a form. This should return a promise, so my test waits till the function is finished and the values are entered in the form. How do I do this in a protractor test?
function enterSomeValuesIntoForm() {
// do some stuff
element(by.id('value1')).sendKeys('hello');
element(by.id('value2')).sendKeys('is it me you looking for?');
element(by.id('submitButton')).click();
});