protractor
protractor copied to clipboard
Is it possible to call a angular function in the controller?
I want to call a fucntion thats called navigateTo, would that be possible?
I'm not sure what you mean by 'in the controller'. navigateTo is a function in the scenario runner - it is not present in AngularJS or in Protractor.
In general, your end to end tests should not be directly calling functions in your test code. However, Protractor does allow you to evaluate statements in the context of an element. So, if your element with id 'foo' has a function on the scope 'doStuff', you could call:
ptor.findElement(protractor.By.id('foo')).evaluate('doStuff()');