温馨提示:本文翻译自stackoverflow.com,查看原文请点击:testing - testcafe: How to eliminate checkbox with attribute read-only
automated-tests automation e2e-testing testcafe testing

testing - testcafe:如何消除具有只读属性的复选框

发布于 2020-03-27 16:18:07

我有两种复选框:

<input _ngcontent="" class="checkbox" type="checkbox" id="formly_32">

<input _ngcontent="" class="checkboxe" type="checkbox" id="formly_32" readonly="readonly" disabled="">

我想在我的循环中消除第二种类型(这意味着具有属性:“只读”)...我定义了以下选择器:

this.checkBoxs = Selector('input').withAttribute('type', 'checkbox').filter(c =>!c.disabled);

但这是行不通的,因为当转到属性为只读的复选框时,我的循环会停止工作:

 if ((await (this.checkBoxs.exists)) {

.....}

我不知道如何解决。

查看更多

查看更多

提问者
Monia
被浏览
53
Alex Skorkin 2020-01-31 17:17

该错误位于用户代码中。