I am writing a test entry about exit functions. When the code is executed, the show element is notclickable at a point.
element.all(by.css('.dropdown-user a')).then(function(items) {
items[0].click();
ptor.sleep(500);
});
view.html
<li class="dropdown dropdown-user">
<a href="#" class="dropdown-toggle" id="logout" data-toggle="dropdown" data-hover="dropdown" data-close-others="true">
<img alt="" class="img-circle" src="../../assets/admin/layout/img/avatar3_small.jpg"/>
<span class="username username-hide-on-mobile">
</span>
<i class="fa fa-angle-down"></i>
</a>
<ul class="dropdown-menu">
<li>
<a href=""><i class="icon-user"></i> My Profile </a>
</li>
<li>
<a href=""><i class="icon-calendar"></i> My Calendar </a>
</li>
<li>
<a href=""><i class="icon-envelope-open"></i> My Inbox <span class="badge badge-danger">3 </span></a>
</li>
<li>
<a href=""><i class="icon-rocket"></i> My Tasks <span class="badge badge-success">7 </span></a>
</li>
<li class="divider">
</li>
<li>
<a href=""><i class="icon-lock"></i> Lock Screen </a>
</li>
<li ng-click="logout()">
<a href=""><i class="icon-key"></i> Log Out </a>
</li>
</ul>
</li>
Run codeHide resultIs there any way to open this dropdown menu? Could you let me know how to write code to test it?
source
share