【问题标题】:Cucumber Testing, Counting Page Elements黄瓜测试,计算页面元素
【发布时间】:2015-06-23 22:15:39
【问题描述】:

我正在使用 cucumber-jvm 并编写 BDD 测试。

我想为“然后我应该在一个页面上看到三个帖子”编写步骤定义(类名为 Post)

所以我最好的猜测是:

expect(page).to have_css("tbody tr.#{Post}", count: 3)

但这不起作用

【问题讨论】:

    标签: cucumber bdd


    【解决方案1】:

    怎么样:

    element = all("tbody tr.#{Post}")
    element.count
    

    这应该可以解决问题...

    【讨论】:

      猜你喜欢
      • 2018-07-04
      • 2016-10-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-12-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多