Passing a function as parameter [Protractor + Javascript]