Skip to content

Comment on Nightwatch.js

Comments

Offtopic:

the line

.waitForElementVisible("button[name=btnG]", 1000)

in the demo test caught my attention - what is a good way to achieve this in production code? i.e. execute a function when a certain element which matches the query becomes visible?

atm i'm using the DOMNodeInserted event (debounced)

$(document).on('DOMNodeInserted', _.debounce(function(e, ui) {}, 100);

Take a look at Mutation Observers. The only problem might be browser support: http://caniuse.com/#search=MutationObserver

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.