【问题标题】:how to compare actual and expected values in angular js protractor如何比较角度js量角器中的实际值和预期值
【发布时间】:2015-07-24 14:22:19
【问题描述】:

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

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

请帮帮我..

谢谢, 拉加文德拉

【问题讨论】:

  • 您要检查的究竟是什么?
  • 我想检查一下,点击提交按钮后,页面是否导航到欢迎页面。

标签: angularjs automation protractor


【解决方案1】:

只需检查是否存在标题为“新位置”的元素。

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-10-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多