Using angular 1.5, ui-bootstrap 0.14.3, bootstrap 3.2.0 & protractor 3.2.2
I'm trying to use Protractor for e2e testing of an angular/bootstrap-ui application. Demonstrating one of the specs requires the test to open a bootstrap-ui dropdown and click an element contained therein. It's not working - the test link is clicked, but the dropdown never opens (i verified the click by binding an alert to the element's onclick event - the alert popped but Protractor threw an Unexpected Alert Exception...). After trying the approaches mentioned here and here, i'm at a loss.
HTML
<div dropdown class="dropdown">
<span>
<a id="user-link" dropdown-toggle>click me</a>
</span>
<ul class="dropdown-menu">
<li>
<a href="/link1">link1</a>
</li>
<li>
<a href="/link2">link2</a>
</li>
</ul>
</div>
Protractor spec
it('opens the user menu', function () {
var userLink = element(by.id('user-link'));
expect(userLink.getInnerHtml()).toEqual('click me');
userLink.click();
var link = element(by.css('[href="/link1"]'));
expect(link.isDisplayed()).toBeTruthy();
});
As one of links suggests, i've tried using a couple difference variants on wait() function with the timeout as high as 20 seconds. I've tried browser.sleep() with the same timeout. Neither worked.
It probably goes without saying, but the dropdown opens immediately when it is clicked manually.