News for hackers. Stuff that matters.
Re:How to make Selenium tests reliable, scalable, and mainta... by pmontra on Wednesday July 22, 2015 @02:40AM (#9928059)
Ruby's Capybara encapsulates Selenium and waits until elements appear on the page (the default timeout is 2 seconds). So you can write simple sequential code like

    click_link('bar')
    expect(page).to have_content('baz')
and it will work even if the baz element is injected into the page by an Ajax request to the server triggered by clicking on bar. I've been using it for many years but I didn't check how they implement it. Maybe a callback from a MutationObserver? https://developer.mozilla.org/en-US/docs/Web/API/MutationObs...

Documentation at https://github.com/jnicklas/capybara#asynchronous-javascript...

Re:How to make Selenium tests reliable, scalable, and mainta... by drothlis on Wednesday July 22, 2015 @11:34AM (#9930211)
According to that documentation you linked, it just polls until `default_max_wait_time` (which defaults to 2 seconds).