Warm tip: This article is reproduced from stackoverflow.com, please click
automated-tests automation e2e-testing testcafe testing

testcafe: How to eliminate checkbox with attribute read-only

发布于 2020-03-27 15:47:00

I have two kind of checkobox:

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

and

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

I would like to eliminate the second type (it means with the attribute: "read-only" ) in my loop... I defined the selector following:

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

But it does not work because my loop stops work when going to the checkbox with attribute read-only:

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

.....}

I have no idea how to solve it.

Questioner
Monia
Viewed
125
Alex Skorkin 2020-01-31 17:17

The bug was in the user's code.