<div class="user-nav">
<ul>
<li hs-gesture="{ handler: toggleDutyStatus }" ng-class="onDuty|switch:{true:'on',false:'off'}" id="user-menu-duty" user-profile-btn-do-not-close="" class="ng-binding on" style="">
<i ng-hide="onDuty==undefined" ng-class="onDuty|switch:{true:'icon-duty',false:'icon-off-duty'}" class="icon-duty" style=""></i>On Duty
</li>
<li ng-show="false" ng-bing="" id="user-menu-settings" class="ng-binding ng-hide"><i class="icon-settings"></i>Settings</li>
<li hs-gesture="{ handler: changeUnit}" ng-show="canChangeUnit" id="user-menu-unit" class="ng-binding ng-hide"><i class="icon-lock"></i>Change Unit</li>
<li hs-gesture="{ handler: changePassword}" ng-show="canChangePassword" id="user-menu-change-password" class="ng-binding"><i class="icon-lock-change"></i>Change Password</li>
<li hs-gesture="{ handler: showAbout}" id="user-menu-about" class="ng-binding"><i class="icon-about"></i>About</li>
<li hs-gesture="{ handler: showScreenHelp}" ng-show="canShowHelp" id="user-menu-screenhelp" class="ng-binding ng-hide"><i class="icon-question-round"></i>Help</li>
<li hs-gesture="{ handler: logout}" id="user-menu-logout" class="ng-binding"><i class="icon-lock"></i>Log Out</li>
</ul>
场景:从应用中退出。已经从未显示的脚本的其余部分单击了一个按钮。用户有4种选择,我们喜欢“退出”。被双击。
从上面的代码片段代码中,在Protractor中执行此操作的最佳方法是什么?
答案 0 :(得分:0)
只需通过ID获取并使用browser.actions()
执行双击:
var logout = element(by.id("user-menu-logout"));
browser.actions().doubleClick(logout).perform();