Codeception Acceptance Test如何查找css Pseudo classes元素

时间:2017-08-04 03:49:21

标签: codeception

我的测试Html像这样:

<a  class="waves-effect waves-light btn red ">Delete</a>

删除

我想使用css选择器,如:

.red:not(.disabled):first

但是我在Codeception Acceptance测试用例中写了

$I->click(['css' =>'.red:not(.disabled):first']);

会抛出错误:

Strict locator is malformed: css => .red:not('.disabled):first

Codeception如何获得此元素?

1 个答案:

答案 0 :(得分:0)

更改为xpath选择器'(//*[contains(@class,"red") and not(@disabled)])[1]'可以帮助您。