如何比较的角度JS量角器实际值和预期值 [英] how to compare actual and expected values in angular js protractor

查看:187
本文介绍了如何比较的角度JS量角器实际值和预期值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在角量角器自动化,我试图用期望,但我没能做到这一点比较值。
在我们的应用程序,点击提交按钮的页面导航欢迎页面,所以当我想从欢迎页面的预期值。这是欢迎HTML页面code

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>

请帮助我..

谢谢,
Raghavendra

Thanks, Raghavendra

推荐答案

只是检查标题为新位置的元素是present。

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

这篇关于如何比较的角度JS量角器实际值和预期值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆