I have a page that’s rendering a wijmo combobox via the wijcombobox knockout binding ( http://wijmo.com/wiki/index.php/Using_Wijmo_with_Knockout ). I’m having difficulty testing this using capybara because of a race condition between the tests running and the click event being bound. There are possibly other race conditions as well, but this is the current one tripping me up. This is what I have as a current workaround:
def click_on_combobox_till_options_appear
wait_until(10) do
page.find('.wijmo-wijcombobox-trigger').click
page.has_css?('.wijmo-wijlist-item')
end
end
I’m using ‘kb-inject’ to setup my ViewModel bindings.
Is there a javascript event I can hook up to or property I can test to indicate that applyBindings has finished executing, so that I can avoid workarounds like the one above?
In terms of waiting for
applyBindingsto be called, we came up with the following workaround. It’s not great, but should serve as a basis for solving similar problems (replaceAppwith a namespace that makes sense):Specifically for the wijcombobox, we found the following to work: