lundi 19 décembre 2016

How to test if a checkBox is checked in ionic 2

I am testing an application based on ionic 2 and angular 2 using protractor. I would like to test if and when a ion-checkbox is checked. Assuming that there is only one checkBox in the Page, I have tried this:

var checkBox = element(by.css('ion-checkbox'));
expect(checkBox.isSelected()).toBe(true);

The above test does not work properly as the property isSelected() is always false even if the checkBox is checked. As far as I know there is no property isChecked(). How can I test it then?




Aucun commentaire:

Enregistrer un commentaire