How can I check until an element is clickable using nightwatchjs?

Viewed 11466

How can I check until an element is clickable using nightwatch js? I want to click on an element but when I run nightwatch, selenium does not click on the element because it is not clickable yet.

4 Answers

I'm unable to comment but there are a couple of issues with the code suggested by Alex R.

First, the code will not work with Firefox as geckodriver does not return a 'status'. So this:

resolve(result.status === 0 && result.value === true)

needs to be changed to this:

resolve(result.value === true).

Second, the line:

self.client.assertion(result, 'not visible or disabled', 'visible and not disabled', message, true);

doesn't work and needs to be commented out in order to get the code to run.

Related