mardi 14 février 2017

verify attribute is not present in DOM after an action - Protractor

I have a dynamic attribute, which disappears once certain action is performed on it:

<input type="checkbox" checked="checked" class="includeUnclaimedChk">

For example, once this checkbox is unchecked, then checked="checked" completely disappears from DOM. How can I verify this in Protractor?

What I have done currently is to verify this attribute is checked:

expect(page.isEnabledClaimedCheckbox).toBe("checked");

hasState is defined in POM file:

this.claimedCheckbox = browser.element(by.css('input[class="includeUnclaimedChk"]'));

this.isEnabledClaimedCheckbox= function() {
    return this.claimedCheckbox.getAttribute('checked');
};




Aucun commentaire:

Enregistrer un commentaire