mercredi 27 juin 2018

checking button disabled in chai

How can I test that a button is disabled after filling forms data?

 <button id="ref_button" type="submit" [disabled]="editForm.form.invalid || isSaving" class="btn btn-primary">
              

I am using protractor an dcucmber and Chai to write the exectation. Ii fill teh data during atest and what I exepct is this:

dom.window.document.getElementById("ref_button").should.have.attr("[disabled]");
Now this always says that the attribute exists and does not change according to teh condition, id the data is valid the button should be enabled. Is there any other way I should do this?? Thannks!

Aucun commentaire:

Enregistrer un commentaire