如何在angular js量角器中比较实际值和期望值



在角量角器自动化中,我试图使用"expect"来比较值,但我无法做到。在我们的应用程序中,点击提交按钮后,页面导航到欢迎页面,所以我想从欢迎页面获得预期的值。这是欢迎页面的Html代码

<a class="link-btn ng-binding" title="new position" ng-click="openPositionModal($event)"><i class="icon-plus"></i> new position</a>

请帮帮我……

谢谢,Raghavendra

检查标题为"new position"的元素是否存在

it('should navigate to the welcome page', function() {
    // Code that clicks the submit button etc
    var newPositionLink = element(by.css('[title="new position"]'));
    expect(newPositionLink.isPresent()).toEqual(true);
})

最新更新