如何比较 angular js量角器中的实际值和预期值
how to compare actual and expected values in angular js protractor
在 angular 量角器自动化中,我试图使用 "expect" 比较值,但我做不到。
在我们的应用程序中,点击提交按钮后页面导航到欢迎页面,所以我想从欢迎页面获得预期值。这是欢迎页面 Html 代码
<a class="link-btn ng-binding" title="new position" ng-click="openPositionModal($event)"><i class="icon-plus"></i> new position</a>
请帮帮我..
谢谢,
拉加文德拉
只需检查标题为 "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);
})
在 angular 量角器自动化中,我试图使用 "expect" 比较值,但我做不到。 在我们的应用程序中,点击提交按钮后页面导航到欢迎页面,所以我想从欢迎页面获得预期值。这是欢迎页面 Html 代码
<a class="link-btn ng-binding" title="new position" ng-click="openPositionModal($event)"><i class="icon-plus"></i> new position</a>
请帮帮我..
谢谢, 拉加文德拉
只需检查标题为 "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);
})