how to compare actual and expected values in angul

2019-06-14 01:59发布

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条回答
冷血范
2楼-- · 2019-06-14 02:56

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);
})
查看更多
登录 后发表回答