how to compare actual and expected values in angular js protractor

独自空忆成欢 提交于 2020-01-03 04:43:19

问题


In angular protractor automation,am trying to compare the values using "expect" but am not able to do it. In our application, after clicking on submit button the page is navigating to welcome page, so i want to get the expected value from the welcome page. This is the welcome page Html code

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

please help me..

Thanks, Raghavendra


回答1:


Just check if an element with the title "new position" is present.

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);
})


来源:https://stackoverflow.com/questions/31602416/how-to-compare-actual-and-expected-values-in-angular-js-protractor

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!