artumi
artumi

Reputation: 105

How to wait for a tag not to contain attribute using protractor

I have an element which has attribute disabled='disabled'. How can i wait, until element stop having that attribute at all, not to be changed on 'enabled', but just not having that attribute at all anymore.

I am checking on attribute value like this:

el.getAttribute('disabled').then(function (atr) {
                    expect(atr).toMatch('disabled');
                });

Now i need to wait for a condition, when this attribute disappear, but didn't find any suitable solution.

Upvotes: 0

Views: 290

Answers (2)

Shiva
Shiva

Reputation: 358

You can use browser.sleep(6000);

Upvotes: -3

Florent B.
Florent B.

Reputation: 42528

You can use the expected condition elementToBeClickable. It will wait for the element to be displayed and not disabled:

var EC = ExpectedConditions;
browser.wait(EC.elementToBeClickable(element), 5000);

Upvotes: 6

Related Questions